docs: add 0.47 to docs (#13852)

This commit is contained in:
Julien Robert 2022-11-14 15:06:20 +01:00 committed by GitHub
parent fc21215803
commit f1fc44efd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 61 additions and 41 deletions

7
.gitignore vendored
View File

@ -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

View File

@ -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

9
docs/.gitignore vendored
View File

@ -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

View File

@ -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`.
@ -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
docs/build-all.sh Executable file
View File

@ -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

View File

@ -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",
@ -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: {

3
docs/versions.json Normal file
View File

@ -0,0 +1,3 @@
[
"v0.47"
]

View File

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

View File

@ -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