Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Add versioning to docs #129

Closed
ethanfrey opened this issue Jan 5, 2021 · 6 comments · Fixed by #132
Closed

Add versioning to docs #129

ethanfrey opened this issue Jan 5, 2021 · 6 comments · Fixed by #132
Assignees

Comments

@ethanfrey
Copy link
Member

The current docs work well for 0.11 version of wasmd/cosmwasm (last stable launchpad version... running on heldernet). Actually, some of the commands are only for 0.10, like coralnet.

However, they are not working for the current master (0.13, soon 0.14) running on stargate that introduced a lot of changes to wasmd. The only solution I see to support both current testnets is to add some doc versioning, a drop-down where people can select to view the older launchpad version, or the current master (and we can maintain a few older checkpoints for heavily used older versions).

Unfortunately, this is not currently supported by vuepress :( vuejs/vuepress#1018

However, there is a plugin that does attempt to handle this, by copying the docs to a folder (we can put all current docs in 0.11/launchpad for example, then open a new one for 0.14/stargate): https://titanium-docs-devkit.netlify.app/guide/versioning.html

This is an example of a repo doing a similar strategy "by hand": https://github.com/nuwave/lighthouse/tree/master/docs

It would be great to set this up before resolving the numerous issues to update the docs to stargate. As many people are still using the launchpad version (as this has much more mature tooling for the sdk and client)

@orkunkl
Copy link
Contributor

orkunkl commented Jan 5, 2021

Absence of multi version support is quite disappointing with vuepress. This problem occurred to me before and I searched for vuepress versioning and could not find such thing back then. I was thinking to offer migration to another docs platform in the future when wasmd is branching. @ethanfrey thanks for finding this repo. No need for migration now 💯

@orkunkl
Copy link
Contributor

orkunkl commented Jan 5, 2021

Checked titanium versioning plugin, this is from their website:
Your theme must be able to properly handle versioned page links. See the Titanium theme for a modified version of the VuePress default theme that is compatible with the versioning plugin.

I looked at https://github.com/cosmos/vuepress-theme-cosmos and it does not support versioning. Maybe we can the maintainers to support versioning? Should not be a lot of work for them and beneficial to cosmos-sdk docs. @ethanfrey ideas?

@ethanfrey
Copy link
Member Author

Sounds good. I will pass this along

@nassdonald
Copy link

@lovincyrus Can you provide some guidance on how you achieved versioning on the Cosmos SDK docs with our docs package? 🙏

@orkunkl
Copy link
Contributor

orkunkl commented Jan 6, 2021

Oh I cosmos-sdk had versioning support for some time awesome. @lovincyrus great if you could detail how to use it in https://github.com/cosmos/vuepress-theme-cosmos/blob/develop/readme.md

@lovincyrus
Copy link
Contributor

@lovincyrus great if you could detail how to use it in https://github.com/cosmos/vuepress-theme-cosmos/blob/develop/readme.md

Versioning and version switcher has been implemented on cosmos sdk docs and tendermint docs. — "vuepress-theme-cosmos": "^1.0.179"

It is however broken atm because the issue couldn't be tested or reproduced locally. The latest version of vuepress-theme-cosmos was immediately merged with the master without any testing on docs-staging (https://docs.staging-cosmos.network). ☹️

The current versioning method was built to specifically handle the use cases of the official docs, such as http://docs.cosmos.network/master, https://docs.cosmos.network/v0.39/intro/overview.html. Ref: https://github.com/cosmos/vuepress-theme-cosmos/blob/develop/global-components/TmSelectVersion.vue#L25 The official docs are what we maintain, docs with path prefixes, and deployed using S3.

Current approach: Makefile and versions file to generate version prefixes to the docs url: (/master, /v0.39) and deployed on S3.

To implement versioning for Cosmwasm, there are some prerequisites:

  1. Versioned docs (/0.11, /0.13, /0.14) must be cloned before the build using pre.sh
  2. Once the versioned docs are available in the .vuepress/dist, Netlify deployment should be able to access the versioned docs given the right configs with config.js.

Steps to implement versioning w/ Makefile + S3 Deployment

  1. add versions to .vuepress/config.js
versions: [
  {
    "label": "v0.39",
    "key": "v0.39"
  },
  {
    "label": "master",
    "key": "master"
  }
],
  1. edit docs/versions for Makefile to loop through and generate versioned docs.
master              master
launchpad/backports v0.39
  1. Makefile

https://github.com/cosmos/cosmos-sdk/blob/master/Makefile#L195 to build versioned docs and docs with path prefixes in the deployment.


Lmk if anything is unclear. @orkunkl

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants