|
1 | | -# Documentation landing page |
| 1 | +# Hopsworks Documentation |
2 | 2 |
|
3 | | -This is the source of the landing page for <https://docs.hopsworks.ai> |
| 3 | +This is the source of the Hopsworks Documentation published at <https://docs.hopsworks.ai>. |
4 | 4 |
|
5 | 5 | ## Build instructions |
6 | 6 |
|
@@ -57,3 +57,85 @@ linkchecker http://127.0.0.1:8000/ |
57 | 57 | # If ok just kill the server |
58 | 58 | kill -9 $SERVER_PID |
59 | 59 | ``` |
| 60 | + |
| 61 | +## Setup and Build Documentation |
| 62 | + |
| 63 | +We use `mkdocs` together with `mike` ([for versioning](https://github.com/jimporter/mike/)) to build the documentation and a plugin called `keras-autodoc` to auto generate Python API documentation from docstrings. |
| 64 | + |
| 65 | +**Background about `mike`:** |
| 66 | +`mike` builds the documentation and commits it as a new directory to the gh-pages branch. |
| 67 | +Each directory corresponds to one version of the documentation. |
| 68 | +Additionally, `mike` maintains a json in the root of gh-pages with the mappings of versions/aliases for each of the directories available. |
| 69 | +With aliases you can define extra names like `dev` or `latest`, to indicate stable and unstable releases. |
| 70 | + |
| 71 | +### Versioning on docs.hopsworks.ai |
| 72 | + |
| 73 | +On docs.hopsworks.ai we implement the following versioning scheme: |
| 74 | + |
| 75 | +- current master branches (e.g. of hopsworks corresponding to master of Hopsworks): rendered as current Hopsworks snapshot version, e.g. **4.0.0-SNAPSHOT [dev]**, where `dev` is an alias to indicate that this is an unstable version. |
| 76 | +- the latest release: rendered with full current version, e.g. **3.8.0 [latest]** with `latest` alias to indicate that this is the latest stable release. |
| 77 | +- previous stable releases: rendered without alias, e.g. **3.4.4**. |
| 78 | + |
| 79 | +### 4. Build Instructions |
| 80 | + |
| 81 | +For this you can either checkout and make a local copy of the `upstream/gh-pages` branch, where `mike` maintains the current state of docs.hopsworks.ai, or just build documentation for the branch you are updating: |
| 82 | + |
| 83 | +Building *one* branch: |
| 84 | + |
| 85 | +Checkout your dev branch with modified docs: |
| 86 | + |
| 87 | +```bash |
| 88 | +git checkout [dev-branch] |
| 89 | +``` |
| 90 | + |
| 91 | +Generate API docs if necessary: |
| 92 | + |
| 93 | +```bash |
| 94 | +python auto_doc.py |
| 95 | +``` |
| 96 | + |
| 97 | +Build docs with a version and alias |
| 98 | + |
| 99 | +```bash |
| 100 | +mike deploy [version] [alias] --update-alias |
| 101 | + |
| 102 | +# for example, if you are updating documentation to be merged to master, |
| 103 | +# which will become the new SNAPSHOT version: |
| 104 | +mike deploy 4.0.0-SNAPSHOT dev --update-alias |
| 105 | + |
| 106 | +# if you are updating docs of the latest stable release branch |
| 107 | +mike deploy [version] latest --update-alias |
| 108 | + |
| 109 | +# if you are updating docs of a previous stable release branch |
| 110 | +mike deploy [version] |
| 111 | +``` |
| 112 | + |
| 113 | +If no gh-pages branch existed in your local repository, this will have created it. |
| 114 | + |
| 115 | +**Important**: If no previous docs were built, you will have to choose a version as default to be loaded as index, as follows |
| 116 | + |
| 117 | +```bash |
| 118 | +mike set-default [version-or-alias] |
| 119 | +``` |
| 120 | + |
| 121 | +You can now checkout the gh-pages branch and serve: |
| 122 | + |
| 123 | +```bash |
| 124 | +git checkout gh-pages |
| 125 | +mike serve |
| 126 | +``` |
| 127 | + |
| 128 | +You can also list all available versions/aliases: |
| 129 | + |
| 130 | +```bash |
| 131 | +mike list |
| 132 | +``` |
| 133 | + |
| 134 | +Delete and reset your local gh-pages branch: |
| 135 | + |
| 136 | +```bash |
| 137 | +mike delete --all |
| 138 | + |
| 139 | +# or delete single version |
| 140 | +mike delete [version-or-alias] |
| 141 | +``` |
0 commit comments