Closed NonozgYtb closed 1 year ago
The checks finally passed (sorry for the 3 fixs commits).
Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:
Coverage data is based on head (
f709827
) compared to base (951a17d
). Patch coverage: 100.00% of modified lines in pull request are covered.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Welcome @NonozgYtb! Thanks for taking the time to contribute! A few things before getting into a more technical code review.
WHY ?
I'm creating a custom unified function who use the remark-directive and this compiler to compile custom "block" and get an object output to use in custom template.
Could you expand a bit on this? Unified can be nested, where a plugin calls its parent pipeline with content, or creates it's own new pipeline to do processing. Was there a particular problem you ran into with this approach?
This approach may make sense (more on that in a moment), but I want to make sure it either solves the problem you're facing or is a step towards fixing a problem you face, before investing time in reworking this plugin.
I have isolated the compiler in the compiler function.
Unified/Rehype has some precedence for this, for example:
Note that in both circumstances, the compiler piece gets its own repository in syntax-tree
and the rehype
repository becomes a wrapper around that.
Closing, plugins are for plugins, utilities are for everything under that. In this case, you can use hast-util-to-jsx-runtime
Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/*
labels.
Initial checklist
Description of changes
I have isolated the compiler in the
compiler
function. I linked this function with the classic use case (unified plugin). I also created arehypeToReact
function that uses the compiler and options without using unified (useful in some cases!).I added 2 tests : the first and the last of "normal unified plugin test" with the
rehypeToReact
function. I also added docs of the function.WHY ?
I'm creating a custom unified function who use the remark-directive and this compiler to compile custom "block" and get an object output to use in custom template. (Read the exemple below)
Output : (fake rendering)
I'm french, sorry for my english mistakes. 😅