Skip to content

When does the order of .use() invocations matter? #137

Answered by wooorm
NickSto asked this question in Q&A
Discussion options

You must be logged in to vote

heya!

The order does matter. Basically always.
But: there are three slots where things go into.

To start things off: “attachers” run: the functions that materialize as plugins, in order they were attached (or “.used”).

Some plugins add syntax extensions: remark-frontmatter adds a tiny thing so that micromark knows how to handle YAML.
And it adds something so that YAML can be compiled as well.

Most plugins returns a transformer.

So everything is attached and syntax extensions are defined.
Then all the transformers run and change the tree.

And finally, that tree is turned into markdown again.

Sooo: Assume order does matter, but understand that there are “slots” for parsing, transforming, an…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NickSto
Comment options

@wooorm
Comment options

Answer selected by NickSto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
🗄 area/interface This affects the public interface
2 participants