logo
On this page

Development

Preview changes locally to update your docs

Prerequisite
Please install Node.js (version 19 or higher) before proceeding.

Follow these steps to install and run Docuo on your operating system:

Step 1: Install Docuo

npm
yarn
npm i -g @spreading/docuo
1
Copied!
yarn global add @spreading/docuo
1
Copied!

Step 2: Navigate to the docs directory (where the docuo.config.json file is located) and execute the following command:

Untitled
docuo dev
1
Copied!

Custom Ports

By default, Docuo uses port 3000. You can customize the port Docuo runs on by using the --port flag. To run Docuo on port 3333, for instance, use this command:

Untitled
docuo dev --port 3333
1
Copied!

Clear local build cache

When you run docuo dev for the first time, the build template will be cloned and cached locally. As a result, next time you run docuo dev will be faster, but the build template is probably out of date. So if your local website doesn't align with the production version, please run this command before you run docuo dev.

Untitled
docuo clear
1
Copied!

Managing docs versions

Run docuo version to creating or deleting a specified version in the corresponding document instance. Read more .

example
docuo version --create 0.1.0
1
Copied!

Options

NameDescription
--createCreate a new version.
--deleteDelete specified version, enter the confirmation button as prompted.
--instanceSpecifies the document instance of the version to operate on, or uses the default document instance if not specified.

Managing docs instances

Run docuo instance to creating or deleting the specified document instance. Read more .

example
docuo instance --create android
1
Copied!

Options

NameDescription
--createA combination of lowercase letters, digits, and underscores is supported.
Create a new document instance, you need to be prompted for the values of each option.
label: The default is instance id
routeBasePath: The default is instance id
--deleteDelete specified document instance, enter the confirmation button as prompted.

OpenAPI

Read more on OpenAPI configuration .

Generate

Run docuo gen-openapi-docs to generate the corresponding mdx documentation according to the specified OpenAPI documentation.

This command needs to be used in conjunction with the openapi parameter in docuo.config.json.

The command will list all the configs of openapi option, identified by the id. Select the corresponding id. Then docuo document will be generated internally according to the corresponding id configuration.

img alt

all is the internal default, indicating that all documents are generated based on all configurations.

Here is an example:

docuo.config.json
{
  "openapi": {
    "petstore": {
      "specPath": "docs/Using OpenAPI/OpenAPI Demo/petstore.yaml",
      "outputDir": "docs/Using OpenAPI/OpenAPI Demo"
    }
  }
}
1
Copied!

Clear

Run docuo clean-openapi-docs to clears the specified OpenAPI mdx documentation.

This command needs to be used in conjunction with the openapi parameter in docuo.config.json.

The command will list all the configs of openapi option, identified by the id. Select the specified id to clear.

img alt

all is the internal default, indicating clear all.

Deployment

Automatically

Install our GitHub App and turn on the "Auto update" switch on the Setting page. Changes will be deployed to production automatically after pushing to the default branch.

Manually

Click the "Tigger update" button on the Home page to update your project.