You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Docusaurus site currently configures the remark-includes plugin to transform content before we build the site. This uses a lot of custom logic that we can replace with MDX-native imports, including both importing Markdown and importing code snippet content.
We can write a script that replaces our (!path!) syntax with:
An import statement at the top of the including page
A React-style component tag pair at the site of the (!path!) expression
Then we can run the script once for all of our partials.
We can also replace our home-grown parameter substitution logic with something like {props.name} in the Docusaurus Markdown import example.
Ideally, this will also mean that we don't have to invoke remark-includes in order to lint partials, since remark won't exit with an error as it does when it encounters our {{ param="value" }} syntax, and can lint these files as regular MDX documents. This will reduce the time it takes our remark linter to run.
The text was updated successfully, but these errors were encountered:
The Docusaurus site currently configures the
remark-includes
plugin to transform content before we build the site. This uses a lot of custom logic that we can replace with MDX-native imports, including both importing Markdown and importing code snippet content.We can write a script that replaces our
(!path!)
syntax with:import
statement at the top of the including page(!path!)
expressionThen we can run the script once for all of our partials.
We can also replace our home-grown parameter substitution logic with something like
{props.name}
in the Docusaurus Markdown import example.Ideally, this will also mean that we don't have to invoke
remark-includes
in order to lint partials, sinceremark
won't exit with an error as it does when it encounters our{{ param="value" }}
syntax, and can lint these files as regular MDX documents. This will reduce the time it takes ourremark
linter to run.The text was updated successfully, but these errors were encountered: