scroll icon indicating copy to clipboard operation
scroll copied to clipboard

💡 grammar node in a post

Open breck7 opened this issue 3 years ago • 2 comments

Sometimes you might want to create a node type on the fly.

Example #1: These 3 files [https://github.com/breck7/breckyunits.com/tree/main/markups] could really be just 1.

Example #2: In this post: https://github.com/breck7/breckyunits.com/blob/main//how-james-park-built-fitbit.scroll

Instead of this:

paragraph
 <b>Guy:</b> Wow.

paragraph
 <b>James:</b> Yeah. I don't think I quite knew what that meant back

You could have something like:

grammar
 guyNode
  extends paragraphNode
  crux guy
  compile <b>Guy</b>: super.compile

guy
 Wow

james
 Yeah. I don't think I quite knew what that meant back

breck7 avatar Sep 16 '21 01:09 breck7

Moving imports upstream to the Tree Notation level (probably emulating a combo of Racket's "#lang" with Deno's url imports), seems to be more universally useful. And then you could easily add grammar nodes to a post by importing the Grammar language in the post first.

breck7 avatar Feb 28 '22 19:02 breck7

Here is the upstream Grammar issue: https://github.com/breck7/jtree/issues/106

breck7 avatar Jun 13 '22 22:06 breck7

v28 now supports defining new node types right in a scroll page.

breck7 avatar Aug 26 '22 20:08 breck7