Skip to content

LLM Resources

@dovenv/docs - API documentation โ€‹

Functions โ€‹

defineConfig() โ€‹

ts
function defineConfig(...config: (DocsConfig | DocsConfig[])[]): DocsConfig

Defines a configuration object for the dovenv documentation plugin.

Parameters โ€‹

ParameterTypeDescription
...config(DocsConfig | DocsConfig[])[]The configuration object.

Returns โ€‹

DocsConfig

The defined configuration object.


docs() โ€‹

ts
function docs(args?: Omit<DocsParams, "utils">, utils?: {
  pkg: Record<string, unknown>;
  wsDir: string;
}): Promise<DocsCore>

Creates DOCUMENTATION instance.

Parameters โ€‹

ParameterTypeDescription
args?Omit<DocsParams, "utils">Optional arguments excluding 'utils'.
utils?objectOptional utilities parameters.
utils.pkg?Record<string, unknown>Optional package.json content as an object.
utils.wsDir?stringThe workspace directory path. Default process.cwd()

Returns โ€‹

Promise<DocsCore>

A promise that resolves to an instance of DocsCore.


docsPlugin() โ€‹

ts
function docsPlugin(config?: Config): Config

Define a dovenv configuration that creates a documentation site for your workspace.

Parameters โ€‹

ParameterTypeDescription
config?ConfigThe configuration object.

Returns โ€‹

Config

The dovenv configuration object.


getPkgConfig() โ€‹

ts
function getPkgConfig(pkgData: {
  devEngines: {
     cpu: undefined | {
        name: string;
        onFail: "warn" | "error" | "ignore";
        version: string;
       };
     libc: undefined | {
        name: string;
        onFail: "warn" | "error" | "ignore";
        version: string;
       };
     os: undefined | {
        name: string;
        onFail: "warn" | "error" | "ignore";
        version: string;
       };
     packageManager: undefined | {
        name: string;
        onFail: "warn" | "error" | "ignore";
        version: string;
       };
     runtime: undefined | {
        name: string;
        onFail: "warn" | "error" | "ignore";
        version: string;
       };
    };
}): Promise<DocsConfig>

Extracts and constructs documentation configuration from package JSON data.

Parameters โ€‹

ParameterTypeDescription
pkgDataobjectThe package JSON data object.
pkgData.devEngines?objectThe devEngines field aids engineers working on a codebase to all be using the same tooling. See https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines
pkgData.devEngines.cpuundefined | { name: string; onFail: "warn" | "error" | "ignore"; version: string; }-
pkgData.devEngines.libcundefined | { name: string; onFail: "warn" | "error" | "ignore"; version: string; }-
pkgData.devEngines.osundefined | { name: string; onFail: "warn" | "error" | "ignore"; version: string; }-
pkgData.devEngines.packageManagerundefined | { name: string; onFail: "warn" | "error" | "ignore"; version: string; }-
pkgData.devEngines.runtimeundefined | { name: string; onFail: "warn" | "error" | "ignore"; version: string; }-

Returns โ€‹

Promise<DocsConfig>

A promise that resolves to a DocsConfig object containing extracted configuration details like funding URL, bugs URL, license, homepage URL, description, name, version, and contributors.

Type Aliases โ€‹

Config โ€‹

ts
type Config: DocsConfig | (utils: CommandUtils) => Response<DocsConfig>;

DocsConfig โ€‹

ts
type DocsConfig: {
  autoSidebar: {
     about: boolean;
     contribute: boolean;
     intro: boolean;
     reference: boolean;
    };
  bugsURL: string | false;
  changelogURL: string | false;
  contributingURL: string | false;
  contributors: {
     actionText: string;
     avatar: string;
     desc: string;
     links: SocialLinks;
     name: string;
     org: string;
     orgLink: string;
     sponsor: string;
     title: string;
    }[];
  css: string;
  desc: string;
  docsPath: string;
  download: {
     groups: {};
     items: {};
    };
  experimental: {
     noTempDirOnBuild: boolean;
    };
  favicon: string;
  footer: {
     copy: {
        name: string;
        url: string;
       };
     links: {
        email: string;
        instagram: string;
        medium: string;
        twitter: string;
        web: string;
       };
    };
  fundingURL: string | false;
  groupIcon: Parameters<typeof groupIconVitePlugin>[0] | false;
  input: string;
  lang: string;
  license: {
     type: string;
     url: string;
    };
  links: Links;
  llms: LlmsConfig | false;
  logo: string;
  meta: Meta;
  moreURL: string | false;
  name: string;
  nav: Nav;
  navLinks: SocialLinks;
  npmURL: string | false;
  og: {
     description: string;
     image: string;
     siteName: string;
     title: string;
     twitterAccount: string;
     url: string;
    };
  oldVersions: {
     name: string;
     url: string;
    }[];
  output: string;
  pwa: Partial<PwaOptions> | false;
  repoURL: string | false;
  rss: RSSOptions;
  server: {
     hotReloadFiles: string[];
     restartFiles: string[];
    };
  shortDesc: string;
  sidebar: Sidebar;
  styles: {
     color: {
        dark: Colors;
        fourth: string;
        light: Colors;
        primary: string;
        secondary: string;
        terciary: string;
       };
     radius: string;
    };
  titleTemplate: (data: {
     name: string;
     title: string;
    }) => string;
  twoslash: Parameters<typeof transformerTwoslash>[0] | false;
  url: string;
  version: string;
  vitepress: UserConfig;
};

Type declaration โ€‹

NameTypeDescription
autoSidebar?{ about: boolean; contribute: boolean; intro: boolean; reference: boolean; }Active or desactivated sidebar autogenerated
autoSidebar.about?booleanDisplay the "About" section in the sidebar. Default true
autoSidebar.contribute?booleanDisplay the "Contribute" section in the sidebar. Default true
autoSidebar.intro?booleanDisplay the "Get started" section in the sidebar. Default true
autoSidebar.reference?booleanDisplay the "Reference" section in the sidebar. Default true
bugsURL?string | falseURL for the project's issue tracker or bug reports.
changelogURL?string | falseCHANGELOG url of the project.
contributingURL?string | falseContributing url of the project.
contributors?{ actionText: string; avatar: string; desc: string; links: SocialLinks; name: string; org: string; orgLink: string; sponsor: string; title: string; }[]Contributors information including their details and social links.
css?stringCustom CSS for the documentation site.
desc?string-
docsPath?stringPath to the documentation files. Used for editLink in pages. Default 'docs'
download?{ groups: {}; items: {}; }Data related to downloads and version releases.
download.groups?{}Optional grouping of download items by category. Each key in the object represents a group name and maps to a string label. Example { * "extension": "extension", * "app": "app", * }
download.items?{}Optional list of downloadable items, where each key represents an item identifier. Each item includes details such as name, URL, and optionally a logo and type.
experimental?{ noTempDirOnBuild: boolean; }Settings for experimental options. Use at your own risk.
experimental.noTempDirOnBuild?booleanDisable temp directory during compilation. The temp directory is used to store documentation files in the output directory during the compilation process. Used to allow input paths with '../'. Default false
favicon?stringFavicon URL for the documentation site. Default '/favicon.png'
footer?{ copy: { name: string; url: string; }; links: { email: string; instagram: string; medium: string; twitter: string; web: string; }; }Footer configuration with links and copyright information.
footer.copy?{ name: string; url: string; }Copyright information for the project.
footer.copy.name?stringName to display in copyright notices.
footer.copy.url?stringURL for the copyright holder or organization.
footer.links?{ email: string; instagram: string; medium: string; twitter: string; web: string; }Links to various social platforms or contact methods.
footer.links.email?stringEmail link for contacting the project or organization.
footer.links.instagram?stringInstagram link for the project or organization.
footer.links.medium?stringMedium link for articles or blogs related to the project.
footer.links.twitter?stringTwitter link for the project or organization.
footer.links.web?stringWebsite link for the project or organization.
fundingURL?string | falseURL for funding or sponsorship of the project.
groupIcon?Parameters<typeof groupIconVitePlugin>[0] | falseGroup icon options
input?stringInput directory for documentation files. Default './docs'
lang?stringLanguage code for the documentation, e.g., 'en' for English. Default 'en'
license?{ type: string; url: string; }License information for the project.
license.type?stringType of license (e.g., MIT, GPL). Default 'MIT'
license.url?stringURL to the full license text.
links?LinksAdditional links to display in a special page.
llms?LlmsConfig | falseConfiguration for LLMs text files. See https://llmstxt.org/
logo?stringLogo URL for the documentation site. Default '/logo.png'
meta?Meta-
moreURL?string | falseAdditional URL for more resources or links related to the project.
name?stringName of the project or documentation. Default 'DOVENV'
nav?NavNavigation configuration for links at the top of the documentation.
navLinks?SocialLinksAdditional navigation links. Icons IDs: https://simpleicons.org/.
npmURL?string | falseNPM package URL for the project.
og?{ description: string; image: string; siteName: string; title: string; twitterAccount: string; url: string; }Open Graph meta tags for better link previews on social media. Deprecated
og.description?stringDescription for the Open Graph metadata.
og.image?stringImage URL for the Open Graph metadata.
og.siteName?stringSite name for Open Graph metadata.
og.title?stringTitle for the Open Graph metadata.
og.twitterAccount?stringTwitter account associated with the site.
og.url?stringURL for the site, used in Open Graph metadata.
oldVersions?{ name: string; url: string; }[]Array of previous versions of the project, each with a name and a URL.
output?stringOutput directory for the built documentation. Default './build'
pwa?Partial<PwaOptions> | falseConfiguration options for PWA (Progressive Web App) support.
repoURL?string | falseRepository URL for the project.
rss?RSSOptionsConfiguration options for RSS feed.
server?{ hotReloadFiles: string[]; restartFiles: string[]; }Server-related configurations, including file watching settings.
server.hotReloadFiles?string[]Files that trigger a hot reload on changes.
server.restartFiles?string[]Files that trigger a server restart on changes.
shortDesc?stringA shorter version of the description for better display.
sidebar?SidebarSidebar configuration for navigation within the documentation.
styles?{ color: { dark: Colors; fourth: string; light: Colors; primary: string; secondary: string; terciary: string; }; radius: string; }Custom styles for the documentation site.
styles.color?{ dark: Colors; fourth: string; light: Colors; primary: string; secondary: string; terciary: string; }Color scheme for the documentation site.
styles.color.dark?ColorsDark mode colors for the theme.
styles.color.fourth?stringFourth color for the theme.
styles.color.light?ColorsLight mode colors for the theme.
styles.color.primary?stringPrimary color for the theme.
styles.color.secondary?stringSecondary color for the theme.
styles.color.terciary?stringTertiary color for the theme.
styles.radius?stringBorder radius for elements in the theme.
titleTemplate?(data: { name: string; title: string; }) => stringtitleTemplate for the documentation site.
twoslash?Parameters<typeof transformerTwoslash>[0] | falseTwoslash options
url?stringURL of the project or documentation site.
version?string-
vitepress?UserConfigVitePress user configuration for additional options.

DocsParams โ€‹

ts
type DocsParams: {
  config: Config;
  opts: {
     configPath: string;
     debug: boolean;
     packageJsonPath: string;
     port: number;
    };
  utils: CommandUtils;
};

Type declaration โ€‹

NameType
config?Config
opts?{ configPath: string; debug: boolean; packageJsonPath: string; port: number; }
opts.configPath?string
opts.debug?boolean
opts.packageJsonPath?string
opts.port?number
utilsCommandUtils

References โ€‹

default โ€‹

Renames and re-exports docsPlugin

Variables โ€‹

autoPWAConfig โ€‹

ts
const autoPWAConfig: PwaOptions["pwaAssets"];

Configuration for auto PWA assets generation.

Requires: @vite-pwa/assets-generator.

Example โ€‹

ts
const docsConfig = {
 pwa: {
   pwaAssets: autoPWAConfig
 }
}