An example Docusaurus 3 documentation site with TinaCMS, OpenAPI, Mermaid charts and Lunr search integration.
The project was created by creating a new Docusaurus v3 site with Palo Alto Networks' OpenAPI plugin and merging Tinasaurus to create a working config.
Note: Lunr search is available only in productoon.
$ npm install && npm run dev
Or
$ yarn && yarn dev
This will install dependencies and open the website in your browser.
Visit the CMS at http://localhost:3000/admin to start editing.
Watch an overview of Tinasaurus on YouTube.
$ npm install
Or
$ yarn
$ npm run dev
Or
$ yarn dev
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. Go to the Tina Admin to start editing.
To generate all OpenAPI docs, run the following command from the root directory of your project:
yarn docusaurus gen-api-docs all
This will generate API docs for all of the OpenAPI specification (OAS) files referenced in your
docusaurus-plugin-openapi-docs
config.
You may also generate OpenAPI docs for a single path or OAS by specifying the unique id
:
yarn docusaurus gen-api-docs <id>
Example:
yarn docusaurus gen-api-docs petstore
The example above will only generate API docs relative to
petstore
.
If you have multiple versions of the same API, gen-api-docs
only generates the latest. To generate all versions, use the --all-versions
flag.
Example:
yarn docusaurus gen-api-docs all --all-versions
This will generate API docs for all versions of all the OpenAPI specification (OAS) files referenced in your
docusaurus-plugin-openapi-docs
config.
To clean/remove all API Docs, run the following command from the root directory of your project:
yarn docusaurus clean-api-docs all
You may also remove a particular set of API docs by specifying the unique id
of your desired spec instance.
yarn docusaurus clean-api-docs <id>
Example:
yarn docusaurus clean-api-docs petstore
The example above will remove all API docs relative to
burgers
.
If you have multiple versions of the same API, clean-api-docs
only cleans the latest. To clean all versions, use the --all-versions
flag.
Example:
yarn docusaurus clean-api-docs all --all-versions
This will clean API docs for all versions of all the OpenAPI specification (OAS) files referenced in your
docusaurus-plugin-openapi-docs
config.
To generate all versioned OpenAPI docs, run the following command from the root directory of your project:
yarn docusaurus gen-api-docs:version <id>:all
Example:
yarn docusaurus gen-api-docs:version petstore:all
This will generate API docs for all of the OpenAPI specification (OAS) files referenced in your
versions
config and will also generate aversions.json
file.
Substitue
all
with a specific version ID to generate/clean a specific version. Generating forall
or a specific version ID will automatically update theversions.json
file.
$ npm run build
Or
$ yarn build
This command generates static content into the build
directory and can be served using any static contents hosting service.
To deploy to production and support editing on your live website (at your-domain.com/admin), you can follow the steps from Tina's docs to get it running on TinaCloud.