cosmos-sdk/docs/DOCS_README.md

95 lines
2.6 KiB
Markdown
Raw Normal View History

2018-09-19 10:24:31 -07:00
# Docs Build Workflow
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
The documentation for the Cosmos SDK is hosted at:
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
- https://cosmos.network/docs/ and
- https://cosmos-staging.interblock.io/docs/
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
built from the files in this (`/docs`) directory for
[master](https://github.com/cosmos/cosmos-sdk/tree/master/docs)
and [develop](https://github.com/cosmos/cosmos-sdk/tree/develop/docs),
respectively.
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
## How It Works
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
There is a Jenkins job listening for changes in the `/docs` directory, on both
the `master` and `develop` branches. Any updates to files in this directory
on those branches will automatically trigger a website deployment. Under the hood,
a private website repository has make targets consumed by a standard Jenkins task.
2018-07-16 11:19:11 -07:00
2018-09-19 10:24:31 -07:00
## README
The [README.md](./README.md) is also the landing page for the documentation
on the website.
## Config.js
The [config.js](./.vuepress/config.js) generates the sidebar and Table of Contents
2018-09-19 10:24:31 -07:00
on the website docs. Note the use of relative links and the omission of
file extensions. Additional features are available to improve the look
of the sidebar.
## Links
**NOTE:** Strongly consider the existing links - both within this directory
and to the website docs - when moving or deleting files.
Relative links should be used nearly everywhere, having discovered and weighed the following:
### Relative
Where is the other file, relative to the current one?
- works both on GitHub and for the VuePress build
- confusing / annoying to have things like: `../../../../myfile.md`
- requires more updates when files are re-shuffled
### Absolute
Where is the other file, given the root of the repo?
- works on GitHub, doesn't work for the VuePress build
- this is much nicer: `/docs/hereitis/myfile.md`
- if you move that file around, the links inside it are preserved (but not to it, of course)
### Full
The full GitHub URL to a file or directory. Used occasionally when it makes sense
to send users to the GitHub.
## Building Locally
To build and serve the documentation locally, run:
```
npm install -g vuepress
```
then change the following line in the `config.js`:
```
base: "/docs/",
```
to:
```
base: "/",
```
Finally, go up one directory to the root of the repo and run:
```
# from root of repo
vuepress build docs
cd dist/docs
python -m SimpleHTTPServer 8080
```
then navigate to localhost:8080 in your browser.
2018-09-19 10:24:31 -07:00
## Consistency
Because the build processes are identical (as is the information contained herein), this file should be kept in sync as
much as possible with its [counterpart in the Tendermint Core repo](https://github.com/tendermint/tendermint/blob/develop/docs/DOCS_README.md).