Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 grammar node in a post #38

Closed
breck7 opened this issue Sep 16, 2021 · 3 comments
Closed

💡 grammar node in a post #38

breck7 opened this issue Sep 16, 2021 · 3 comments

Comments

@breck7
Copy link
Owner

breck7 commented Sep 16, 2021

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
Copy link
Owner Author

breck7 commented Feb 28, 2022

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
Copy link
Owner Author

breck7 commented Jun 13, 2022

Here is the upstream Grammar issue: breck7/scrollsdk#106

@breck7
Copy link
Owner Author

breck7 commented Aug 26, 2022

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

@breck7 breck7 closed this as completed Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant