Skip to content

Configuration ​

Editions ​

An edition is one view of your API for one audience, published to one target. Editions can share a typedoc.json; typedocOptions is applied over it, so they differ only where they say so.

  • { excludeInternal: true } drops @internal symbols, which is what most public editions want.
  • For an audience of your own, tag symbols with a category (@category Team only) and leave it out with { excludeCategories: ["Team only"] }. TypeDoc's excludeTags only removes a tag's text from comments; it doesn't hide the symbol.
  • { treatWarningsAsErrors: true } makes TypeDoc warnings, such as a {@link} to something that doesn't exist, fail plan and push. Set it so CI catches broken doc comments.

The config is checked when it's loaded: an unknown option, a team on a Markdown edition or a missing out is an error rather than silently ignored.

OptionEditionsMeaning
typedocallTypeDoc options file to run
typedocOptionsallTypeDoc options applied over that file
dirallOr: a folder of Markdown that's already generated
titleallTitle of the index page (default "API Reference")
targetalllinear or markdown
team/projectlinearLinear team or project id to hold the docs
layoutlinearnested (default, under the index doc) or flat (title prefixes)
outmarkdownFolder to write the files to

Two top-level options sit next to editions: manifest, the sync state file (default .linopress-manifest.json), and repository, the repository that source links point to (defaults to the git origin remote).

Targets ​

Linear ​

Linear Documents in a team or a project.

  • Links between pages point at the Linear documents.
  • Images and linked files, such as ![Flow](../media/flow.png), are uploaded once, and again only when they change.
  • Every document gets a footer linking its source files at the pushed commit. Links appear when the commit is on a remote branch, so push from CI or from a pushed commit.
  • TypeDoc's <a id> anchors are removed and in-page # links are unlinked, since Linear would show the anchors as text.

Markdown ​

Files in out, for VitePress or another static site generator.

  • Pages keep TypeDoc's anchors, get their title as an H1 and start with a "generated, edit the source" comment. Images are copied to <out>/_media/.
  • push records the files it wrote in <out>/.linopress.json and only ever changes or deletes those, so out can also hold your site's config and hand-written pages. If a page would overwrite a file it didn't write, push stops and names it; --force replaces it.

Commands ​

linopress plan  [edition | --all] [options]   Show what publishing would change (never writes)
linopress push  [edition | --all] [options]   Publish to the edition's target (--dry-run to only plan)
linopress print [edition | --all] [options]   Print the Markdown each page would get
OptionMeaning
--typedoc <file>TypeDoc options file to run
--dir <dir>Folder of already-generated Markdown
--team <id>, --project <id>Linear team or project to hold the docs
--out <dir>Write Markdown files to this folder instead of Linear
--forcepush: replace files in the output folder that Linopress didn't write
--flatTop-level docs with title prefixes instead of nesting under the index
--title <title>Index page title, or the prefix with --flat (default "API Reference")
--manifest <file>Sync state file (default .linopress-manifest.json)
--config <file>Config file (default linopress.config.{ts,mts,js,mjs})
--allRun for every edition in the config
--dry-runpush: plan only, change nothing
--verboseplan: also list unchanged docs and files

Flags override the edition's config. Without a config file, pass a source and a target directly: linopress push --typedoc typedoc.json --team <teamId>.

MIT licensed. Not made by or affiliated with Linear.