1
0
Code
This is a members-only repo. How to join →
Build beautiful, accessible, high-performance documentation websites with Qwik
Find a file
nobody 17add507f0
feat(components): faithful port of Starlight's FileTree via client-side enhancement
Replace the simplified FileTree placeholder with the same enhance-on-mount
pattern Tabs uses: the slotted Markdown list server-renders as-is and
file-tree-enhance.ts (a DOM port of Starlight's rehype-file-tree pass)
rebuilds it into collapsible <details> directories with per-file-type Seti
icons, trailing comments, **highlight** entries, and .../… placeholders.
Without JS the list stays a plain indented tree.

Ships as a raw-source ./file-tree-enhance export (excluded from attw like
tabs-enhance) and is covered by the verify-fixture smoke test. The container
class renames sl-file-tree-simple -> starlight-file-tree; the directory
screen-reader label is a prop (default "Directory") in place of Starlight's
locale system.
2026-08-07 09:19:51 -07:00
bin feat(components): faithful port of Starlight's FileTree via client-side enhancement 2026-08-07 09:19:51 -07:00
docs docs: add project README and writing style guide 2026-06-05 05:36:47 -07:00
examples feat: faithful port of Starlight's Steps via MDX rehype pass 2026-08-06 07:34:03 -07:00
packages feat(components): faithful port of Starlight's FileTree via client-side enhancement 2026-08-07 09:19:51 -07:00
scripts feat: colored icon variant, file-tree icon docs, marketing script 2026-06-24 07:59:59 -07:00
upstream@2898bb7a81 feat: initial scaffold with 21 Mitosis components ported from Starlight 2026-05-25 15:42:27 -07:00
.envrc chore: publish @qwik-docs packages to Forgejo registry 2026-06-24 07:58:09 -07:00
.gitignore chore: publish @qwik-docs packages to Forgejo registry 2026-06-24 07:58:09 -07:00
.gitmodules feat: initial scaffold with 21 Mitosis components ported from Starlight 2026-05-25 15:42:27 -07:00
.npmrc fix: ship framework subpaths that components reference at consumer build 2026-06-25 07:29:15 -07:00
.yarnrc.yml feat: initial scaffold with 21 Mitosis components ported from Starlight 2026-05-25 15:42:27 -07:00
CLAUDE.md feat: basePathname support, .d.ts packaging, and pre-publish verification (0.0.8) 2026-07-03 19:52:31 -07:00
package.json chore: migrate workspace from yarn/npm to pnpm 2026-07-03 16:31:42 -07:00
pnpm-lock.yaml feat(components): port Aside, Badge, Card, Code, FileTree, links, Steps, and Tabs 2026-08-05 19:46:38 -07:00
pnpm-workspace.yaml chore: migrate workspace from yarn/npm to pnpm 2026-07-03 16:31:42 -07:00
README.md docs: document copyPage feature and site config in README 2026-07-03 16:57:03 -07:00

Starlight, Universalized

Starlight builds great docs sites, but it only works with Astro. This project breaks that coupling.

All of Starlight's UI components are rebuilt with Mitosis so they compile natively to Qwik, React, Solid, Vue, Angular, and others. The "point a folder of Markdown at a framework and get a docs site" workflow is preserved, with one addition: you can mount multiple content directories at different URL prefixes.

content: merge(
  withPrefix('sdk', collection({ directory: 'content/sdk' })),
  withPrefix('api', collection({ directory: 'content/api' })),
)

Helpful when you have several products sharing one site.

Examples

Getting Started

Qwik-docs plugs into an existing Qwik City app. If you don't have one yet, scaffold one — pick the empty starter:

npm create qwik@latest empty my-docs && cd my-docs && npm install

The @qwik-docs packages live on the Comrades registry, so point npm at it from your project's .npmrc:

@qwik-docs:registry=https://peoplesgrocers.com/code/api/packages/comrades/npm/

Then install:

npm install @qwik-docs/framework@0.0.1 @qwik-docs/components@0.0.1

Register the Vite plugin:

// vite.config.ts
import { qwikDocs } from '@qwik-docs/framework';
// ...add to plugins, after qwikCity() and qwikVite():
qwikDocs({ configPath: './qwik-docs.config.ts' })

Create qwik-docs.config.ts at the project root — this is the one config file the plugin reads:

import { defineConfig, collection, withPrefix, merge } from '@qwik-docs/framework';

export default defineConfig({
  title: 'My Docs',
  // Public URL of the deployed site. Optional, but required for the
  // "Chat in Claude.ai" action below (used to build the absolute .md link).
  site: 'https://docs.example.com',
  // Turns on the "Copy page" split button beside each page title. It copies
  // the page's raw Markdown to the clipboard, offers "Open Markdown" (the
  // page's .md source, served by the plugin), and — when `site` is set —
  // a "Chat in Claude.ai" action seeded with that page. Off by default;
  // override per page with `features: { copy-page: false }` in frontmatter.
  features: {
    copyPage: true,
  },
  content: merge(
    withPrefix('docs/guides',    collection({ directory: 'content/guides' })),
    withPrefix('docs/reference', collection({ directory: 'content/reference' })),
  ),
  social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/you/repo' }],
  sidebar: [
    { label: 'Guides',    items: [{ label: 'Example', link: '/docs/guides/example/' }] },
    { label: 'Reference', autogenerate: { directory: 'docs/reference' } },
  ],
});

Add two routes — a landing page at src/routes/index.tsx and a catch-all at src/routes/docs/[...slug]/index.tsx. Both wrap content in DocsProvider + Page from @qwik-docs/framework/components. The catch-all uses loadPage, getSidebar, and generateToc from @qwik-docs/framework and renders MDX via entries[slug].load(). Copy examples/basics/src/routes for working versions.

Declare the plugin's virtual modules in src/virtual.d.ts:

declare module 'virtual:qwik-docs/content' {
  import type { ContentEntryMap } from '@qwik-docs/framework';
  export const entries: ContentEntryMap;
  export const slugs: string[];
}
declare module 'virtual:qwik-docs/config' {
  import type { QwikDocsConfig } from '@qwik-docs/framework';
  const config: Omit<QwikDocsConfig, 'content'>;
  export default config;
}

Drop .mdx files into the directories named in content: (each needs a title and description frontmatter), then npm run dev. For a fuller starting point, copy examples/basics.

License

AGPL-3.0 -- or $10/year for a permissive license. Based on Starlight by the Astro team.