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
Copy file name to clipboardExpand all lines: docs/src/buildtools/5-builders/2-docs.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,28 +3,25 @@
3
3
There are two types of documentation used by Source, which are the jsons and the HTML documentation. Both are built using the [`typedoc`](https://typedoc.org) tool. By reading comments and type annotations, `typedoc` is able to generate both human readable documentation and documentation in the form of JSON.
4
4
5
5
## Typedoc Overview
6
-
Typedoc has been configured to use the [`package` entry point strategy](https://typedoc.org/documents/Options.Input.html#packages). To make sure that each bundle's documentation is generated with the proper name, each bundle's `tsconfig.json` contains
7
-
a `typedocOptions` section which minimally, has the name of the bundle. Using the `package` strategy allows each bundle to customize its own `typedoc` options this way.
6
+
Documentation generation is a two-step process:
8
7
9
-
Typedoc is initialized with the following options:
8
+
Firstly, the `buildtools build docs`is called on each bundle. This produces two JSON files:
1.`build/jsons/[bundle_name].json`, which is the JSON documentation used by `js-slang` and the frontend
11
+
2.`docs.json`, which is JSON documentation format used by `typedoc` to generate the HTML documentation later
12
12
13
-
The package options are applied to each bundle, while the common options are used overall.
14
-
15
-
Initializing `typedoc` returns an [`Application`](https://typedoc.org/api/classes/Application.html) object, which can then be used to generate a [`ProjectReflection`](https://typedoc.org/api/classes/Models.ProjectReflection.html). The reflection always contains more reflection models
16
-
as its children, each of which represents a different bundle.
13
+
Second, `buildtools manifest` is called, which then takes the `docs.json` files from each bundle and uses the [`merge` entry point strategy](https://typedoc.org/documents/Options.Input.html#merge) to create the HTML
14
+
documentation
17
15
18
16
> [!NOTE]
19
17
> Since type checking is supposed to be performed by `tsc`, `skipErrorChecking` has been set to true. This means that if there are type errors in the source files being processed,
20
18
> `typedoc` simply returns `undefined` when `Application.convert` is called.
21
19
20
+
This allows each bundle to have its own Typedoc option set.
21
+
22
22
## HTML Generation
23
23
It is not possible to generate the HTML documentation on a per-bundle basis. Thus, when HTML documentation needs to be regenerated, the source files of every single bundle needs to be processed.
24
24
25
25
## JSON Generation
26
26
`typedoc` represents each bundle as a [`DeclarationReflection`](https://typedoc.org/api/classes/Models.DeclarationReflection.html) internally. Each of these `DeclarationReflection`s contains an array of "children" elements which
27
27
represents that bundle's exports. Each of these elements is parsed by various parsers to produce the desired documentation object, which is then written to disk after converted into a JSON string.
28
-
29
-
It is possible to generate the JSON documentation of each bundle separately. Hence, the JSON builder doesn't initialize `typedoc`, leaving the caller to choose between initializing `typedoc` for all bundles at once
Copy file name to clipboardExpand all lines: docs/src/repotools/docserver/1-overview.md
+31-22Lines changed: 31 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
---
2
+
title: Overview
3
+
---
1
4
# Developer Documentation Server
2
5
3
6
Originally most of the developer documentation was contained within the Github repository's wiki. However, as the documentation became more comprehensive in scope and complex in design,
@@ -13,26 +16,32 @@ some folder have contents that are labelled `1-something`, `2-something` etc. Ea
13
16
14
17
Folders produce item groups, the name of which can be customized using an `index.md` file within that folder.
15
18
16
-
```txt
17
-
bundles
18
-
├── index.md
19
-
├── 1-getting-started
20
-
│ ├── 1-overview.md
21
-
│ ├── 2-start.md
22
-
│ ├── 3.cheat.md
23
-
│ ├── 4-faq.md
24
-
│ └── index.md
25
-
└── 2-bundle
26
-
├── 1-overview
27
-
│ └── 1-overview.md
28
-
├── 2-creating
29
-
│ └── 2-creating.md
30
-
├── 3-editing.md
31
-
├── 4-documentation
32
-
│ └── 4-documentation.md
33
-
├── 5-type_map.md
34
-
├── 6-compiling.md
35
-
└── index.md
19
+
```dirtree
20
+
name: bundles
21
+
children:
22
+
- index.md
23
+
- name: 1-getting-started
24
+
children:
25
+
- 1-overview.md
26
+
- 2-start.md
27
+
- 3-cheat.md
28
+
- 4-faq.md
29
+
- index.md
30
+
- name: 2-bundle
31
+
children:
32
+
- name: 1-overview
33
+
children:
34
+
- 1-overview.md
35
+
- name: 2-creating.md
36
+
children:
37
+
- 2-creating.md
38
+
- 3-editing.md
39
+
- name: 4-documentation
40
+
children:
41
+
- 4-documentation.md
42
+
- 5-type_map.md
43
+
- 6-compiling.md
44
+
- index.md
36
45
```
37
46
38
47
The above file structure produces the menu below:
@@ -41,7 +50,7 @@ The above file structure produces the menu below:
41
50
Each item takes its title value from either the frontmatter (if available) or the first heading of each page.
42
51
43
52
`index.md` files are only used to title the menus, they are not intended for navigation, though are navigable to if the user enters the address manually, so it is still recommended to keep some basic
44
-
documentation in those pages or create rewrites so that users are automatically redirected away from those pages. Here are the contents of `2-bundle/index.md`:
53
+
documentation in those pages or create rewrites so that users are automatically redirected away from those pages. Here are the contents of <nobr><code>2-bundle/index.md</code></nobr>:
45
54
46
55
<<< ../../modules/2-bundle/index.md
47
56
@@ -78,4 +87,4 @@ this
78
87
└── tree
79
88
└── diagram
80
89
```
81
-
were generated from [this website](https://tree.nathanfriend.com/)
90
+
are generated via their own markdown plugin, the details of which can be found [here](./2-dirtree).
0 commit comments