Repository navigation
feat(tutorials): showcase the tutorial components and document how to write tutorials - #212
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
🏭 Tracked by CCF Factory — view |
af65e48 to
e9d7317
Compare
9f420c3 to
89e51d5
Compare
There was a problem hiding this comment.
ccf-review: COMMENT
1 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
docs/tutorials/components.mdx:14languageadvertisesshhighlighting, butshrenders unhighlighted: The site highlights code with the Prism bundled in prism-react-renderer (verified in node_modules at the PR head: the bundled language set has yaml, yml, json, js, javascript, ... but neithershnorbash), and docusaurus.config.ts sets nothemeConfig.prism.additionalLanguages. A<CopyBlock language="sh">therefore renders as plain text - the PR #210 body itself lists addingbashas an open question and notes the site's 34 existingshfences render plain today. The page (and CopyBlock.tsx's docstring) presentshto authors as a working highlighting choice; the usage fences'mdxtag has no grammar either. Authors will writelanguage="sh"expecting colour and get none, and the showcase misrepresents its own component. Fix: Either addthemeConfig.prism.additionalLanguages: ['bash', 'mdx'](the open question from #210 - it changes every code block site-wide, so its own call) or say on the page which languages actually highlight today (yaml, json, js, ... ) and thatshrenders plain until shell grammars are added. (d307effaa65d)
Stack summary (whole stack, top PR's review)
Epic #204, infrastructure only (tutorial content is later work). #209 (merged) added the Tutorials navbar tab, tutorialsSidebar and docs/tutorials/index.md. #210 adds the copy-pastable code blocks: <CopyBlock> (on @theme/CodeBlock, title row, always-visible copy, snippetText dedent) and <CodeGroup> (per-file tabs, shared keyboard helper codeGroupTabs.mjs), registered site-wide through a new @theme-original/MDXComponents wrapper - the supported route, since markdown.mdxPageImports does not exist in Docusaurus 3.9.2. #211 builds the rest of the Mintlify-style set on top - Tabs/Tab, Card/CardGroup (internal href via Docusaurus Link, otherwise new tab + rel="noopener noreferrer"), Steps/Step, Callout + the five admonition shortcuts, Accordion/AccordionGroup (native details) - with the titledChildren and cardLink helpers under node --test. #212 (this PR) makes the set reviewable and reusable: the showcase page docs/tutorials/components.mdx (every component live, with its usage snippet), the sidebar entry, and the authoring guidance in STYLE.md (new Tutorials page skeleton) and CONTRIBUTING.md (Writing tutorials). Merge order: #210 → #211 → #212; each is based on the one below, so review each at its head and merge bottom-up once all are approved and green. #210 currently has Must-fix findings (fabricated CLI commands/config shape in test fixtures); the STYLE.md contract with ccf-skills is with a human.
Checks
- build: the PR's
buildcheck is SUCCESS on the head reviewed; at the stack headyarn install,yarn test(62 pass),yarn typecheck,yarn spellcheck(0 issues) andyarn buildalso pass locally, and tests/typecheck/spellcheck pass at this PR's head too. - i18n:
i18n.localesis['en']only and noi18n/tree exists, so the only locale is the one built; nothing half-translated; DOCS-TRANS-001 not applicable. - versioning:
instances.yamlis untouched by the stack (and validates during the build); no*_versions.jsonor*_versioned_docsfile changes, so no released line is touched and no minor line is duplicated. - style: docs-style checklist run against STYLE.md on the changed pages.
- source verification (DOCS-ACC-001): every setting, CLI command/flag, config field and path the diff adds was checked against the source repo it documents (instances.yaml) with
gh api ...?ref=<branch>; no docs page or memory was trusted.
|
No need to include a ccf-skills PR. |
1 similar comment
|
No need to include a ccf-skills PR. |
There was a problem hiding this comment.
ccf-review: APPROVE
1 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
docs/tutorials/components.mdx:14The page offersshas a highlighting language, but the site cannot highlight it: The page tells authorslanguagepicks the highlighting (sh,yaml,json, ...). Checked against this repo's own config and bundle, not another page:docusaurus.config.ts'sthemeConfig.prismsets onlytheme/darkTheme, with noadditionalLanguages, and the bundledprism-react-rendererregisters neithershnorbash(Prism.languageshas yaml, yml, json, js, javascript, tsx, ... but no shell), so ashsnippet falls back to plain text. Confirmed in the built page at this head:build/tutorials/components.htmlrenders the CopyBlock asclass="prism-code language-sh"with every token atoken plain, and the page's ownmdx usage fences are plain too. `STYLE.md:22` asks for the `sh` tag, so the page is repeating the repo's own convention rather than inventing one, and every existingsh block on the site (for exampleapi/cli-reference.md) is already unhighlighted: the gap is the site's Prism set, not this page. It is a Should-fix and a follow-up, not a must-fix here: neithershnorbashis in prism-react-renderer's bundle, so fixing it means adding Prism language modules indocusaurus.config.ts, a change unrelated to this PR's intent. Fix: Either fix the site's Prism set in a follow-up (add the shell languages tothemeConfig.prism.additionalLanguages, importing the Prism definitions since prism-react-renderer does not bundle bash), or narrow the sentence on this page to the languages that highlight today and say plainly that command blocks are shown unstyled until the site gains a shell grammar. (b4ae4d9f1eb5)
Checks and verification (round 2)
Nothing moved since round 1 (head still e9d7317). Re-run at the stack head in the review workspace: yarn build SUCCESS (the only warning pre-existing, vscode-languageserver-types via redoc), yarn test 62 pass / 0 fail, yarn typecheck and yarn spellcheck clean; the PR's build check is SUCCESS at this head too.
- versioning:
instances.yaml, every*_versioned_docs/and*_versions.jsonis untouched by all three PRs;prebuild'sgen-sidebars.mjsrevalidated the manifest at this head (26 instances, 25 generated, 1 curated), so released lines stay as released and no instance was added by hand. - i18n:
i18n.localesis['en']and there is noi18n/directory, so DOCS-TRANS-001 is not engaged; nothing is half-translated and no theme string needswrite-translations. - style: the docs-style checklist over the three changed pages (
docs/tutorials/components.mdx, the newSTYLE.mdsection, the newCONTRIBUTING.mdsection): sentence-case headings, US spelling (cspell clean), commands/paths/values incode, every fenced block tagged, no filler or future promises, "Continuous Compliance Framework (CCF)" on first mention, links as relative.mdpaths (./index.md), no link tocurrentfrom a released line. - accuracy: every factual claim on the new page was checked against the source it describes, not against another page. Both
Cardroutes exist in the build (build/tutorials.html,build/introduction.html,trailingSlash: false);onBrokenLinks: 'throw'andonBrokenMarkdownLinks: 'throw'are what the page says they are; a wrong sidebar id does fail the build; the copy button the page promises is in the client bundle (build/assets/js/6556.*.jscarries "Copy code to clipboard"), so the always-visible-copy-button CSS does reach a real element. The one claim the site does not support is theshlanguage above. - CLI, config and field-list claims elsewhere in the stack were checked against
compliance-framework/apiat its default branch withgh api …?ref=main(cmd/root.go,pkg/agentconfig/types.go) — see #210.
Stack summary (this work item)
Epic docs#204 asked for a Tutorials tab plus rich, Mintlify-style MDX; tutorial content is later work, so this stack is infrastructure only, one PR per sub-issue, merged bottom-up:
- #209 (merged,
815b1e0) — the tab:docs/tutorials/index.md,tutorialsSidebar, the navbardocSidebaritem. - #210 (
.../1,31d2176) — the copy-pastable primitivesCopyBlockandCodeGroup, their plain-ESM helpers (snippetText,codeGroupTabs) undernode --test, the two CSS rules, and the MDX scope swizzle. REQUEST_CHANGES: three Must-fix threads from round 1 are still open (below). - #211 (
.../2,89e51d5) —Tabs/Tab,Card/CardGroup,Steps/Step,Callout+ the five named callouts,Accordion/AccordionGroup, withtitledChildrenandcardLinktested. APPROVE, two non-blocking items. - #212 (
.../3,e9d7317, this PR) — the showcase page, theSTYLE.mdTutorials page skeleton and theCONTRIBUTING.md"Writing tutorials" section, which is what makes the components reusable and reviewable. APPROVE, one non-blocking item.
Runtime: all additive — new MDX scope entries, one page, two src/ folders, CSS, sidebar id, docs text. Nothing else in the org consumes it.
Notes
- The
docs-instancescontract toccf-skills(round 1 held this as a Question; round 2 closes it as a note).ccfr featureflagsSTYLE.mdas a contract whose consumer isccf-skillswith no consumer PR. Read against the consumer's own text rather than assumed: the docs-style skill saysSTYLE.mdis the source of truth and "when the two disagree,STYLE.mdin the checkout wins, and the checklist needs an update in this repo", and its step 2 already falls back to "general page" for a type it does not know. The new Tutorials page skeleton therefore breaks nothing in the skill, so no companion PR is required for this stack to merge; refreshing that checklist (and the skill's list of page types) is a worthwhile follow-up inccf-skills. (compliance-framework/ccf-skillsis not readable with this task's credentials, so this rests on the shipped skill text, quoted above — a maintainer who wants the checklist updated in the same train should say so.) - The three Must-fix findings live on #210, the bottom of the stack; they gate the merge of all three.
e9d7317 to
e797e74
Compare
89e51d5 to
3830c83
Compare
There was a problem hiding this comment.
ccf-review: APPROVE
1 Should-fix.
Stack (base-chain): #210 → #211 → #212
Non-blocking
- [Should-fix]
docs/tutorials/components.mdx:14The page advertises sh highlighting the site cannot do: The page tells authors language picks the highlighting (sh, yaml, json, ...). Checked against this repo's own config and bundle, not another page: docusaurus.config.ts themeConfig.prism sets only theme/darkTheme with no additionalLanguages, and the bundled prism-react-renderer (2.4.1) registers neither sh nor bash - Prism.languages at this head has yaml, json, js, ts, markup, ... but no shell language - so a sh snippet falls back to plain text. Re-confirmed at this head in the review workspace. STYLE.md asks for the sh tag, so the page repeats the repo's own convention rather than inventing one, and the gap is the site's Prism set, not this page: fixing it means adding Prism language modules in docusaurus.config.ts, a change unrelated to this PR's intent. Reported in the previous round too; nothing changed here. Fix: Either fix the site's Prism set in a follow-up (add the shell language to themeConfig.prism.additionalLanguages, importing the Prism definitions since prism-react-renderer does not bundle bash), or narrow the sentence here to the languages that highlight today and say plainly that command blocks are shown unstyled until the site gains a shell grammar. (815b5c17dcd6)
Re-review at e797e74
Nothing moved in this PR: ccfr last-review reports no new commits and no changed files since the last review (the head's sha moved only because the stack was rebased onto the fixture fix in #210).
Checks and verification
build: the PR'sbuildcheck is SUCCESS at this head; locallyyarn test(62 pass / 0 fail),yarn typecheckandyarn spellcheckare clean, andyarn buildat this head succeeds with only the pre-existingvscode-languageserver-typeswarning.versioning:instances.yaml, every*_versioned_docs/and*_versions.jsonis untouched by all three PRs. The new page is a general unversioned doc underdocs/tutorials/, andsidebars.jsonly gains thetutorials/componentsid — no instance added by hand (DOCS-INST-001 clear), released lines untouched (DOCS-VER-001/002 not engaged).i18n:i18n.localesis['en']alone and there is noi18n/directory, so nothing is half-translated and no theme string needswrite-translations(DOCS-TRANS-001 not engaged).style: the docs-style checklist over the three changed pages (docs/tutorials/components.mdx, the new STYLE.md Tutorials page skeleton, the newCONTRIBUTING.md"Writing tutorials" section): reader named at the top ("This page is for docs authors"), sentence-case headings, US spelling (cspell clean), commands/paths/values incode, every fenced block tagged, no filler or future promises, "Continuous Compliance Framework (CCF)" on first mention, links as relative.mdpaths —./index.mdresolves,onBrokenLinks/onBrokenMarkdownLinksarethrow(docusaurus.config.ts:124, :233) and the build passes — and no link from a released line tocurrent.accuracy: every factual claim on the new page was re-checked against the source it describes, not against another page:yarn build/yarn serveare real scripts;Card's routes exist in the build (build/tutorials.html,build/introduction.html,trailingSlash: false); a wrong sidebar id does fail the build (doc ids are paths underdocs/minus extension, as the page says);tutorialsSidebaris hand-curated whilegen-sidebars.mjswrites the instance sidebars, as theCONTRIBUTING.mdtext says; the navbar label really is Tutorials (docusaurus.config.ts:180). The one claim the site does not support is theshlanguage above.
Stack summary (this work item)
Epic docs#204 asked for a Tutorials tab plus rich, Mintlify-style MDX; tutorial content is explicitly later work, so this stack is infrastructure only — one PR per sub-issue, merged bottom-up:
- #209 (merged,
815b1e0) — the tab:docs/tutorials/index.md,tutorialsSidebar, the navbardocSidebaritem. Not open, not re-reviewed. - #210 (
.../1,9d1ce79) —CopyBlockandCodeGroupwith the tested plain-ESM helperssnippetText/codeGroupTabs. APPROVE: the three Must-fix DOCS-ACC-001 fixture findings were fixed at9d1ce79and re-verified againstcompliance-framework/apiat its default branch (see that review); one a11y Nit reported there. - #211 (
.../2,3830c83) —Tabs/Tab,Card/CardGroup,Steps/Step,Calloutwith the five named callouts,Accordion/AccordionGroup, withtitledChildren/cardLinktested. APPROVE, two non-blocking items there. - #212 (
.../3,e797e74, this PR) — the showcase page, the STYLE.md Tutorials page skeleton and theCONTRIBUTING.md"Writing tutorials" section, which make the components reviewable and reusable. APPROVE, one non-blocking item (the site'sshPrism gap).
Runtime: all additive — new MDX scope entries, one page, two src/ folders, CSS, a sidebar id and docs text. Nothing else in the org consumes it.
Notes
- The
ccf-skillscompanion question is answered, not held. The earlier round asked whether the new STYLE.md Tutorials page skeleton needs a companionccf-skillsdocs-style PR now (the docs-instances contract,gap: true). @gusfcarvalho answered on this PR ("No need to include a ccf-skills PR", 2026-11-28), which settles it: the docs-style skill treatsSTYLE.mdas the source of truth ("when the two disagree,STYLE.mdin the checkout wins"), so nothing breaks without a companion PR, and refreshing that checklist stays an optional follow-up inccf-skills. Nothing in this stack is held for a human.
… write tutorials Adds docs/tutorials/components.mdx, the one showcase page that renders every code block and MDX component from the two preceding pull requests, each with a usage snippet; registers it in tutorialsSidebar; adds the Tutorials page skeleton to STYLE.md; and tells authors where tutorials live in CONTRIBUTING.md.
Name the product in full on first use of the showcase page, and make the Card and Combine-them usage snippets byte-match the live demo they show.
The yarn test claim holds for the plain helpers, not every component file.
Render the five callout shorthands and the long-form Callout live, and make the Callout usage fence byte-match its live demo.
e797e74 to
d248b29
Compare
3830c83 to
2782f55
Compare
There was a problem hiding this comment.
ccf-review: REQUEST_CHANGES
1 Must-fix.
Stack (base-chain): #211 → #212
Stack summary (top PR)
Open stack of the Tutorials epic (docs#204), bottom to top; #209 (Tutorials tab) and #210
(CopyBlock/CodeGroup) merged to main before this round.
- #211 (MDX component set: Tabs/Tab, Card/CardGroup, Steps/Step,
Callout + Note/Tip/Info/Warning/Danger, Accordion/AccordionGroup, tested helpers
titledChildren.mjs/cardLink.mjs, CSS, MDX-scope registration): approve. No blocking
finding; two Should-fixes are listed in that PR's review body (tab-row duplication with
CodeGroup, CORE-DUP-001; Steps numbering hidden from assistive tech). Helpers passnode --test; components follow the repo's established pattern of testing the plain-ESM decisions,
not the JSX. - #212 (this PR: components showcase, STYLE.md Tutorials page
skeleton, CONTRIBUTING.md authoring section, sidebar entry): request changes - one
Must-fix inline thread (DOCS-ACC-001, theshhighlighting claim).
Checks. build: GitHub's build check (CI runs yarn install && yarn test && yarn build)
passes at both heads, and a local production build passes at this stack head; #211's Spellcheck
check also passes (it does not trigger on this PR, whose base is #211's branch - yarn spellcheck was run locally here instead: 153 files, 0 issues; yarn test 62 pass, yarn typecheck clean). i18n: the only locale is en (docusaurus.config.ts), no i18n/ tree exists,
nothing is half-translated; DOCS-TRANS-001 not applicable. versioning: instances.yaml and every
released line (*_versioned_docs/, *_versions.json) are untouched by both PRs, and the
manifest still validates in the build. style: the docs-style checklist was run against
components.mdx, the STYLE.md addition and the CONTRIBUTING.md section; the remaining unmet item
is the accuracy claim in the thread below. Accuracy of every claim the diffs add was checked against the
source repo at the documented version (docusaurus.config.ts, package.json and the pinned
Prism/Infima bundles at main), not another docs page: the routes /tutorials and
/introduction, the tutorialsSidebar doc ids, the yarn build/serve/test commands, the
admonition kinds, the Infima variables used by #211, and onBrokenMarkdownLinks: 'throw' (which
makes this page's broken-links Warning true) all hold. Not verified: tab/accordion hydration in
a live browser (no interactive browser in this environment).
A Question about this PR is held for a human (never posted by the reviewer): whether the new
STYLE.md Tutorials page skeleton needs a companion ccf-skills docs-style checklist PR before
this PR merges, or later.
|
|
||
| ## CopyBlock | ||
|
|
||
| One snippet the reader copies in one click: a command, a config file or file contents, with a title row and a copy button that stays visible. Pass the snippet as the `code` prop, or as text children (a template literal that spans several lines); shared leading indentation is dropped, so it copies exactly what the reader sees. `language` picks the highlighting (`sh`, `yaml`, `json`, ...) and `title` labels the block. |
There was a problem hiding this comment.
[Must-fix] DOCS-ACC-001 · Claim doesn't match the documented version
Line 14 tells authors that CopyBlock's language prop "picks the highlighting (sh, yaml, json, ...)" and the live demos and usage snippets use language="sh" throughout (lines 16-24, 33, 55-60, 131-138, 149-156). The source does not support sh: the site's highlighter is the Prism bundle pinned by yarn.lock (prism-react-renderer, 53 languages - no sh, bash or shell; yaml, json and js are present) and docusaurus.config.ts sets no themeConfig.prism.additionalLanguages (checked at main: only theme/darkTheme, lines 218-220). This round's production build of this very page confirms it: every language="sh" block SSRs with only token plain spans (no syntax colours) while language="js" tokenises correctly. The page's own demos render unhighlighted under the copy-paste guidance it gives. (The merged CopyBlock.tsx/CodeGroup.tsx comments carry the same 'such as sh, yaml or json' wording on main; fix them in the same follow-up.)
Why: Readers configure and operate CCF from these pages. A wrong default, flag, endpoint or permission sends an operator to a setting that does not exist or behaves differently at their version.
Fix: Either say what actually highlights - list languages from the shipped Prism set (yaml, json, js, ...) and drop sh from the examples - or make the claim true first: set themeConfig.prism.additionalLanguages: ['bash'] in docusaurus.config.ts (prismjs registers sh/shell as bash aliases, so sh then highlights site-wide, including the existing ```sh fences on the api/agent pages), keep the demos, and correct the same wording in CopyBlock.tsx and CodeGroup.tsx on main.
ccf-review · 08fe3964f3fb · rules@unknown
No description provided.