Feat/gitlab include placeholders#20
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
…e.ts Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Avoids re-substituting placeholder text that appears inside an already-rendered include body (e.g. a code file showing example syntax). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Wires the docusaurus-plugin-gitlab webpack loader into examples/site
alongside remark-gemoji, and asserts an {@includeGitlabReadme: ...}
placeholder flows through Docusaurus's native MDX pipeline (heading
anchors, emoji) rather than the JSX-component path.
This is the first time the loader runs inside a real Docusaurus build,
which surfaced three real bugs fixed along the way:
- src/options.ts: Docusaurus always injects an `id` field into a
plugin's options object before invoking it (even without a
validateOptions hook); the Joi schema rejected it as unknown.
- src/plugin/index.ts: registering our configureWebpack() rule
without an explicit `include` caused Docusaurus core's synthetic
MDX-fallback plugin (which flattens every .mdx? rule's `include`
into its own `exclude`) to inject a literal `undefined` into that
array; webpack-merge then turned it into `null` while wiring that
plugin's result back in, which fails webpack's own config schema
and aborts the build. Scoping `include` to siteDir fixes this at
the root, and `mergeStrategy: { "module.rules": "append" }` avoids
webpack-merge's default index-based rule merging corrupting other
plugins' rules.
- src/gitlab/fetchers.ts: `./markdown` import was missing the
required `.js` extension; harmless under bundler resolution but a
hard ERR_MODULE_NOT_FOUND once the loader is loaded as a real
Node/webpack-resolved module rather than bundled.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Rewrites CommonMark autolinks (<https://…>, <a@b.com>) in included GitLab markdown into MDX-safe links so they don't abort the build, and exposes an outProcessors option for custom markdown transforms. The built-in fix is driven by a serializable flag so it reliably crosses the webpack loader boundary; user functions are passed via an in-process registry keyed by a stable id. Also hardens escapeMdx against stray '</' sequences. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
GitLab markdown uses HTML void elements without the self-closing slash
(<br>, <hr>, <img …>), which MDX rejects ('Expected a closing tag for <br>').
fixVoidTags self-closes them (<br> -> <br/>), code-aware and on by default
(disable with fixVoidTags: false). Driven by the same serializable flag as
fixAutolinks. Exported alongside fixAutolinks.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
…includes A README's own 'Table of Contents' section duplicates the TOC Docusaurus renders in the right sidebar. stripTableOfContents removes the TOC heading + its section (up to the next same/higher-level heading) and any [[_TOC_]] marker, ignoring headings inside code blocks. Opt-in via stripToc (default false) and exported for manual composition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
GitLab markdown's raw HTML uses string style attributes (style="color: red"),
but MDX/React require a style object ('The style prop expects a mapping … not a
string'). fixInlineStyles converts them to JSX style objects
(style={{ color: "red" }}), camelCasing properties (and quoting CSS custom
properties). Code-aware, on by default (disable with fixInlineStyles: false),
exported for manual composition.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
…nitions Translates GitLab/GitHub alert blockquotes (> [!note], > [!warning], …) into native Docusaurus admonitions (:::note … :::), so Docusaurus renders them as themed callouts. Maps important->info and caution->danger, supports an optional title, skips fenced code, and is on by default (disable with convertAlerts: false). Exported for manual composition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
CodeQL (js/polynomial-redos) flagged `/^\n+|\n+$/g` on the admonition body: the `\n+$` alternative backtracks quadratically on input with many newlines (a crafted/large alert blockquote is uncontrolled data). Replace it with a linear character-scan trim of leading/trailing newlines; behavior is identical. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
…check) The plugin-default-export packaging test imported "../dist/index.js" as a string literal, so `tsc --noEmit` tried to resolve it — failing the typecheck CI step, which runs before `dist/` is built. Import via a runtime URL instead; behavior is unchanged and the file exists during `npm run test`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
ebuildy
force-pushed
the
feat/gitlab-include-placeholders
branch
from
July 1, 2026 05:58
f5de7bd to
ebba1bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.