Repository navigation
Docs: imported pages no longer print their import comment; build fails on raw syntax - #222
Merged
Merged
Conversation
…d fails on raw syntax The importer put an MDX comment under each imported self-host page's front matter. Those pages are Markdown, so the comment printed under the title. It now writes source and sourceCommit front matter instead. check:output reads every built page's visible text (and each Markdown twin outside code) and fails on an MDX comment, a component tag printed as text, an escaped brace, an admonition marker or a double-escaped entity.
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.
Summary
Every imported self-host page (for example /self-host/backups/ and /self-host/email/) showed the literal text
{/* Imported from CoderHelm/coderhelm-platform/docs/self-host/... Edit it there. */}under its title. The importer wrote an MDX comment into files it saves as.md, which are rendered as Markdown, so the comment printed as text. This writes the same information as front matter instead, and adds a build check that fails on raw syntax showing on any page.Changes
scripts/import-platform.mjs: imported guides getsource(repo and path) andsourceCommit(the pinned commit) front matter instead of the body comment.editUrlstill points "Edit on GitHub" and "Open in GitHub" at the guide's file in coderhelm-platform.lib/source.ts: the page schema acceptssourceandsourceCommit.scripts/lib/raw-syntax.mjs(new): extracts a built page's visible text (without scripts, styles,pre,codeandkbd) and finds an MDX comment ({/*,*/}), a component tag printed as text (<Callout,<Tabs,<Steps,<Diagramand the rest), an escaped brace, an admonition marker (:::note,[!NOTE]) or a double-escaped entity.scripts/check-output.mjs: runs that check on every exported page, and on every Markdown twin outside code. Component tags in the twins are allowed, since they are kept there on purpose.scripts/raw-syntax.test.mjs(new) and a new importer test that says the body has no comment.Verification
npm run test:unit: 75 tests pass.{/*remains incontent/docs/self-host/or in any built.mdtwin orllms-full.txt.check:outputOK (88 pages) andcheck:linksOK (4163 links, none broken).typecheckOK.mdx-comment: ... Copy Markdown Open {/* Imported from CoderHelm/coderhelm-platf....