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
{{ message }}
Repository navigation
Commit a4c9684
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add a markdown option for remark, rehype, and recma plugins (#1157)
* refactor(core): move the type annotations plugin to `src/plugins`
It is a remark plugin, with its mdast and hast handlers, rather than a
utility. `#plugins/*` imports it.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(react): move the `jsx-ast` plugins out of `utils`
They are the remark and rehype plugins of `jsx-ast`, rather than
utilities.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): add Markdown pipelines and the `markdown` option
Generators declare the unified plugins they process Markdown with as
`markdown`, taking the configured plugins in place of `'...'`. The
`markdown` option adds plugins globally and per generator, resolved
from the file declaring them so that worker threads can import them.
Each thread loads the pipeline of the generators it runs, and
`getProcessor(name)` gives their processor.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): add the Shiki rehype plugin
Highlights code with Shiki as a rehype plugin, configurable with more
languages, aliases, themes, and transformers. It loads through `load`,
as creating its highlighter is asynchronous, and creates the Shiki
instance on first use, so threads that never highlight code skip it.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(core): use Markdown pipelines in `ast`, `metadata`, and `json`
The configured remark plugins run on each whole document once `ast`
parses it, and `metadata` and `json` parse and serialise Markdown with
their syntax.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* feat(react): use the Markdown pipeline in `jsx-ast`
The pages run the configured remark, rehype, and recma plugins, the
rehype ones before code is highlighted. Types and signatures are
highlighted by the Shiki plugin of the pipeline.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(legacy): use Markdown pipelines in the legacy generators
The legacy generators declare their pipelines, taking no configured
plugins, so their output stays the same. The processors of
`@doc-kit/core/utils/remark.mjs` go, and the Shiki step of
`utils/highlighter.mjs` moves to `legacy-html`, its last user.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* docs: document Markdown plugins
Documents the `markdown` option, the Shiki plugin options, and how
generators declare their pipelines. The changeset also lists the
`@doc-kit/core` modules that are removed or moved.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
* chore: dry
* refactor(core): split up `Promise.all` calls and ternaries
Builds each list of promises before awaiting it, imports the Shiki
themes in a step of their own, and replaces the ternaries resolving and
configuring Markdown plugins with `if` statements, so each step reads
on its own.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: avivkeller <me@aviv.sh>
Add a `markdown` option to add remark, rehype, and recma plugins to the generators processing Markdown, or configure the ones they use, such as Shiki. The `@doc-kit/core` modules the generators' pipelines replace are removed (`utils/remark.mjs`, `utils/remark-shiki.mjs`, and `utils/highlighter.mjs`), and `utils/type-annotations` moves to `plugins/type-annotations`
0 commit comments