-
Notifications
You must be signed in to change notification settings - Fork 15
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
remark@next (13) #22
Comments
Ok, so I took the night to study the problem. If I understand well, this plugin is obsolete. The parsing is now done in micromark and than I can't rewrite the tokenizers of I wonder what to do. How should I support such a syntax ? Basically everything is outdated and I must rewrite a plugin from scratch and first study micromark. It's a lot of hard work. A hint on how to do it well will be very welcome. I guess that you don't remember what that plugin does and how it works. Here a little summary : This plugin extends the tokenizers of remark-parse to support syntax like that : So now, they is no more tokernizer to extend. Should I extend the state machine of micromark (SyntaxExtension ?) or do it in the unified/remark ecosystem (maybe hard or near to impossible due to edge-cases as Ok, thinking about it made me realize that I only one main question. I think, i have no chose but to extend micromark. Do you think it's possible ? Is there any doc available about it or I will have to study the source code ? Thank for improving the remark ecosystem and in advance to any help provided. |
For generic directives, I wrote an attribute parser, that support Architecturally, there is a) a tokenizing part, where you parse I like building things in separate projects. But you don’t have to: it can all live in this project. The reasons why I split things up, are a) just nice coding for me, b) not everyone needs a syntax tree, so I also have micromark html extensions, c) in the future there will be a CST, not sure how or when that would be, but mdast wouldn’t be the only tree format. For the tokenizing part, I think you’d be looking for The complex part for attrs is that they’re added to other constructs. You can access the For the flow part (blocks), I see that you have two different ways: setext headings attributes on their own line, ATX headings inline. I would suggest doing only the setext heading way: a “block” attribute starts at a line, cannot include line endings, and ends at a line ending. Alright, already a wall of text, so I’ll quit now. That should give you some ideas on how to go about it. |
What's the current status? Is there a new remark plugin on the horizon that will provide the functionality of this one with the new micromark parser? |
No progress.
I don't have any need for it, so I focus on other topics.
Any contribution will be welcomed.
|
It looks like this may be a suitable replacement, as well https://github.com/remarkjs/remark-directive |
Directive should have been the way to go since the CommonMark compatibility, but directive never really make it way to the CommonMark standard. I wonder if it's used anywhere. But in principle, it's nice, maybe a little complex but still nice. It's also difficult to implement to remark but that not a real argument because attributes-style (like remark-attr) become slightly more complicated to implement with µmark. PS: If you plan to use remark-directive take a look at https://github.com/micromark/micromark-extension-directive. |
It’s getting some traction: a growing number of questions about it and users of it! |
Made a simple plugin from scratch that works well with Don't know how well it is aligned with the plugins ecosystem. Patching If somebody has the power to make a package out of it, feel free to grab the source. |
Is this code still working? Has anyone made a package out of it yet? That would be much appreciated! |
Hi!
remark is switching to a new parser (and compiler) internally (micromark,
remarkjs/remark#536
), which will break this plugin.Keep an eye out for remark-footnotes, remark-frontmatter, remark-gfm, remark-math, and other syntax plugins similar to this one, which could serve as inspiration for this plugin. Typically, these syntax plugins will be small wrapper code around micromark and mdast extensions btw. Also: feel free to ask me questions!
The text was updated successfully, but these errors were encountered: