Use tsdoc.json for our own doc tags

This commit is contained in:
Oliver Blanthorn 2026-08-28 14:35:47 +02:00
parent e04d35fe87
commit 5e1929db02
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
3 changed files with 15 additions and 24 deletions

View file

@ -62,19 +62,6 @@ if [ "$QUICK_BUILD" != "1" ]; then
printf 'export * from "./lib/metadata"\n' > src/.metadata.generated.ts
node -e "var fs=require('fs');fs.writeFileSync('src/.themes.generated.json',JSON.stringify(fs.readdirSync('src/static/themes').sort()))"
# TypeDoc's own default blockTags, plus our custom @flag/@endflags tags. Same as scripts/make_docs.sh
blockTags=$(node -e '
import("typedoc").then(async ({ Application }) => {
const app = await Application.bootstrap({})
const tags = app.options.getValue("blockTags").filter(t => t !== "@inheritDoc")
console.log([...tags, "@flag", "@endflags"].join(" "))
})
')
set --
for tag in $blockTags; do
set -- "$@" --blockTags "$tag"
done
# Generate runtime metadata via typedoc. The generated TypeScript shim
# routes the public @src/.metadata.generated import to the JSON loader.
"$(yarn bin)/typedoc" --json src/.metadata.generated.json \
@ -82,7 +69,6 @@ import("typedoc").then(async ({ Application }) => {
--excludePrivate false --excludePrivateClassFields false \
--validation.notExported false \
--exclude 'src/.excmds_*.generated.ts' \
"$@" \
src/excmds.ts src/lib/config.ts src/content/state_content.ts
node scripts/convert_typedoc_metadata.js src/.metadata.generated.json

View file

@ -8,16 +8,6 @@ if revision=$(git rev-parse HEAD 2>/dev/null); then
else
set -- --disableSources
fi
blockTags=$(node -e '
import("typedoc").then(async ({ Application }) => {
const app = await Application.bootstrap({})
const tags = app.options.getValue("blockTags").filter(t => t !== "@inheritDoc")
console.log([...tags, "@flag", "@endflags"].join(" "))
})
')
for tag in $blockTags; do
set -- "$@" --blockTags "$tag"
done
"$(yarn bin)/typedoc" --plugin ./scripts/typedoc-theme.mjs \
--theme tridactyl --router tridactyl \
"$@" \

15
tsdoc.json Normal file
View file

@ -0,0 +1,15 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
"extends": ["typedoc/tsdoc.json"],
"noStandardTags": false,
"tagDefinitions": [
{
"tagName": "@flag",
"syntaxKind": "block"
},
{
"tagName": "@endflags",
"syntaxKind": "block"
}
]
}