|
| 1 | +# Documentation with MkDocs |
| 2 | + |
| 3 | + |
| 4 | +If `mkdocs` is set to `"y"`, documentation of your project is |
| 5 | +automatically added using |
| 6 | +[MkDocs](https://www.mkdocs.org/). Next to that, if |
| 7 | +`"include_github_actions"` is set to `"y"`, the documentation is |
| 8 | +automatically deployed to your `gh-pages` branch, and made available at |
| 9 | +`https://<github_handle>.github.io/<project_name>/`. |
| 10 | + |
| 11 | +To view the documentation locally, simply run |
| 12 | + |
| 13 | +``` bash |
| 14 | +make docs |
| 15 | +``` |
| 16 | + |
| 17 | +This command will generate, and build your documentation, and start the server locally so you can access it at |
| 18 | +<http://localhost:8000>. |
| 19 | + |
| 20 | +## Enabling the documentation on GitHub |
| 21 | + |
| 22 | +To enable your documentation on GitHub, first create a [new release](./cicd.md#how-to-trigger-a-release). |
| 23 | + |
| 24 | +Then, in your repository, navigate to ``Settings > Code and Automation > Pages``. If you succesfully created a new release, |
| 25 | +you should see a notification saying `` Your site is ready to be published at https://<author_github_handle>.github.io/<project_name>/``. |
| 26 | + |
| 27 | +To finalize deploying your documentation, under ``Source``, select the branch ``gh-pages``. Your documentation should then be live within a few minutes. |
| 28 | + |
| 29 | +## Documenting docstrings |
| 30 | + |
| 31 | +The generated project also converts all |
| 32 | +your docstrings into legible documentation. By default, the project is |
| 33 | +configured to work with |
| 34 | +[google](https://google.github.io/styleguide/pyguide.html) style |
| 35 | +docstrings. |
| 36 | + |
| 37 | +An example of a Google style docstring: |
| 38 | + |
| 39 | +``` python |
| 40 | +def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: |
| 41 | +"""Example function with PEP 484 type annotations. |
| 42 | +
|
| 43 | +Args: |
| 44 | + param1: The first parameter. |
| 45 | + param2: The second parameter. |
| 46 | +
|
| 47 | +Returns: |
| 48 | + The return value. True for success, False otherwise. |
| 49 | +``` |
| 50 | +
|
| 51 | +For more examples, see |
| 52 | +[here](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html). |
0 commit comments