Feat/gitlab include directive#25
Merged
Merged
Conversation
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>
Add plugin option to specify allowed remote hosts for ::include directives. Defaults to empty array (all remote includes rejected). 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>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Expand nested ::include directives found inside included markdown files, guarded by a max depth cap and a per-branch cycle-detection stack so a diamond-shaped include graph still resolves while a self-referential one fails fast. 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>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
…ipping - Remote ::include fetches now use redirect: "manual" and reject 3xx responses explicitly, closing an allowlist-bypass path where an allowlisted host could redirect the build-time request elsewhere. - Frontmatter stripping and recursive expansion now only apply to markdown targets, so non-markdown includes (e.g. .yml) keep a legitimate leading "---" block intact and are spliced in verbatim without being scanned for ::include directives. Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Extract ::include expansion into an expandIncludes() factory that returns
an OutProcessor-shaped fn, and run it in transform.ts as a pre-render
source-processor stage (reusing applyOutProcessors) symmetric to the
post-render out-processor chain. Also render non-markdown include targets
(e.g. .yaml) as fenced, syntax-highlighted code blocks instead of raw
prose, matching {@includeGitlabFile}.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
Add a `debug` plugin option (default false) that emits build-time traces
via @docusaurus/logger: each resolved {@includeGitlab…} placeholder
(project/ref/path, byte size) in transform.ts and each ::include directive
(target, depth, markdown-vs-fenced) in expand.ts. The logger lives in a
small isolated module that lazily imports @docusaurus/logger (an optional
peer dependency) only when enabled, with a defensive default-unwrap for the
CJS/ESM interop; a no-op logger is used otherwise.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
- Expand ::include directives inside fenced/inline code regions, inserting the target verbatim (GitLab 'includes in code blocks') instead of skipping them; prose directives keep markdown-inline/recurse and non-markdown code-fence behavior. - Extend ::include support to the <GitlabReadme>/<GitlabFile> components: fetchReadme/fetchFile now expand directives on the raw markdown before renderMarkdown, with strict/allowedHosts/debug threaded into GitLabContext.options via buildContext. - Clean up the ad-hoc full-document debug probe; keep the structured traces. - Update spec, README, and tests accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Thomas Decaux <ebuildy@gmail.com>
69f98f3 to
b948ded
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.