refactor: minify api.json by shortening keys (#9971)

* refactor: minify api.json by shortening keys

* fix: links to other packages

* refactor: get doclink from canonicalReference, not model

* fix: types

* fix: again

* fix: @link tags with alt texts
This commit is contained in:
Qjuh
2023-11-17 23:26:48 +01:00
committed by GitHub
parent 9868772b64
commit 492f86af39
13 changed files with 239 additions and 61 deletions

View File

@@ -212,7 +212,11 @@ interface IProcessAstEntityContext {
const linkRegEx = /{@link\s(?<class>\w+)#(?<event>event:)?(?<prop>[\w()]+)(?<name>\s[^}]*)?}/g;
function fixLinkTags(input?: string): string | undefined {
return input?.replaceAll(linkRegEx, '{@link $<class>.$<prop>$<name>}');
return input?.replaceAll(
linkRegEx,
(_match, _p1, _p2, _p3, _p4, _offset, _string, groups) =>
`{@link ${groups.class}.${groups.prop}${groups.name ? ` |${groups.name}` : ''}}`,
);
}
function filePathFromJson(meta: DocgenMetaJson): string {