-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 0.1.1 * Export LogCollector type * Add types & dependencies for link maps * Richer representation of link maps * Proof of concept link mapping works * Docs for the TypeDoc integration * Doc fixes * Update lockfiles
- Loading branch information
Showing
19 changed files
with
469 additions
and
3,351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{#typedoc-integration} | ||
# Typedoc integration | ||
|
||
{added-in-version="0.2"} | ||
::: | ||
::: | ||
|
||
{tag=aside .caution} | ||
::: | ||
TypeDoc integration hasn't been tested broadly. Please [create an issue on GitHub](https://github.com/irskep/djockey/issues/new) if you run into any trouble. | ||
::: | ||
|
||
Djockey can integrate with [TypeDoc](https://typedoc.org) to create an integrated documentation experience that combines the authoring power of Djockey with rich API references. For example, here in the Djockey docs, we can type `[](:ts:DjockeyPlugin)`{.language-djot} and get [](:ts:DjockeyPlugin). | ||
|
||
The core concept is to render TypeDoc normally inside your docs directory, treat its output as static files, and then create convenient link aliases into it. | ||
|
||
## 1. Run TypeDoc | ||
|
||
First, run TypeDoc on your project with JSON and HTML output. The JSON output can go anywhere, but the HTML must go inside your docs source directory next to your markup. | ||
|
||
```sh | ||
npx typedoc src/index.ts \ | ||
--json docs/src/types.json \ | ||
--out docs/src/api | ||
``` | ||
|
||
## 2. Generate a link map | ||
|
||
Djockey uses a _link map file_ to figure out where to point links to. You generate a link map using a separate program called `linkmapper-typedoc`. | ||
|
||
```sh | ||
npm install --dev @djockey/linkmapper-typedoc | ||
npx linkmapper-typedoc \ | ||
docs/src/types.json \ | ||
docs/src/typescript_link_map.json | ||
``` | ||
|
||
## 3. Configure Djockey | ||
|
||
Assuming your `djockey.yaml` is under `docs`... | ||
|
||
{filename="docs/djockey.yaml"} | ||
```yaml | ||
link_mappings: | ||
- path: src/typescript_link_map.json | ||
url_root: api/ | ||
``` | ||
|
||
The path is relative to `djockey.yaml`{.language-sh}. `url_root` should be the place you rendered TypeDoc's HTML output to. | ||
|
||
## 4. Link to your API docs | ||
|
||
From here, you can write `:ts:symbolName` as a link destination to get a link into your TypeDoc API reference. If you need to disambiguate, for example to refer to a method on a specific class, you can add parent types like `:ts:SomeClass.someMethod` or `:ts:namespace.SomeClass.someMethod`. | ||
|
||
If your link doesn't have any text, the text will be populated automatically. So you can say `[API reference for DjockeyPlugin](:ts:DjockeyPlugin)`{.language-djot} to customize the link text, or just `[](:ts:DjockeyPlugin)`{.language-djot} to use the symbol name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
{ | ||
"version": 0, | ||
"namespaces": [ | ||
"typescript", | ||
"ts", | ||
"typedoc" | ||
], | ||
"linkMappings": [ | ||
{ | ||
"linkDestination": "DocSet", | ||
"relativeURL": "classes/DocSet.html", | ||
"defaultLabel": "DocSet" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.constructor", | ||
"relativeURL": "classes/DocSet.html#constructor", | ||
"defaultLabel": "constructor" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.config", | ||
"relativeURL": "classes/DocSet.html#config", | ||
"defaultLabel": "config" | ||
}, | ||
{ | ||
"linkDestination": "config", | ||
"relativeURL": "classes/DocSet.html#config", | ||
"defaultLabel": "config" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.docs", | ||
"relativeURL": "classes/DocSet.html#docs", | ||
"defaultLabel": "docs" | ||
}, | ||
{ | ||
"linkDestination": "docs", | ||
"relativeURL": "classes/DocSet.html#docs", | ||
"defaultLabel": "docs" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.plugins", | ||
"relativeURL": "classes/DocSet.html#plugins", | ||
"defaultLabel": "plugins" | ||
}, | ||
{ | ||
"linkDestination": "plugins", | ||
"relativeURL": "classes/DocSet.html#plugins", | ||
"defaultLabel": "plugins" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.tree", | ||
"relativeURL": "classes/DocSet.html#tree", | ||
"defaultLabel": "tree" | ||
}, | ||
{ | ||
"linkDestination": "tree", | ||
"relativeURL": "classes/DocSet.html#tree", | ||
"defaultLabel": "tree" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.getDoc", | ||
"relativeURL": "classes/DocSet.html#getDoc", | ||
"defaultLabel": "getDoc" | ||
}, | ||
{ | ||
"linkDestination": "getDoc", | ||
"relativeURL": "classes/DocSet.html#getDoc", | ||
"defaultLabel": "getDoc" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.makeRenderableCopy", | ||
"relativeURL": "classes/DocSet.html#makeRenderableCopy", | ||
"defaultLabel": "makeRenderableCopy" | ||
}, | ||
{ | ||
"linkDestination": "makeRenderableCopy", | ||
"relativeURL": "classes/DocSet.html#makeRenderableCopy", | ||
"defaultLabel": "makeRenderableCopy" | ||
}, | ||
{ | ||
"linkDestination": "DocSet.runPasses", | ||
"relativeURL": "classes/DocSet.html#runPasses", | ||
"defaultLabel": "runPasses" | ||
}, | ||
{ | ||
"linkDestination": "runPasses", | ||
"relativeURL": "classes/DocSet.html#runPasses", | ||
"defaultLabel": "runPasses" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector", | ||
"relativeURL": "classes/LogCollector.html", | ||
"defaultLabel": "LogCollector" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.constructor", | ||
"relativeURL": "classes/LogCollector.html#constructor", | ||
"defaultLabel": "constructor" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.label", | ||
"relativeURL": "classes/LogCollector.html#label", | ||
"defaultLabel": "label" | ||
}, | ||
{ | ||
"linkDestination": "label", | ||
"relativeURL": "classes/LogCollector.html#label", | ||
"defaultLabel": "label" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.lines", | ||
"relativeURL": "classes/LogCollector.html#lines", | ||
"defaultLabel": "lines" | ||
}, | ||
{ | ||
"linkDestination": "lines", | ||
"relativeURL": "classes/LogCollector.html#lines", | ||
"defaultLabel": "lines" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.loader", | ||
"relativeURL": "classes/LogCollector.html#loader", | ||
"defaultLabel": "loader" | ||
}, | ||
{ | ||
"linkDestination": "loader", | ||
"relativeURL": "classes/LogCollector.html#loader", | ||
"defaultLabel": "loader" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.debug", | ||
"relativeURL": "classes/LogCollector.html#debug", | ||
"defaultLabel": "debug" | ||
}, | ||
{ | ||
"linkDestination": "debug", | ||
"relativeURL": "classes/LogCollector.html#debug", | ||
"defaultLabel": "debug" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.dump", | ||
"relativeURL": "classes/LogCollector.html#dump", | ||
"defaultLabel": "dump" | ||
}, | ||
{ | ||
"linkDestination": "dump", | ||
"relativeURL": "classes/LogCollector.html#dump", | ||
"defaultLabel": "dump" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.error", | ||
"relativeURL": "classes/LogCollector.html#error", | ||
"defaultLabel": "error" | ||
}, | ||
{ | ||
"linkDestination": "error", | ||
"relativeURL": "classes/LogCollector.html#error", | ||
"defaultLabel": "error" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.fail", | ||
"relativeURL": "classes/LogCollector.html#fail", | ||
"defaultLabel": "fail" | ||
}, | ||
{ | ||
"linkDestination": "fail", | ||
"relativeURL": "classes/LogCollector.html#fail", | ||
"defaultLabel": "fail" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.info", | ||
"relativeURL": "classes/LogCollector.html#info", | ||
"defaultLabel": "info" | ||
}, | ||
{ | ||
"linkDestination": "info", | ||
"relativeURL": "classes/LogCollector.html#info", | ||
"defaultLabel": "info" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.succeed", | ||
"relativeURL": "classes/LogCollector.html#succeed", | ||
"defaultLabel": "succeed" | ||
}, | ||
{ | ||
"linkDestination": "succeed", | ||
"relativeURL": "classes/LogCollector.html#succeed", | ||
"defaultLabel": "succeed" | ||
}, | ||
{ | ||
"linkDestination": "LogCollector.warning", | ||
"relativeURL": "classes/LogCollector.html#warning", | ||
"defaultLabel": "warning" | ||
}, | ||
{ | ||
"linkDestination": "warning", | ||
"relativeURL": "classes/LogCollector.html#warning", | ||
"defaultLabel": "warning" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyConfig", | ||
"relativeURL": "types/DjockeyConfig.html", | ||
"defaultLabel": "DjockeyConfig" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyConfigResolved", | ||
"relativeURL": "types/DjockeyConfigResolved.html", | ||
"defaultLabel": "DjockeyConfigResolved" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyDoc", | ||
"relativeURL": "types/DjockeyDoc.html", | ||
"defaultLabel": "DjockeyDoc" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyInputFormat", | ||
"relativeURL": "types/DjockeyInputFormat.html", | ||
"defaultLabel": "DjockeyInputFormat" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyLinkMapping", | ||
"relativeURL": "types/DjockeyLinkMapping.html", | ||
"defaultLabel": "DjockeyLinkMapping" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyLinkMappingDoc", | ||
"relativeURL": "types/DjockeyLinkMappingDoc.html", | ||
"defaultLabel": "DjockeyLinkMappingDoc" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyOutputFormat", | ||
"relativeURL": "types/DjockeyOutputFormat.html", | ||
"defaultLabel": "DjockeyOutputFormat" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyPlugin", | ||
"relativeURL": "types/DjockeyPlugin.html", | ||
"defaultLabel": "DjockeyPlugin" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyPluginModule", | ||
"relativeURL": "types/DjockeyPluginModule.html", | ||
"defaultLabel": "DjockeyPluginModule" | ||
}, | ||
{ | ||
"linkDestination": "DjockeyRenderer", | ||
"relativeURL": "types/DjockeyRenderer.html", | ||
"defaultLabel": "DjockeyRenderer" | ||
}, | ||
{ | ||
"linkDestination": "DocTree", | ||
"relativeURL": "types/DocTree.html", | ||
"defaultLabel": "DocTree" | ||
}, | ||
{ | ||
"linkDestination": "DocTreeSection", | ||
"relativeURL": "types/DocTreeSection.html", | ||
"defaultLabel": "DocTreeSection" | ||
}, | ||
{ | ||
"linkDestination": "applyFilter", | ||
"relativeURL": "functions/applyFilter.html", | ||
"defaultLabel": "applyFilter" | ||
} | ||
] | ||
} |
Oops, something went wrong.