Skip to content

Commit 591939c

Browse files
committed
fix(core): fix index generation issues
1 parent 75cf255 commit 591939c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+305
-292
lines changed

.changeset/neat-monkeys-provide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'typedoc-plugin-markdown': minor
3+
---
4+
5+
- Remove extraneous "Index" headings.

.changeset/tender-snails-dress.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'typedoc-plugin-markdown': patch
3+
---
4+
5+
- Expose global documents with "packages" entryPointStrategy.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ samples
99
typedoc-examples
1010
out
1111
html
12-
/devdocs-html
12+
/devguide-html
1313

1414
# dependencies
1515
node_modules

packages/README.md renamed to GETTING_STARTED.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
# Developer Guide
1+
---
2+
title: Getting Started
3+
description: How to start developing locally.
4+
---
25

3-
## Monorepo Overview
6+
# Getting Started
47

5-
This is a simple monorepo managed by [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).
6-
7-
Please view individual packages for further insights:
8-
9-
- {@link typedoc-plugin-markdown} is the core package and is the package that is used to generate the markdown documentation.
10-
- {@link typedoc-plugin-frontmatter} and {@link typedoc-plugin-remark} provide metadata or adjust the output.
11-
- {@link typedoc-github-wiki-theme}, {@link typedoc-gitlab-wiki-theme},
12-
{@link typedoc-vitepress-theme} and {@link docusaurus-plugin-typedoc} target specific implementations.
13-
14-
## Machine Setup
8+
## 1. Machine Setup
159

1610
**1. Fork and clone the repository**
1711

@@ -47,4 +41,16 @@ Test all packages in the workspace:
4741
npm run test
4842
```
4943

44+
## 2. Contributing to packages
45+
5046
If the project builds and the tests run successfully you are ready to start contributing to the project.
47+
48+
This is a simple monorepo managed by [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).
49+
50+
{@link typedoc-plugin-markdown} is the core package and is the package that is used to generate the Markdown documentation.
51+
52+
Child packages all depend on the core package and provide further functionality:
53+
54+
- {@link typedoc-plugin-frontmatter} and {@link typedoc-plugin-remark} provide metadata or adjust the output.
55+
- {@link typedoc-github-wiki-theme}, {@link typedoc-gitlab-wiki-theme},
56+
{@link typedoc-vitepress-theme} and {@link docusaurus-plugin-typedoc} target specific implementations.

devtools/packages/prebuild-options/tasks/generate-models.ts

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import { ManuallyValidatedOption } from 'typedoc'`);
7272
theme_member_plural: [];
7373
theme_modifier: [];
7474
theme_name: [];
75+
theme_package: [];
7576
theme_packages: [];
7677
theme_type: [];
7778
theme_value: [];

devtools/typedoc-plugins/typedoc-default-values.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function load(app) {
4444
);
4545
}
4646
function getTag(value) {
47-
return new CommentTag('@defaultValue', [
47+
return new CommentTag('@initializer', [
4848
{
4949
kind: 'code',
5050
text: makeCodeBlock(value),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Converter } from 'typedoc';
2+
3+
export function load(app) {
4+
app.converter.on(
5+
Converter.EVENT_CREATE_DECLARATION,
6+
(_context, reflection) => {
7+
if (
8+
reflection.comment &&
9+
reflection?.comment?.summary &&
10+
reflection?.comment?.summary.length
11+
) {
12+
reflection.comment.summary = reflection.comment.summary.map(
13+
(summary) => ({
14+
...summary,
15+
text: summary.text.replace(
16+
/<FileTree\b[^>]*>.*?<\/FileTree>/gs,
17+
'*See public docs for file tree example.*',
18+
),
19+
}),
20+
);
21+
}
22+
},
23+
);
24+
}

devtools/typedoc-plugins/typedoc-symbols.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export function load(app) {
3131
const interfaces = ['TypeDocOptions', 'TypeOperatorType'];
3232
const classes = [
3333
'Application',
34+
'Context',
3435
'DefaultThemeRenderContext',
3536
'Event',
3637
'EventHooks',

docs/pages/docs/options/file-options.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TypeDoc generates documentation models according to exports derived from the giv
1616
This option provides some flexibility as to how files are generated by organising how these exports are organized on individual pages.
1717
Note that each module and namespace will at a minimum have its own page.
1818

19-
The available keys are `"members"` (default), `"categories"`, and `"modules"`.
19+
The available keys are `"members"` (default) and `"modules"`.
2020

2121
**"members"**
2222

docs/pages/docs/versioning.mdx

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ Please note that TypeDoc is still released within the 0.x.x range and may includ
88

99
A new minor version of the plugin and be released with each minor TypeDoc version, and we will attempt to release in a non-breaking manner.
1010

11+
Besides the TypeDoc release versions, we aim to follow semantic versioning for the plugin:
12+
13+
- Bug fixes including minor UI tweaks will be released as patch versions.
14+
- New features/options will be released as minor versions.
15+
- UI changes implemented in a non-breaking manner will be released as minor versions.
16+
- Breaking changes including option changes and fundamental UI changes will be released as major versions.
17+
1118
## Compatibility Table
1219

1320
We will follow the Node.js and TypeScript versions as specified in the TypeDoc `package.json` file.

docs/pages/plugins/docusaurus/options.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The following are preset typedoc-plugin-markdown options:
2424

2525
The following options are exposed by this plugin:
2626

27-
## --sidebar
27+
## sidebar
2828

2929
<Callout emoji="💡">Configures the autogenerated Docusaurus sidebar.</Callout>
3030

docs/pages/plugins/frontmatter/options.mdx

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Callout } from "nextra/components";
22

33
# Options
44

5-
## --frontmatterGlobals
5+
## frontmatterGlobals
66

77
<Callout emoji="💡">
88
Specify static variables to be added to all frontmatter blocks.
@@ -26,7 +26,7 @@ sidebar: true
2626
}
2727
```
2828

29-
## --readmeFrontmatter
29+
## readmeFrontmatter
3030

3131
<Callout emoji="💡">
3232
Specify static variables to be added to the readme page only.
@@ -42,7 +42,7 @@ sidebar: true
4242
}
4343
```
4444

45-
## --indexFrontmatter
45+
## indexFrontmatter
4646

4747
<Callout emoji="💡">
4848
Specify static variables to be added to the index page only.
@@ -58,7 +58,7 @@ sidebar: true
5858
}
5959
```
6060

61-
## --frontmatterCommentTags
61+
## frontmatterCommentTags
6262

6363
<Callout emoji="💡">
6464
Specify which comment block tags should be added to frontmatter.
@@ -70,12 +70,12 @@ Frontmatter variables can be added by extracting comments from block (@) tags.
7070

7171
Please note tags must be added to the comment blocks of the symbol exported to a page.
7272

73-
```ansi filename="Block Tags (someModule.ts)"
73+
```ts filename="Block Tags (someModule.ts)"
7474
/**
75-
* @author Joe Bloggs
76-
*
77-
* @description A description that will be added to frontmatter.
78-
*/
75+
* @author Joe Bloggs
76+
*
77+
* @description A description that will be added to frontmatter.
78+
*/
7979
```
8080

8181
```yaml filename="YAML (someModule.md)"
@@ -91,7 +91,7 @@ description: A description that will be added to frontmatter.
9191
}
9292
```
9393

94-
## --preserveFrontmatterCommentTags
94+
## preserveFrontmatterCommentTags
9595

9696
<Callout emoji="💡">
9797
Preserve tags defined in frontmatter block tags in output.
@@ -105,7 +105,7 @@ description: A description that will be added to frontmatter.
105105
}
106106
```
107107

108-
## --frontmatterNamingConvention
108+
## frontmatterNamingConvention
109109

110110
<Callout emoji="💡">
111111
The naming convention that variables should be output as.{" "}

docs/pages/plugins/github-wiki/options.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following are preset typedoc-plugin-markdown options:
2323

2424
The following options are exposed by this plugin:
2525

26-
## --sidebar
26+
## sidebar
2727

2828
<Callout emoji="💡">Configures the autogenerated `_sidebar.md file`.</Callout>
2929

docs/pages/plugins/gitlab-wiki/options.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following are preset typedoc-plugin-markdown options:
2222

2323
The following options are exposed by this plugin:
2424

25-
## --sidebar
25+
## sidebar
2626

2727
<Callout emoji="💡">Configures the autogenerated `_Sidebar.md file`.</Callout>
2828

docs/pages/plugins/remark/options.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Callout } from "nextra/components";
22

33
# Options
44

5-
## --remarkPlugins
5+
## remarkPlugins
66

77
<Callout emoji="💡">An array of remark plugin names to be executed.</Callout>
88

@@ -28,7 +28,7 @@ Options can be provided as either an array of strings or an array of strings wit
2828
}
2929
```
3030

31-
## --defaultRemarkPlugins
31+
## defaultRemarkPlugins
3232

3333
<Callout emoji="💡">
3434
A set of flags that control the enabling or disabling of remark plugins that
@@ -53,7 +53,7 @@ If you'd like to disable any of these default plugins, simply set the correspond
5353
}
5454
```
5555

56-
## --remarkStringifyOptions
56+
## remarkStringifyOptions
5757

5858
<Callout emoji="💡">Custom options for the remark-stringify plugin.</Callout>
5959

docs/pages/plugins/vitepress/options.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following are preset typedoc-plugin-markdown options:
2323

2424
The following options are exposed by this plugin:
2525

26-
## --docsRoot
26+
## docsRoot
2727

2828
<Callout emoji="💡">The path to the VitePress project root.</Callout>
2929

@@ -57,7 +57,7 @@ Requires the following config:
5757
}
5858
```
5959

60-
## --sidebar
60+
## sidebar
6161

6262
<Callout emoji="💡">Configures the autogenerated VitePress sidebar.</Callout>
6363

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"devtools/packages/*"
1212
],
1313
"scripts": {
14-
"docs": "ts-node ./devtools/scripts/generate-readmes && node ./devtools/scripts/tocs.mjs",
15-
"devdocs": "npm run build --workspace typedoc-plugin-markdown && typedoc",
14+
"docs": "tsx ./devtools/scripts/generate-readmes && node ./devtools/scripts/tocs.mjs && npm run build --workspace typedoc-plugin-markdown && typedoc",
1615
"build-all": "npm run build --workspaces --if-present",
1716
"test-all": "npm run test --workspaces --if-present",
1817
"test-and-update-all": "npm run test:update --workspaces --if-present",

packages/typedoc-plugin-frontmatter/src/options/declarations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const indexFrontmatter: Partial<DeclarationOption> = {
6262
*
6363
* Please note tags must be added to the comment blocks of the symbol exported to a page.
6464
*
65-
* ```ansi filename="Block Tags (someModule.ts)"
65+
* ```ts filename="Block Tags (someModule.ts)"
6666
* \/**
6767
* * \@author Joe Bloggs
6868
* *

packages/typedoc-plugin-markdown/src/_typedoc.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ declare module 'typedoc' {
9191
theme_member_plural: [];
9292
theme_modifier: [];
9393
theme_name: [];
94+
theme_package: [];
9495
theme_packages: [];
9596
theme_type: [];
9697
theme_value: [];

packages/typedoc-plugin-markdown/src/index.ts

+17-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
2-
* The plugin entrypoint and bootstrapping of the plugin.
2+
* The entry point for initializing and bootstrapping the plugin.
33
*
4-
* @module
4+
* @module core
55
*/
66
import { getTranslatable } from '@plugin/internationalization/translatable.js';
77
import { declarations } from '@plugin/options/index.js';
@@ -17,17 +17,30 @@ import {
1717
ParameterType,
1818
} from 'typedoc';
1919
import { render } from './renderer/render.js';
20+
2021
/**
2122
* The function that is called by TypeDoc to bootstrap the plugin.
2223
*
23-
* Here we expose additional TypeDoc options and make some adjustments.
24+
* @remarks
25+
*
26+
* The load function exposes additional TypeDoc options and make some adjustments.
2427
*
2528
* This method is not intended to be consumed in any other context that via the `plugin` option.
29+
*
30+
* The load functions:
31+
*
32+
* 1. Bootstrap the plugin options
33+
* 2. Configures markdown outputs
34+
* 3. Configures localization
35+
* 4. Applies any other behaviour
36+
*
37+
* The module also exports anything that is available publicly.
38+
*
2639
*/
2740
export function load(app: Application) {
2841
/**
2942
* ====================
30-
* 1. Bootstrap Options
43+
* 1. Bootstrap options
3144
* ====================
3245
*/
3346

packages/typedoc-plugin-markdown/src/internationalization/locales/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const translatable: TranslatableStrings = {
1818
theme_member_plural: 'Members',
1919
theme_modifier: 'Modifier',
2020
theme_name: 'Name',
21+
theme_package: 'Package',
2122
theme_packages: 'Packages',
2223
theme_type: 'Type',
2324
theme_value: 'Value',

packages/typedoc-plugin-markdown/src/internationalization/locales/jp.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const translatable: Partial<TranslatableStrings> = {
1919
theme_member_plural: 'メンバー',
2020
theme_modifier: '修飾子',
2121
theme_name: '名前',
22+
theme_package: 'パッケージ',
2223
theme_packages: 'パッケージ',
2324
theme_type: 'タイプ',
2425
theme_value: '値',

packages/typedoc-plugin-markdown/src/internationalization/locales/ko.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const translatable: Partial<TranslatableStrings> = {
1818
theme_member_plural: '멤버들',
1919
theme_modifier: '수정자',
2020
theme_name: '이름',
21+
theme_package: '패키지',
2122
theme_packages: '패키지',
2223
theme_type: '유형',
2324
theme_value: '값',

packages/typedoc-plugin-markdown/src/internationalization/locales/zh.ts

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const translatable: Partial<TranslatableStrings> = {
1818
theme_member_plural: '成员',
1919
theme_modifier: '修饰符',
2020
theme_name: '名称',
21+
theme_package: '包',
2122
theme_packages: '包',
2223
theme_type: '类型',
2324
theme_value: '值',

packages/typedoc-plugin-markdown/src/internationalization/translatable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Application } from 'typedoc';
1111
*
1212
* These will then be merged with the main set of TypeDoc string.
1313
*
14-
* @category Methods
14+
* @category Functions
1515
*/
1616
export function getTranslatable(app: Application) {
1717
const LOCALES = {

packages/typedoc-plugin-markdown/src/libs/markdown/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Helpers for generating markdown.
3+
*
4+
* @module
5+
*/
6+
17
export * from './back-ticks.js';
28
export * from './block-quote-block.js';
39
export * from './bold.js';

0 commit comments

Comments
 (0)