Some checks failed
Build SimApp / build (amd64) (push) Waiting to run
Build SimApp / build (arm64) (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
Build & Push / build (push) Waiting to run
Run Gosec / Gosec (push) Waiting to run
Lint / golangci-lint (push) Waiting to run
Checks dependencies and mocks generation / Check go mod tidy (push) Waiting to run
Checks dependencies and mocks generation / Check up to date mocks (push) Waiting to run
System Tests / setup (push) Waiting to run
System Tests / test-system (push) Blocked by required conditions
System Tests / test-system-legacy (push) Blocked by required conditions
Tests / Code Coverage / split-test-files (push) Waiting to run
Tests / Code Coverage / tests (00) (push) Blocked by required conditions
Tests / Code Coverage / tests (01) (push) Blocked by required conditions
Tests / Code Coverage / tests (02) (push) Blocked by required conditions
Tests / Code Coverage / tests (03) (push) Blocked by required conditions
Tests / Code Coverage / test-integration (push) Waiting to run
Tests / Code Coverage / test-e2e (push) Waiting to run
Tests / Code Coverage / repo-analysis (push) Blocked by required conditions
Tests / Code Coverage / test-sim-nondeterminism (push) Waiting to run
Tests / Code Coverage / test-clientv2 (push) Waiting to run
Tests / Code Coverage / test-core (push) Waiting to run
Tests / Code Coverage / test-depinject (push) Waiting to run
Tests / Code Coverage / test-errors (push) Waiting to run
Tests / Code Coverage / test-math (push) Waiting to run
Tests / Code Coverage / test-schema (push) Waiting to run
Tests / Code Coverage / test-collections (push) Waiting to run
Tests / Code Coverage / test-cosmovisor (push) Waiting to run
Tests / Code Coverage / test-confix (push) Waiting to run
Tests / Code Coverage / test-store (push) Waiting to run
Tests / Code Coverage / test-log (push) Waiting to run
Tests / Code Coverage / test-x-tx (push) Waiting to run
Tests / Code Coverage / test-x-nft (push) Waiting to run
Tests / Code Coverage / test-x-circuit (push) Waiting to run
Tests / Code Coverage / test-x-feegrant (push) Waiting to run
Tests / Code Coverage / test-x-evidence (push) Waiting to run
Tests / Code Coverage / test-x-upgrade (push) Waiting to run
Tests / Code Coverage / test-tools-benchmark (push) Waiting to run
Build & Push SDK Proto Builder / build (push) Has been cancelled
82 lines
3.4 KiB
Markdown
82 lines
3.4 KiB
Markdown
# Updating the docs
|
|
|
|
If you want to open a PR in Cosmos SDK to update the documentation, please follow the guidelines in [`CONTRIBUTING.md`](https://github.com/cosmos/cosmos-sdk/tree/main/CONTRIBUTING.md#updating-documentation) and the [Documentation Writing Guidelines](./DOC_WRITING_GUIDELINES.md).
|
|
|
|
## Stack
|
|
|
|
The documentation for Cosmos SDK is hosted at https://docs.cosmos.network and built from the files in the `/docs` directory.
|
|
It is built using the following stack:
|
|
|
|
* [Docusaurus 2](https://docusaurus.io)
|
|
* Vuepress (pre v0.47)
|
|
* [Algolia DocSearch](https://docsearch.algolia.com/)
|
|
|
|
```js
|
|
algolia: {
|
|
appId: "QLS2QSP47E",
|
|
apiKey: "067b84458bfa80c295e1d4f12c461911",
|
|
indexName: "cosmos_network",
|
|
contextualSearch: false,
|
|
},
|
|
```
|
|
|
|
* GitHub Pages
|
|
|
|
## Docs Build Workflow
|
|
|
|
The docs are built and deployed automatically on GitHub Pages by a [GitHub Action workflow](../.github/workflows/deploy-docs.yml).
|
|
The workflow is triggered on every push to the `main` and `release/v**` branches, every time documentations or specs are modified.
|
|
|
|
### How It Works
|
|
|
|
There is a GitHub Action listening for changes in the `/docs` directory for the `main` branch and each supported version branch (e.g. `release/v0.46.x`). Any updates to files in the `/docs` directory will automatically trigger a website deployment. Under the hood, the private website repository has a `make build-docs` target consumed by a Github Action within that repository.
|
|
|
|
## How to Build the Docs Locally
|
|
|
|
Go to the `docs` directory and run the following commands:
|
|
|
|
```shell
|
|
cd docs
|
|
npm install
|
|
```
|
|
|
|
For starting only the current documentation, run:
|
|
|
|
```shell
|
|
npm start
|
|
```
|
|
|
|
It runs `pre.sh` scripts to get all the docs that are not already in the `docs/docs` folder.
|
|
It also runs `post.sh` scripts to clean up the docs and remove unnecessary files when quitting.
|
|
|
|
Note, the command above only build the docs for the current versions.
|
|
With the drawback that none of the redirections works. So, you'll need to go to /main to see the docs.
|
|
|
|
To build all the docs (including versioned documentation), run:
|
|
|
|
```shell
|
|
make build-docs
|
|
```
|
|
|
|
## What to for new major SDK versions
|
|
|
|
When a new major version of the SDK is released, the following steps should be taken:
|
|
|
|
* On the `release/vX.Y.Z` branch, remove the deploy action (`.github/workflows/deploy-docs.yml`), for avoiding deploying the docs from the release branches.
|
|
* On the `release/vX.Y.Z` branch, update `docusaurus.config.js` and set the `lastVersion` to `current`, remove all other versions from the config.
|
|
* Each time a new version is released (on docusaurus), drop support from the oldest versions.
|
|
* If the old version is still running vuepress (v0.45, v0.46), remove its line from `vuepress_versions`
|
|
* If any, remove the outdated redirections from `docusaurus.config.js` and add the base version redirection (`/vX.XX`) to `/main`.
|
|
|
|
```js
|
|
{
|
|
from: ["/", "/master", "/v0.43", "/v0.44", "/v0.XX"], // here add the deprecated version
|
|
to: "/main",
|
|
},
|
|
```
|
|
|
|
* Add the new version sidebar to the list of versionned sidebar and add the version to `versions.json`.
|
|
* Update the latest version (`presets[1].docs.lastVersion`) in `docusaurus.config.js`.
|
|
* Add the new version with in `presets[1].docs.versions` in `docusaurus.config.js`.
|
|
|
|
Learn more about [versioning](https://docusaurus.io/docs/versioning) in Docusaurus.
|