You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the `index.md` (home) of the generated documentation gets complex,
it doesn't make a lot of sense to reuse the README, because:
1. More advanced `mkdocs` syntax is not rendered properly by GitHub
(like admonitions).
2. Internal cross-linking into the documentation from the home also
doesn't work in GitHub.
Because of this we leave a much sorter and simpler README, with a quick
example, and for the rest we point users to the documentation website.
Signed-off-by: Leandro Lucarella <[email protected]>
@@ -51,186 +46,15 @@ After completing it and fixing the `TODO`s you can amend the previous commit
51
46
using `git commit --amend` or create a new commit for the changes using `git
52
47
commit`.
53
48
54
-
#### Create the local development environment
55
-
56
-
To start the development, you need to make sure your environment is correctly
57
-
setup. One way to do this is by using a virtual environment and installing all
58
-
the dependencies there:
59
-
60
-
```sh
61
-
# requires at least python version 3.11
62
-
python3 -m venv .venv
63
-
. .venv/bin/activate
64
-
pip install -e .[dev]
65
-
```
66
-
67
-
This will install you package in [*editable*
68
-
mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html), so
69
-
you can open a python interpreter and import your package modules and pick up
70
-
any local changes without the need to reinstall. You can now run tools
71
-
directly, like `pytest`.
72
-
73
-
#### Verify the new repository is healthy using `nox`
74
-
75
-
If you prefer to keep your virtual enviroment cleaner and avoid installing development dependencies, you can also use `nox` to create isolated environments for you:
76
-
77
-
```sh
78
-
pip install -e .[dev-noxfile]
79
-
nox --install-only # Set up virtual environments once
80
-
nox -R # Run linting and testing reusing the already existing virtual environments
81
-
```
82
-
83
-
This will only install you package in *editable* mode and the minimum
84
-
dependencies to be able to run `nox`, and then run all `nox` default sessions,
85
-
which will run linters and tests.
86
-
87
-
!!! note
88
-
89
-
It's much faster to use `nox` with `--install-only` once (each time to
90
-
change or update dependencies you need to run it again) and then using `nox
91
-
-R` to run the sessions without re-creating the virtual environments.
92
-
93
-
Otherwise `nox` will create many virtual environments each time you run it,
94
-
which is **very** slow.
95
-
96
-
#### Verify the generated documentation works
97
-
98
-
To generate the documentation you can use `mkdocs`:
99
-
100
-
```sh
101
-
pip install .[dev-mkdocs] # Not necessary if you already installed .[dev]
102
-
mkdocs serve
103
-
```
104
-
105
-
If the command fails, look at the log warnings and errors and fix them. If it
106
-
worked, now there is a local web server serving the documentation, you can
107
-
point your browser to Now you can point your browser to
108
-
[http://127.0.0.1:8000](/http://127.0.0.1:8000/) to have a look.
109
-
110
-
!!! info
111
-
112
-
For API projects `docker` is needed to generate and serve documentation, as
113
-
the easiest way to use the [tool to generate the documentation from
114
-
`.proto`](https://github.com/pseudomuto/protoc-gen-doc) files is using
115
-
`docker`.
116
-
117
-
#### Initialize the GitHub pages website
118
-
119
-
The generated documentation can be easily published via GitHub pages, and it
120
-
will be automatically updated for new pushed and releases, but for that to work
121
-
correctly, some initial setup is needed:
122
-
123
-
```sh
124
-
pip install -e .[dev-mkdocs] # Not necessary if you already installed .[dev]
125
-
mike deploy --update-aliases next latest # Creates the branch gh-pages locally
126
-
mike set-default latest # Makes the latest alias the default version
127
-
git push upstream gh-pages # Pushes the new branch upstream so the website is published
0 commit comments