|
| 1 | +--- |
| 2 | +publish: true |
| 3 | +--- |
| 4 | + |
| 5 | +# Generating documentation of the code |
| 6 | + |
| 7 | +It is now possible for developers to create a local documentation website showing the source code of the Tasks plugin. |
| 8 | + |
| 9 | +This can help gain an understanding of the code, and see relationships between classes and functions. |
| 10 | + |
| 11 | +## Generating the documentation |
| 12 | + |
| 13 | +```bash |
| 14 | +yarn code-docs |
| 15 | +``` |
| 16 | + |
| 17 | +This runs [TypeDoc](https://typedoc.org) to populate `code-docs/index.html` and related files. |
| 18 | + |
| 19 | +See the `typedocOptions` section in [tsconfig.json](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/tsconfig.json) for options used. |
| 20 | + |
| 21 | +## Launching the documentation |
| 22 | + |
| 23 | +In WebStorm, use the following steps to view the generated documentation: |
| 24 | + |
| 25 | +1. Open `code-docs/index.html` |
| 26 | +2. Click on a browser icon to open the file in a browser of your choice. |
| 27 | + |
| 28 | + |
| 29 | +<span class="caption">How to use WebStorm to open a web server showing the code documentation</span> |
| 30 | + |
| 31 | +## Using the documentation |
| 32 | + |
| 33 | +A page like this (the Index) will open. |
| 34 | + |
| 35 | + |
| 36 | +<span class="caption">Screenshot showing the code docs</span> |
| 37 | + |
| 38 | +1. Use the links on the left to browse the source code and its documentation. |
| 39 | +2. The `Class Hierarchy` is especially useful. |
| 40 | +3. When viewing classes and files, these Settings will be useful. |
| 41 | +4. Click on the title to get back this Index page. |
| 42 | + |
| 43 | +## Class Hierarchy |
| 44 | + |
| 45 | +Here is a sample screenshot showing the class hierarchy: |
| 46 | + |
| 47 | + |
| 48 | +<span class="caption">Screenshot showing the class hierarchy as of 8th December 2024</span> |
0 commit comments