-
I had this idea, that unist could (somehow) emulate libraries like nunjucks, liquid, and handlebars. This way, the document would be only be parsed and written once. I don't really know where this would fit into the unified ecosystem. I feel like it would need a new AST, with plugins for other ecosystems (eg. remark, rehype). I did have a look at unifiedjs/collective, so I know I would need to start a motion to make this official. What logic needs to be defined, in order for this to become a reality? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey! I think where it makes sense depends some more on what you’re thinking of. Are you thinking of a particular language? Multiple? What are the “units” in the tree? Interpolation, calls, strings, what else? What does an AST for this solve? How do you mean it would only be parsed once and written once (I think I get it, but just to be sure)? I don’t think we need to prematurely figure out how it all should be organized. Projects working with unified/unist can exist fine on their own outside of “our” maintenance (a small example is: https://github.com/wooorm/dioscuri) |
Beta Was this translation helpful? Give feedback.
-
I've created this https://github.com/linonetwo/template-based-generator-template using mdast utils to parse md based template, and fill slots using variables inside JSON, and serialize using nlcst utils. |
Beta Was this translation helpful? Give feedback.
Hey!
I think where it makes sense depends some more on what you’re thinking of. Are you thinking of a particular language? Multiple? What are the “units” in the tree? Interpolation, calls, strings, what else? What does an AST for this solve? How do you mean it would only be parsed once and written once (I think I get it, but just to be sure)?
I don’t think we need to prematurely figure out how it all should be organized. Projects working with unified/unist can exist fine on their own outside of “our” maintenance (a small example is: https://github.com/wooorm/dioscuri)