2018-09-17 12:43:10 -04:00
# Docs Build Workflow
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
The documentation for Tendermint Core is hosted at:
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
- https://tendermint.com/docs/ and
- https://tendermint-staging.interblock.io/docs/
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
built from the files in this (`/docs` ) directory for
[master ](https://github.com/tendermint/tendermint/tree/master/docs )
and [develop ](https://github.com/tendermint/tendermint/tree/develop/docs ),
respectively.
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
## How It Works
2018-09-10 14:42:48 +08:00
2018-12-15 14:01:28 -05:00
There is a CircleCI job listening for changes in the `/docs` directory, on both
2018-09-17 12:43:10 -04:00
the `master` and `develop` branches. Any updates to files in this directory
on those branches will automatically trigger a website deployment. Under the hood,
2018-12-15 14:01:28 -05:00
the private website repository has a `make build-docs` target consumed by a CircleCI job in that repo.
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
## README
2018-07-18 05:32:17 -04:00
2018-09-17 12:43:10 -04:00
The [README.md ](./README.md ) is also the landing page for the documentation
2018-09-26 17:49:20 -04:00
on the website. During the Jenkins build, the current commit is added to the bottom
of the README.
2018-07-05 03:44:15 -04:00
2018-09-17 12:43:10 -04:00
## Config.js
2018-09-10 14:42:48 +08:00
2018-09-21 07:39:55 -04:00
The [config.js ](./.vuepress/config.js ) generates the sidebar and Table of Contents
2018-09-17 12:43:10 -04: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.
2018-09-30 15:08:01 -04:00
Links to directories *MUST* end in a `/` .
2018-09-17 12:43:10 -04:00
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
2018-09-10 14:42:48 +08:00
2018-09-21 07:39:55 -04:00
To build and serve the documentation locally, run:
```
# from this directory
npm install -g vuepress
```
2019-02-28 11:31:59 +04:00
NOTE: the command may require `sudo` .
then change the following line in the `.vuepress/config.js` :
2018-09-21 07:39:55 -04:00
```
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-10 14:42:48 +08:00
2018-12-15 14:01:28 -05:00
## Search
We are using [Algolia ](https://www.algolia.com ) to power full-text search. This uses a public API search-only key in the `config.js` as well as a [tendermint.json ](https://github.com/algolia/docsearch-configs/blob/master/configs/tendermint.json ) configuration file that we can update with PRs.
2018-09-17 12:43:10 -04:00
## Consistency
2018-09-10 14:42:48 +08:00
2018-09-17 12:43:10 -04:00
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 Cosmos SDK repo ](https://github.com/cosmos/cosmos-sdk/blob/develop/docs/DOCS_README.md ).