Skip to content

Commit 25bc826

Browse files
committed
Change document configurations
1 parent 312c0fe commit 25bc826

30 files changed

+118
-2076
lines changed

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.vitepress/cache
22
.vitepress/dist
3+
4+
src/lib/modules-lib

docs/.vitepress/config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ const vitepressOptions: UserConfig = {
1212
// https://vitepress.dev/reference/default-theme-config
1313
nav: [
1414
{ text: 'Home', link: '/' },
15-
{ text: 'Module Development', link: '/modules/' }
15+
{ text: 'Module Development', link: '/modules/' },
16+
{ text: 'Common Library', link: '/lib' },
17+
{ text: 'Build Tools', link: '/buildtools' }
1618
],
1719
siteTitle: 'SA Modules',
1820
socialLinks: [
@@ -25,7 +27,7 @@ const vitepressOptions: UserConfig = {
2527
search: {
2628
provider: 'local'
2729
}
28-
}
30+
},
2931
};
3032

3133
const commonSideBarOptions: VitePressSidebarOptions = {
@@ -43,7 +45,8 @@ const commonSideBarOptions: VitePressSidebarOptions = {
4345
const sidebarConfigs: Record<string, VitePressSidebarOptions> = {
4446
buildtools: {},
4547
modules: {},
46-
lib: {}
48+
lib: {},
49+
'/lib/modules-lib': {}
4750
};
4851

4952
const sideBarOptions = Object.entries(sidebarConfigs).map(([startPath, options]): VitePressSidebarOptions => ({

docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"vitepress-sidebar": "^1.31.1"
1010
},
1111
"scripts": {
12-
"docs:dev": "vitepress dev .",
13-
"docs:build": "vitepress build .",
14-
"docs:preview": "vitepress preview ."
12+
"build": "vitepress build .",
13+
"dev": "vitepress dev .",
14+
"preview": "vitepress preview ."
1515
}
1616
}

docs/src/buildtools/1-builders/1-modules.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Bundles and tabs are transpiled with esbuild using the following common options
3636

3737
<<< ../../../../lib/buildtools/src/build/modules/commons.ts#esbuildOptions
3838

39-
## Options Explained:
39+
## Options Explained
4040
### `bundle: true`
4141
Tell `esbuild` to bundle the code into a single file.
4242

@@ -94,7 +94,7 @@ var module = (function() {
9494
```
9595
Which are then transformed by the `outputBundleOrTab` function, which produces output that looks like this:
9696
```js
97-
require => {
97+
export default require => {
9898
var exports = {}
9999
exports.add_one = function(x) {
100100
return x + 1;
@@ -104,7 +104,8 @@ require => {
104104
}
105105
```
106106

107-
When bundles and tabs are loaded, the IIFE is called with a function that simulates the `require()` function in CommonJS to provide the dependencies marked as external (that have to be provided at runtime).
107+
Consumers of this compiled version of bundles and tabs can retrieve the IIFE by using the default export. When bundles and tabs are loaded, the IIFE is called with a function that simulates the `require()` function
108+
in CommonJS to provide the dependencies marked as external (that have to be provided at runtime).
108109

109110
## `js-slang/context`
110111
`js-slang/context` is an import provided at runtime by `js-slang` that returns the context in use for evaluation. It is not an actual import that's available

docs/src/buildtools/1-builders/2-docs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Documentation Generation
22

3-
There are two types of documentation used by Source, which are the jsons and the HTML documentation. Both are built using the [`typedoc`](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.
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.
44

55
## Typedoc Overview
66
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

docs/src/buildtools/3-structure.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
order: 3
3-
---
4-
51
# General Design of the Build Tools
62

73
## Path Resolution

docs/src/buildtools/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Source Academy Modules build tools are written in Typescript and designed to
88

99
The build tools are comprised of several sections:
1010

11-
- [Command Handlers](./command)
11+
- [Command Handlers](./2-command)
1212
- The actual code that runs command line argument parsing
1313
- [Builders](./1-builders)
1414
- The code that converts a bundle or tab into its outputs

docs/src/lib/modules-lib/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/src/lib/modules-lib/specialErrors.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/src/lib/modules-lib/tabs/AnimationCanvas.md

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)