Skip to content

linopress-cli/config ​

defineConfig and the types of linopress.config.ts, plus validateConfig and loadConfig.

Interfaces ​

LinearEditionConfig ​

An edition synced to Linear Documents. Without team or project it can be planned, not pushed.

Extends ​

  • EditionSource

Properties ​

PropertyTypeDescription
dir?stringOr: a folder of already-generated Markdown.
layout?LayoutModenested (default) puts docs under the index doc; flat keeps them top-level.
project?string-
target"linear"-
team?string-
title?stringTitle of the index page (and the title prefix in flat layout). Defaults to "API Reference".
typedoc?stringA TypeDoc options file; Linopress runs TypeDoc with typedoc-plugin-markdown.
typedocOptions?Readonly<Record<string, unknown>>TypeDoc options applied over the typedoc file, so one file can serve several editions: { excludeInternal: true } for the public one. Ignored with dir.

LinopressConfig ​

Properties ​

PropertyTypeDescription
editionsReadonly<Record<string, EditionConfig>>-
manifest?stringLinear sync state. Defaults to .linopress-manifest.json.
repository?stringRepository that doc footers link to, at the synced commit: a web URL (https://github.com/acme/billing, github.com/acme/billing), an SSH remote, or GitHub shorthand (acme/billing). Defaults to the git origin remote. Without either, or when the commit isn't on a remote branch, footers name the files without links.

LoadedConfig ​

Properties ​

PropertyTypeDescription
configLinopressConfig-
dirstringDirectory of the config file; relative paths in the config resolve against it.

MarkdownEditionConfig ​

An edition written as Markdown files, for VitePress or any other static site generator.

Extends ​

  • EditionSource

Properties ​

PropertyTypeDescription
dir?stringOr: a folder of already-generated Markdown.
outstringFolder to write to. Linopress only deletes files it wrote there (listed in its .linopress.json), so it can share the folder with a site's config and hand-written pages.
target"markdown"-
title?stringTitle of the index page (and the title prefix in flat layout). Defaults to "API Reference".
typedoc?stringA TypeDoc options file; Linopress runs TypeDoc with typedoc-plugin-markdown.
typedocOptions?Readonly<Record<string, unknown>>TypeDoc options applied over the typedoc file, so one file can serve several editions: { excludeInternal: true } for the public one. Ignored with dir.

Type Aliases ​

EditionConfig ​

ts
type EditionConfig = 
  | LinearEditionConfig
  | MarkdownEditionConfig;

One edition of the docs, e.g. internal (with @internal, to Linear) or public (to files).

Variables ​

CONFIG_FILES ​

ts
const CONFIG_FILES: readonly string[];

Functions ​

defineConfig() ​

ts
function defineConfig(config): LinopressConfig;

Identity helper that gives linopress.config.ts type checking.

Parameters ​

ParameterType
configLinopressConfig

Returns ​

LinopressConfig


loadConfig() ​

ts
function loadConfig(cwd, file?): Promise<LoadedConfig | null>;

Loads linopress.config.* from cwd (or file). TypeScript configs are imported with Node's built-in type stripping (Node ≥ 22.18), so they must use erasable syntax only. Returns null when there is no config file.

Parameters ​

ParameterType
cwdstring
file?string

Returns ​

Promise<LoadedConfig | null>


validateConfig() ​

ts
function validateConfig(raw, dir?): LinopressConfig;

Checks a config's shape and returns it typed. Throws one error listing every problem, with the path to each (editions.public.out), so typos and leftovers don't silently do nothing. dir is the config file's folder, which relative out folders resolve against.

Parameters ​

ParameterType
rawunknown
dir?string

Returns ​

LinopressConfig

MIT licensed. Not made by or affiliated with Linear.