cosmos-sdk/docs
sleepy ramen 39c5c079cd
fix: misc fixes for cosmos-rosetta (#13583)
### Description

Closes:
https://github.com/cosmos/cosmos-sdk/issues/13083
https://github.com/cosmos/cosmos-sdk/issues/11402
https://github.com/cosmos/cosmos-sdk/issues/10678
https://github.com/cosmos/cosmos-sdk/issues/12358
https://github.com/cosmos/cosmos-sdk/issues/10776
https://github.com/cosmos/cosmos-sdk/issues/12934

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [x] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [x] provided a link to the relevant issue or specification
- [x] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [x] added a changelog entry to `CHANGELOG.md`
- [x] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [x] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
2022-11-04 11:48:45 +00:00
..
architecture docs: update ADR 057 app wiring (#13736) 2022-11-02 21:19:53 +01:00
docs fix: misc fixes for cosmos-rosetta (#13583) 2022-11-04 11:48:45 +00:00
spec docs: fix tooling (#13593) 2022-10-19 12:38:36 +00:00
src/css build(deps): Bump @docusaurus/core from 2.1.0 to 2.2.0 in /docs (#13708) 2022-10-31 18:04:37 +01:00
static docs: small ui fixes (#13546) 2022-10-13 19:58:25 +00:00
.gitignore feat: migrate to docusaurus (#13471) 2022-10-10 14:01:53 +00:00
babel.config.js feat: migrate to docusaurus (#13471) 2022-10-10 14:01:53 +00:00
DOC_WRITING_GUIDELINES.md docs: add documentation on documentation deployment (#13739) 2022-11-03 17:23:52 +01:00
docusaurus.config.js docs: fix algolia (#13729) 2022-11-02 13:30:03 +01:00
modules_category.json feat: migrate to docusaurus (#13471) 2022-10-10 14:01:53 +00:00
package-lock.json build(deps): Bump @docusaurus/core from 2.1.0 to 2.2.0 in /docs (#13708) 2022-10-31 18:04:37 +01:00
package.json build(deps): Bump @docusaurus/core from 2.1.0 to 2.2.0 in /docs (#13708) 2022-10-31 18:04:37 +01:00
post.sh docs: fix tooling (#13593) 2022-10-19 12:38:36 +00:00
pre.sh refactor: clean-up SDK tools (#13603) 2022-10-21 15:15:20 +00:00
README.md docs: add documentation on documentation deployment (#13739) 2022-11-03 17:23:52 +01:00
sidebars.js feat: migrate to docusaurus (#13471) 2022-10-10 14:01:53 +00:00
tailwind.config.js docs: small ui fixes (#13546) 2022-10-13 19:58:25 +00:00
vuepress_versions feat: migrate to docusaurus (#13471) 2022-10-10 14:01:53 +00:00

Updating the docs

If you want to open a PR in Cosmos SDK to update the documentation, please follow the guidelines in CONTRIBUTING.md and the Documentation Writing Guidelines.

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

  • Vuepress (pre v0.47)

  • Algolia DocSearch

        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. 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:

cd docs
npm install

For starting only the current documentation, run:

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:

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

  • 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.

        {
          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

Learn more about versioning in Docusaurus.