https://github.com/zebp/wasm_deno_doc
Bindings to deno documentation generator through WASM
https://github.com/zebp/wasm_deno_doc
Last synced: about 2 months ago
JSON representation
Bindings to deno documentation generator through WASM
- Host: GitHub
- URL: https://github.com/zebp/wasm_deno_doc
- Owner: zebp
- License: unlicense
- Created: 2021-06-08T14:35:11.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-14T17:51:57.000Z (almost 4 years ago)
- Last Synced: 2025-04-02T05:49:38.453Z (about 2 months ago)
- Language: JavaScript
- Size: 6.45 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wasm_deno_doc
Bindings to Deno's documentation generator built in Rust using WebAssembly.## Example
```typescript
const esSyntax: Syntax = {
syntax: "es",
...defaultEsConfig(),
};const tsSyntax: Syntax = {
syntax: "typescript",
...defaultTsConfig(),
};const testFileLoader: FileLoader = {
resolve: (specifier: string) => specifier,
async loadSourceCode(specifier: string): Promise<[Syntax, string]> {
const segments = specifier.split(".");
const extension = segments[segments.length - 1];const syntax = extension === "ts" ? tsSyntax : esSyntax;
const source = await Deno.readTextFile(specifier);return [syntax, source];
},
};const parser = new Parser(testFileLoader, false);
const docNodes = await parser.parse("example.ts");console.log(docNodes);
```