Skip to content

Commit 1ffacd2

Browse files
committed
contrib: Document use of TypeDoc to see a local website documenting the code.
1 parent 85005bc commit 1ffacd2

File tree

5 files changed

+52
-0
lines changed

5 files changed

+52
-0
lines changed

contributing/Code/About Code.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ This section stores information about the design and implementation of the plugi
66

77
- [[Structure of the code]] - the directory structure of the source code
88

9+
## Documenting the code
10+
11+
- [[Generating documentation of the code]] - browse the source code interactively, and see class hierarchies.
12+
913
## Comment processes
1014

1115
- [[How do I add a new field to the Task class]]
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
![How to use WebStorm to open a web server showing the code documentation](webstorm-open-code-docs.png)
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+
![Screenshot showing the code docs](code-docs-index-page.png)
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+
![Screenshot showing the class hierarchy as of 8th December 2024|200](class-hierarchy.png)
48+
<span class="caption">Screenshot showing the class hierarchy as of 8th December 2024</span>
412 KB
Loading
268 KB
Loading
470 KB
Loading

0 commit comments

Comments
 (0)