Skip to content

Package exports

The generated API reference contains signatures and type definitions for the public entry points. Each documentation line shows the API from its selected published snapshot.

Use @pinanek/docskit for configuration and types. Import React components from their dedicated entry points so configuration can load without a React server environment.

TypeScript
import { defineDocs } from "@pinanek/docskit";
import type { DocsConfig, MDXComponents, MetadataValues } from "@pinanek/docskit";

Entry points

ImportExportsUse
@pinanek/docskitdefineDocs, configuration types, content types, metadata types, navigation and URL helpersConfig files and type imports
@pinanek/docskit/configSame as the root importExplicit configuration entry point
@pinanek/docskit/linkLinkClient navigation in custom components
@pinanek/docskit/metadataMetadata, MetadataValuesPage title, canonical URL, and social metadata
@pinanek/docskit/mdxcomponentsBuilt-in Markdown component map
@pinanek/docskit/layoutRootElement, SiteLayout, DocsLayoutShared layouts for advanced integrations
@pinanek/docskit/contentcreateDocuments, DocumentModule, DocumentRecord, DocumentCollectionContent collection and Markdown link resolution
@pinanek/docskit/documentsDocument, getStaticPathsConfigured documentation rendering
@pinanek/docskit/styles.cssShared stylesheetAdvanced integrations that supply their own application shell
@pinanek/docskit/clientAmbient Markdown module declarationsMarkdown imports in TypeScript

The CLI loads the shared stylesheet and Markdown declarations automatically. Custom homepages normally need only link and metadata. The configured metadata, mdx, layout, and documents modules run inside a Docskit site; they use its configuration, styles, or generated content.

Without the CLI, load Markdown declarations from a declaration file such as env.d.ts:

env.d.tsTypeScript
import "@pinanek/docskit/client";

This entry point contains types only; do not import it from runtime JavaScript.

The root exports DocsConfig, ResolvedDocsConfig, NavLink, FooterLink, Group, Item, ThemeAsset, OgImageConfig, VersioningConfig, MDXComponents, MetadataValues, DocumentModule, DocumentRecord, DocumentCollection, and TocItem as types. Use import type for these exports.

URL and navigation helpers

  • normalizeBasePath(path) normalizes a deployment path, such as /project/.
  • withBasePath(path, basePath) prefixes a local URL and preserves external URLs.
  • pagePath(path) adds a trailing slash to page URLs while preserving assets, queries, and fragments.
  • flattenNavigation(items) returns links from navigation groups.

The shared link and metadata components already handle deployment paths. Use the helpers when constructing URLs outside those components.

Internal modules

Paths under @pinanek/docskit/internal/* support the generated application. They include framework configuration, runtime layouts and routes, OG generation, and virtual-module declarations. They may change with the implementation; use the public entry points in project code.

Keep custom components in your project and reference them through docskit.config.ts. See Components and styles for examples.