• English
  • doc

    The rs doc command uses Rspress to develop, build, and preview a documentation site.

    Install @rspress/core before using the command:

    npm
    yarn
    pnpm
    bun
    deno
    npm install -D @rspress/core

    Usage

    rs doc [command] [root] [options]

    The command loads the documentation configuration registered with define.doc(). When no subcommand is provided, it starts the Rspress development server. The optional root argument overrides the configured documentation root directory.

    Options

    rs doc supports the same options as the corresponding Rspress commands. See the Rspress CLI documentation for details.

    Examples:

    # Start the development server
    rs doc
    
    # Use a custom documentation root directory
    rs doc ./documentation
    
    # Start the development server on port 8080
    rs doc --port 8080

    Subcommands

    build

    rs doc build builds the documentation site for production.

    rs doc build

    preview

    rs doc preview previews the output generated by rs doc build locally.

    rs doc build
    rs doc preview

    eject

    rs doc eject copies a built-in Rspress theme component into the project for customization. Run it without a component name to list all ejectable components.

    rs doc eject

    Configuration

    Configure the documentation site through define.doc() in the Rstack configuration file. It accepts the standard Rspress configuration:

    rstack.config.ts
    import { define } from 'rstack';
    
    define.doc({
      root: 'docs',
      title: 'My Site',
    });