Skip to content

xxxily/docsify-cli-plus

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

310 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

docsify

πŸ–Œ docsify cli - A magical documentation generator.

English | δΈ­ζ–‡

Backers on Open Collective Sponsors on Open Collective npm Github Actions Status Join Discord community and chat about Docsify license npm-total-download npm-monthly-download

Gold Sponsor via Open Collective

Screencast

Screencast

Running a server on localhost with live-reload.

Installation

Install docsify-cli via npm or yarn globally.

npm i docsify-cli -g
# yarn global add docsify-cli

Usage

init command

Use init to generate your docs.

docsify init [path] [--local false] [--rcMode] [--theme vue] [--plugins]

# docsify i [path] [-l false] [--rc] [-t vue] [-p]

[path] defaults to the current directory. Use relative paths like ./docs (or docs).

  • --local option:
    • Shorthand: -l
    • Type: boolean
    • Default: false
    • Description: Copy docsify files to the docs path, defaults to false using cdn.jsdelivr.net as the content delivery network (CDN). To explicitly set this option to false use --no-local.
  • --rcMode option:
    • Shorthand: --rc
    • Type: boolean
    • Default: false
    • Description: Try docsify preview release version (rc resource).
  • --theme option:
    • Shorthand: -t
    • Type: string
    • Default: vue
    • Description: Choose a theme, defaults to vue.
  • --plugins option:
    • Shorthand: -p
    • Type: boolean
    • Default: false
    • Description: Provide a list of plugins to insert as <script> tags to index.html.

serve command

Run a server on localhost with livereload.

docsify serve [path] [--open false] [--port 3000]

# docsify s [path] [-o false] [-p 3000]
  • --open option:
    • Shorthand: -o
    • Type: boolean
    • Default: false
    • Description: Open the docs in the default browser, defaults to false. To explicitly set this option to false use --no-open.
  • --port option:
    • Shorthand: -p
    • Type: number
    • Default: 3000
    • Description: Choose a listen port, defaults to 3000.
  • --host option:
    • Shorthand: -H
    • Type: string
    • Default: localhost
    • Description: Choose a host to bind to, defaults to localhost.

start command

Start a server with zero configuration. This command works like serve, but with automatic fallback:

  • If no index.html exists, a default one will be served (with loadSidebar: true, subMaxLevel: 2, auto2top: true, and search plugin enabled)
  • If no _sidebar.md exists, a virtual sidebar will be auto-generated from your markdown files and updated automatically when files change
docsify start [path] [--open false] [--port 3000]

# docsify st [path] [-o false] [-p 3000]
  • --open option:
    • Shorthand: -o
    • Type: boolean
    • Default: false
    • Description: Open the docs in the default browser, defaults to false. To explicitly set this option to false use --no-open.
  • --host option:
    • Shorthand: -H
    • Type: string
    • Default: localhost
    • Description: Choose a host to bind to, defaults to localhost.
  • --sidebar-sort option:
    • Shorthand: -S
    • Type: string
    • Choices: natural, mtime
    • Default: natural
    • Description: Choose a sorting method for the virtual sidebar, defaults to natural (alphabetical). Use mtime to sort by file modification time (newest first).

start command features

Virtual Sidebar Enhancements:

  • Collapsible Folders: Folders in the virtual sidebar are collapsed by default using HTML <details> and <summary> tags.
  • State Persistence: The expanded/collapsed state of folders is preserved when navigating through different pages.
  • Smart Sorting: Use --sidebar-sort mtime to keep your most recently updated docs at the top of the sidebar. Useful for "What's New" style documentation.
  • Multi-instance Support: Automatically detects and uses the next available port if the default port is busy (supports both main server and livereload server auto-tuning).

Template Loading Priority:

  1. ~/.docsify/index.html - User-defined template
  2. lib/template/start-index.html - Project default template
  3. Built-in fallback template

generate command

Docsify's generators.

docsify generate [path] [--sidebar _sidebar.md] [--overwrite]

# docsify g [path] [-s _sidebar.md] [-o]
  • --sidebar option:

    • Shorthand: -s
    • Type: string
    • Default: _sidebar.md
    • Description: Generate sidebar file, defaults to _sidebar.md.
  • --overwrite option:

    • Shorthand: -o
    • Type: boolean
    • Default: false
    • Description: Allow to overwrite generated files.

menu command

Manage system context menu and running Docsify instances.

docsify menu [subcommand] [arg]

# docsify m [subcommand] [arg]
  • Subcommands:
    • register: Register the system right-click context menu (supports macOS and Windows).
    • unregister: Unregister the system context menu.
    • status: Show the list of running instances and registration status.
    • stop-all: Stop all instances started via docsify start.
    • stop <pid>: Stop a specific instance by its process ID (PID).

Shows help information if no subcommand is provided.

Tip

For macOS Users: After running menu register, go to System Settings β†’ Privacy & Security β†’ Extensions β†’ Finder, and check Docsify Start Server to enable the context menu.

Contributing

Please see the Contributing Guidelines

Contribution

Open in Gitpod

License

MIT

About

πŸ–Œ docsify cli tool - A magical documentation generator.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 84.9%
  • HTML 15.1%