Skip to content
Angular · Analog.js · Markdown

Documentation that belongs in your app.

Doqs adds a Markdown-driven documentation region to the Angular and Analog.js application you already have. Server-rendered and statically generated, with your branding, your routes and your Angular components left exactly where they are.

Get Started View on GitHub npm package

Doqs renders only the documentation region. Everything around it is your application.

What Doqs 0.5 does

  • Angular components inside Markdown

    New in 0.3

    Register your own standalone components once, then place them between paragraphs with a one-line ::demo[id] directive. Interactive, server-rendered and hydrated.

  • Native Angular and Analog.js

    Routes come from doqRoutes() and content from Analog’s own content files. Your router and providers stay yours.

  • Rich Markdown pages

    Frontmatter, nested folders and custom slugs, plus built-in callouts, accessible tabs, step guides and titled code, all in plain Markdown.

  • SSR and SSG

    doqPrerenderRoutes() feeds Analog’s prerenderer, so every page ships as static HTML and hydrates cleanly.

  • Sidebar and table of contents

    Grouped navigation, an “On this page” index, previous and next links and a mobile drawer.

  • Pagefind full-text search

    Optional and static: an index built from your prerendered output. No backend, off by default.

  • Host-owned themes and layout

    Restyle with --host-docs-* CSS tokens. Doqs sets no global html or body styles.

  • API reference from source

    doq-api reads your library’s public TypeScript API, with signal inputs, outputs, models and JSDoc, and writes ordinary Markdown pages. A check command fails CI when they are stale.

  • Composition slots

    Add your own standalone components after the docs index intro or after every document.

Getting started

Doqs plugs into an Analog app. Analog keeps its own configuration; Doqs adds its own. The two are separate on purpose.

pnpm add @doqs/analog @analogjs/content @analogjs/router prismjs
Shared pathsAnalog prerenderAngular providersAPI referenceDemo registration
src/doq.paths.ts
// shared by vite.config.ts, so no Angular components here
export const doqPaths = { contentDirectory: 'docs', basePath: '/docs' } as const;

Import @doqs/analog/styles.css once in your global stylesheet. The complete guide lives in the package README.

How it works

  1. Install Doqs

    Add the package next to Analog’s content packages.

  2. Configure the documentation region

    Share the paths, prerender with Analog and register Doqs in your app config.

  3. Write Markdown

    Drop files into src/content/docs. Routes, sidebar and table of contents follow. Add ::demo[id] lines where a live component belongs.

  4. Build and deploy

    vite build prerenders everything to static files you can host anywhere.

Doqs is not MDX: there is no JavaScript in Markdown and no template compilation. A directive only names a component your application registered.

Interactive components in Markdown

Put a line containing only ::demo[id] where a live Angular component belongs. Directives inside code fences, lists and quotes stay literal text, an unknown id shows a short notice instead of breaking the page, and headings, the table of contents and search keep working around every component. The component is yours: you register it, Doqs only places it.

Markdown

What you write in src/content/docs
---
title: Getting started
---

## Installation

Pick a package manager and copy the command:

::demo[install-command]

## Try it

::demo[enter-animation]

The text after a demo is still ordinary, searchable Markdown.

Rendered

A real Angular component, ::demo[enter-animation], animated with Angular Movement
fade-up

Preview shows the fade-up animation.