feat(docs): add in-app documentation system#166
Open
emlimlf wants to merge 10 commits into
Open
Conversation
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an in-app documentation system under /docs, backed by Markdown files in docs/user/, server-side rendering endpoints, and a client-side search experience.
Changes:
- Introduces new docs data types plus Nitro API routes to list sections and render Markdown articles as sanitized HTML.
- Adds a docs build pipeline that generates a MiniSearch-compatible search index and wires it into the frontend build/dev flow.
- Implements
/docspages and UI components (landing, article view, sidebar navigation, search) plus supporting styles and navigation links.
Reviewed changes
Copilot reviewed 29 out of 36 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/shared/types/documentation.types.ts | Adds shared types for docs sections, articles, and search data/results. |
| frontend/server/api/docs/index.get.ts | Adds docs navigation endpoint (sections + children) derived from Markdown frontmatter. |
| frontend/server/api/docs/[...slug].get.ts | Adds article-rendering endpoint (Markdown → HTML with sanitization and link rewriting). |
| frontend/scripts/build-docs.mjs | Adds docs index generator writing search-index JSON into public/. |
| frontend/pnpm-lock.yaml | Locks new deps for Markdown parsing, sanitization support types, and search. |
| frontend/package.json | Adds docs build script and wires docs index generation into build/dev. |
| frontend/app/pages/docs/index.vue | Adds /docs landing page with SEO metadata. |
| frontend/app/pages/docs/[...slug].vue | Adds catch-all docs article page that delegates rendering to module component. |
| frontend/app/config/routes.ts | Adds AppRoute.Docs. |
| frontend/app/config/menu/header.ts | Adds “Documentation” link to the header menu. |
| frontend/app/composables/documentation/useDocumentationNav.ts | Adds composable for fetching/caching docs nav structure. |
| frontend/app/composables/documentation/useDocumentation.ts | Adds composable for fetching/caching an individual doc article. |
| frontend/app/components/modules/documentation/view/docs-landing.vue | Implements landing UI with section cards and search. |
| frontend/app/components/modules/documentation/view/docs-article.vue | Implements article UI with sidebar, breadcrumbs, and SEO metadata. |
| frontend/app/components/modules/documentation/components/docs-sidebar.vue | Implements nested sidebar navigation with active state handling. |
| frontend/app/components/modules/documentation/components/docs-search.vue | Implements lazy-loaded MiniSearch index search UI. |
| frontend/app/assets/styles/utils/index.scss | Registers new docs-specific utility stylesheet. |
| frontend/app/assets/styles/utils/_docs.scss | Adds markdown/table/callout styling for docs article body. |
| frontend/.gitignore | Ignores generated docs search index file. |
| docs/user/reimbursements/index.md | Adds reimbursements documentation page content. |
| docs/user/payment-account/index.md | Adds payment account documentation page content. |
| docs/user/initiatives/manage-initiative/index.md | Adds initiative management documentation page content. |
| docs/user/initiatives/index.md | Adds initiatives overview documentation page content. |
| docs/user/initiatives/create-initiative/index.md | Adds initiative creation documentation page content. |
| docs/user/initiatives/browsing-initiatives/index.md | Adds browsing initiatives documentation page content. |
| docs/user/getting-started/index.md | Adds getting-started documentation page content. |
| docs/user/donations/manage-donations/index.md | Adds donations management documentation page content. |
| docs/user/donations/make-donation/index.md | Adds donation walkthrough documentation page content. |
| docs/user/donations/index.md | Adds donations overview documentation page content. |
| docs/user/backers/index.md | Adds backers documentation page content. |
Files not reviewed (1)
- frontend/pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
…back on PR #166 Signed-off-by: Efren Lim <elim@linuxfoundation.org>
…ack on PR #166 Address review comments from copilot-pull-request-reviewer: - frontend/server/utils/doc-utils.ts: swap getDocsDir() preference order to check docs/user (fromRoot) before ../docs/user (fromFrontend); the previous order would choose an out-of-repo path when a ../docs/user happened to exist on the host while running from the repo root (per copilot-pull-request-reviewer) - frontend/server/utils/doc-utils.ts: add escapeAttr() helper that escapes &, ", ', <, > for safe HTML attribute interpolation (per copilot-pull-request-reviewer) - frontend/server/api/docs/[...slug].get.ts: apply escapeAttr() to href and title values in buildRenderer() before interpolating into the anchor HTML string, providing defense-in-depth ahead of DOMPurify sanitization (per copilot-pull-request-reviewer) Resolves 2 review threads. Thread on pnpm-lock.yaml is a false positive (explained in thread reply — the >=4.2.0 specifier comes from the intentional js-yaml override in pnpm-workspace.yaml, not a sync issue). Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Contributor
Author
Review Feedback AddressedCommit: 1737979 Changes Made
No Change Needed
Threads Resolved3 of 3 unresolved threads addressed in this iteration. |
4 tasks
nunoeufrasio
added a commit
that referenced
this pull request
Jun 16, 2026
Address review comments from @mlehotskylf: - config/menu/footer.ts: point Documentation to the in-app /docs route instead of the deprecated docs.linuxfoundation.org CF docs - config/menu/header.ts: point More-menu Documentation to /docs and drop the now-unused external flag - layout/components/desktop-nav.vue, mobile-menu.vue: revert external new-tab handling (no longer needed for an in-app link) The in-app docs system is introduced in #166 (AppRoute.Docs = '/docs'). Resolves 2 review threads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Nuno Eufrasio <nmeufrasio@gmail.com>
Comment on lines
+12
to
+17
| import { readdirSync, readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs'; | ||
| import { resolve, join } from 'node:path'; | ||
| import { load as parseYaml } from 'js-yaml'; | ||
|
|
||
| const DOCS_DIR = resolve(import.meta.dirname, '../../docs/user'); | ||
| const OUT_FILE = resolve(import.meta.dirname, '../public/assets/docs/search-index.json'); |
…back on PR #166 Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Contributor
Author
Review Feedback AddressedCommit: b574673 Changes Made
No Change Needed
Threads Resolved3 of 3 unresolved threads addressed in this iteration. |
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
/docssection per LFXV2-2197scripts/build-docs.mjs) producing a MiniSearch-compatible search index; auto-runs beforepnpm devandpnpm build/docspages:useSeoMetawith OG/Twitter cards and canonical URLsChanges
docs/user/— 11 Markdown articles across 7 top-level sections with YAML frontmatterfrontend/server/api/docs/—index.get.ts(sections + children) and[...slug].get.ts(article renderer with relative link rewriting)frontend/shared/types/documentation.types.ts—DocSection,DocArticle,DocSearchDocument,DocSearchResulttypesfrontend/app/pages/docs/— landing and catch-all article pagesfrontend/app/components/modules/documentation/—docs-landing,docs-article,docs-sidebar,docs-searchcomponentsfrontend/app/composables/documentation/—useDocumentation,useDocumentationNavcomposablesfrontend/scripts/build-docs.mjs— docs build pipelinefrontend/public/images/docs/— 6 screenshot imagespackage.json— addeddocs:buildscript, wired intodevandbuild; addedminisearchdependencyTest plan
/docslanding page renders topic card grid with search bar/docs/initiativesshows nested sidebar with sub-pages (Browsing, Create, Manage)/docs/initiatives/browsing-initiativesshows breadcrumb: Docs > Initiatives > Browsing Initiatives/docs/donations/make-donationrenders images and LF ID calloutYYYY-MM-DD(not ISO timestamp)pnpm docs:buildruns standalone without errors🤖 Generated with Claude Code