Custom Unified.js Plugins (Admonitions + Type Links) #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces one new Remark plugin and a new Remark-Rehype Handler, both of which resolve issues or outdated features resulting from the upgrade to Docusaurus v3 and the major bump of dependencies.
Remark-Rehype Handlers for Admonitions
docusaurus-plugin-moonwave
now uses a custom remark plugin that usesremark-directive
to turn commonmark directives in markdown into Docusaurus-style admonitions.These new handlers adds support for:
:note[Some description]
::note[Some description]
This is ultimately a replacement for remark-admonitions, which is outdated and not used in Docusaurus v3 anymore, Docusaurus now has a built-in admonition plugin.
By replacing it, we get access to new features brought with
remark-directive
, and a custom handlers to allow us to replace Docusaurus admonitions with our own by replacing markdown directives directly with our own admonition components in the future.Extended Link References Plugin
In the updated version of Unified, they patched Link References with no definitions, e.g.
[label]
. While they consider this parsing to be a bug, Moonwave of course used it for type links. This plugin includes a Micromark syntax extension and an extension for mdast-util-from-markdown which re-adds support for this syntax.Other