Skip to content

Commit

Permalink
docs: add 0.47 to docs (cosmos#13852)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Nov 14, 2022
1 parent fc21215 commit f1fc44e
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 41 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ private
# Build
vendor
build
docs/node_modules
docs/docs/modules
docs/docs/spec
docs/docs/architecture
docs/docs/tooling/01-cosmovisor.md
docs/docs/tooling/02-depinject.md
docs/run-node/04-rosetta.md
dist
tools-stamp
buf-stamp
Expand Down
18 changes: 1 addition & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,8 @@ godocs:
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/cosmos-sdk/types"
godoc -http=:6060

# This builds the docs.cosmos.network docs using docusaurus.
# Old documentation, which have not been migrated to docusaurus are generated with vuepress.
build-docs:
@echo "building docusaurus docs"
@cd docs && npm ci && npm run build
mv docs/build ~/output

@echo "building old docs"
@cd docs && \
while read -r branch path_prefix; do \
echo "building vuepress $${branch} docs" ; \
(git clean -fdx && git reset --hard && git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \
mkdir -p ~/output/$${path_prefix} ; \
cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \
done < vuepress_versions ;

@echo "setup domain"
@echo $(DOCS_DOMAIN) > ~/output/CNAME
@cd docs && sh ./build-all.sh

.PHONY: build-docs

Expand Down
9 changes: 9 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
# Generated files
.docusaurus
.cache-loader
versioned_docs
versioned_sidebars
docs/node_modules
docs/docs/modules
docs/docs/spec
docs/docs/architecture
docs/docs/tooling/01-cosmovisor.md
docs/docs/tooling/02-depinject.md
docs/run-node/04-rosetta.md

# Misc
.DS_Store
Expand Down
7 changes: 5 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ make build-docs

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, 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`.
Expand All @@ -74,6 +75,8 @@ When a new major version of the SDK is released, the following steps should be t
},
```

* Add the new version sidebar to the list of versionned sidebar and add the version to `versions`
* 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.
27 changes: 27 additions & 0 deletions docs/build-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

# This builds the docs.cosmos.network docs using docusaurus.
# Old documentation, which have not been migrated to docusaurus are generated with vuepress.
COMMIT=$(git rev-parse HEAD)
mkdir -p ~/versioned_docs ~/versioned_sidebars
for version in $(jq -r .[] versions.json); do
echo "building docusaurus $version docs"
git clean -fdx && git reset --hard && git checkout release/$version.x
sh ./pre.sh
npm ci && npm run docusaurus docs:version $version
mv ./versioned_docs/* ~/versioned_docs/
mv ./versioned_sidebars/* ~/versioned_sidebars/
done
echo "building docusaurus main docs"
(git clean -fdx && git reset --hard && git checkout $COMMIT)
mv ~/versioned_docs ~/versioned_sidebars .
npm ci && npm run build
mv build ~/output
while read -r branch path_prefix; do
echo "building vuepress $branch docs"
(git clean -fdx && git reset --hard && git checkout $branch && npm install && VUEPRESS_BASE="/$path_prefix/" npm run build)
mkdir -p ~/output/$path_prefix
cp -r .vuepress/dist/* ~/output/$path_prefix/
done < vuepress_versions
echo "setup domain"
echo $DOCS_DOMAIN > ~/output/CNAME
16 changes: 6 additions & 10 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
const lightCodeTheme = require("prism-react-renderer/themes/github");
const darkCodeTheme = require("prism-react-renderer/themes/dracula");

// const lastVersion = "v0.47";
const lastVersion = "current";

/** @type {import('@docusaurus/types').Config} */
const config = {
title: "Cosmos SDK",
Expand Down Expand Up @@ -40,17 +37,16 @@ const config = {
docs: {
sidebarPath: require.resolve("./sidebars.js"),
routeBasePath: "/",
lastVersion: lastVersion,
lastVersion: "v0.47",
versions: {
current: {
path: "main",
// banner: "unreleased",
banner: "unreleased",
},
"v0.47": {
path: "v0.47",
label: "v0.47",
},
// "v0.47": {
// label: "v0.47",
// path: "v0.47",
// banner: "none",
// },
},
},
theme: {
Expand Down
3 changes: 3 additions & 0 deletions docs/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"v0.47"
]
2 changes: 1 addition & 1 deletion x/distribution/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ In Proof of Stake (PoS) blockchains, rewards gained from transaction fees are pa

Rewards are calculated per period. The period is updated each time a validator's delegation changes, for example, when the validator receives a new delegation.
The rewards for a single validator can then be calculated by taking the total rewards for the period before the delegation started, minus the current total rewards.
To learn more, see the [F1 Fee Distribution paper](/docs/spec/fee_distribution/f1_fee_distr.pdf).
To learn more, see the [F1 Fee Distribution paper](https://github.com/cosmos/cosmos-sdk/tree/main/docs/spec/fee_distribution/f1_fee_distr.pdf).

The commission to the validator is paid when the validator is removed or when the validator requests a withdrawal.
The commission is calculated and incremented at every `BeginBlock` operation to update accumulated fee amounts.
Expand Down
13 changes: 9 additions & 4 deletions x/nft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ sidebar_position: 1

`x/nft` is an implementation of a Cosmos SDK module, per [ADR 43](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-043-nft-module.md), that allows you to create nft classification, create nft, transfer nft, update nft, and support various queries by integrating the module. It is fully compatible with the ERC721 specification.

* [Concept](#concepts)
* [Concepts](#concepts)
* [Class](#class)
* [NFT](#nft)
*[State](#state)
*[Messages](#messages)
* [State](#state)
* [Class](#class-1)
* [NFT](#nft-1)
* [NFTOfClassByOwner](#nftofclassbyowner)
* [Owner](#owner)
* [TotalSupply](#totalsupply)
* [Messages](#messages)
* [MsgSend](#msgsend)
*[Events](#events)
* [Events](#events)

## Concepts

Expand Down

0 comments on commit f1fc44e

Please sign in to comment.