Skip to content

Commit

Permalink
chore(core): updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Nov 27, 2024
1 parent e2a3467 commit 5e95bba
Show file tree
Hide file tree
Showing 1,334 changed files with 40,860 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .changeset/big-teachers-shave.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

- Implemented typedoc 0.27 compatibility support.
- Exposed "typeDeclarationVisibility" option to provide a compacted output structure (#703).
- The "textContentMappings" option now accepts a string with placeholder or a function with arguments (#693, #715).
- Exposed "pageTitleTemplates" option that accepts a string with placeholder or function arguments to control page titles. Should be used in favour of "textContentMapping" (#693, #715).
2 changes: 1 addition & 1 deletion .changeset/chatty-cheetahs-love.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'typedoc-plugin-markdown': minor
---

- Exposed formatting with prettier options (--formatWithPrettier and --prettierConfigFile).
- Exposed formatting with prettier options "formatWithPrettier" and "prettierConfigFile" that enables additional formatting of output if Prettier is installed on a project.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ on:
jobs:
lint-and-test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
node: ['20']
node: ['18']
name: Node ${{ matrix.node }}
steps:
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ dist

# testing
samples
out
typedoc-examples
out
html
/devdocs-html

Expand Down
3 changes: 0 additions & 3 deletions devtools/packages/fixtures/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions devtools/packages/fixtures/models.ts

This file was deleted.

12 changes: 0 additions & 12 deletions devtools/packages/fixtures/package.json

This file was deleted.

19 changes: 16 additions & 3 deletions devtools/packages/prebuild-options/tasks/generate-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ import { ManuallyValidatedOption } from 'typedoc'`);
theme_default_value: [];
theme_default_type: [];
theme_description: [];
theme_documentation: [];
theme_event: [];
theme_re_exports: [];
theme_renames_and_re_exports: [];
Expand Down Expand Up @@ -134,7 +133,7 @@ ${name}: ${getType(name, option, true)};`,
${Object.entries(option.defaultValue as any)
.map(
([key, value]) =>
`'${key}'${value === undefined ? '?' : ''}: ${getValueType(value)}`,
`'${key}'${value === undefined ? '?' : ''}: ${getValueType(key, value)}`,
)
.join(';')}
}
Expand All @@ -161,7 +160,14 @@ function getComments(name: string) {
return '';
}

function getValueType(value: any) {
function getValueType(key: string, value: any) {
if (key === 'pageTitleTemplates') {
return `{
index: string | ((args: { name: string }) => string);
member: string;
module: string;
}`;
}
if (value === true || value === false) {
return 'boolean';
}
Expand All @@ -179,6 +185,13 @@ function getType(
option: Partial<DeclarationOption>,
isInterface = false,
) {
if (name === 'pageTitleTemplates') {
return `{
index: string | ((name: { projectName: string; version: string }) => string);
member: string | ((name: { name: string; kind: string; group: string }) => string);
module: string | ((name: { name: string, kind: string }) => string);
}`;
}
if (option.type === ParameterType.Array && option.defaultValue?.length) {
return `(${option.defaultValue
.toString()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { Converter, TypeScript, CommentTag, Comment } = require('typedoc');
const { ModifierFlags } = require('typescript');
import { Comment, CommentTag, Converter, TypeScript } from 'typedoc';

exports.load = function (app) {
export function load(app) {
const printer = TypeScript.createPrinter({
removeComments: false,
omitTrailingSemicolon: true,
Expand Down Expand Up @@ -32,7 +31,7 @@ exports.load = function (app) {

reflection.defaultValue = '';

if (Boolean(reflection.comment)) {
if (reflection.comment) {
reflection.comment.blockTags = [
...(reflection.comment.blockTags || []),
getTag(defaultValue),
Expand All @@ -43,7 +42,7 @@ exports.load = function (app) {
}
},
);
};
}
function getTag(value) {
return new CommentTag('@defaultValue', [
{
Expand Down
48 changes: 30 additions & 18 deletions devtools/typedoc-plugins/typedoc-symbols.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
// @ts-check

/**
* Local plugin to tweak TypeDoc output for nextra docs
*
* @param {import("typedoc").Application} app
*/
export function load(app) {
app.converter.addUnknownSymbolResolver((ref) => {
if (ref.moduleSource === 'typedoc') {
const symbol = ref.symbolReference.path[0].path;
const symbol =
ref?.symbolReference?.path && ref?.symbolReference?.path[0].path;
const enums = ['ReflectionKind'];
const configuration = [
'DeclarationOption',
Expand Down Expand Up @@ -56,24 +64,28 @@ export function load(app) {
'QueryType',
];

if (models.includes(symbol)) {
return `https://typedoc.org/api/classes/Models.${symbol}.html`;
}
if (classes.includes(symbol)) {
return `https://typedoc.org/api/classes/${symbol}.html`;
}
if (enums.includes(symbol)) {
return `https://typedoc.org/api/enums/Models.${symbol}-1.html`;
}
if (interfaces.includes(symbol)) {
return `https://typedoc.org/api/${interfaces}/TypeDocOptions.html`;
}
if (configuration.includes(symbol)) {
return `https://typedoc.org/api/types/Configuration.${symbol}.html`;
}
if (types.includes(symbol)) {
return `https://typedoc.org/api/types/${symbol}.DeclarationOption.html`;
if (symbol) {
if (models.includes(symbol)) {
return `https://typedoc.org/api/classes/Models.${symbol}.html`;
}
if (classes.includes(symbol)) {
return `https://typedoc.org/api/classes/${symbol}.html`;
}
if (enums.includes(symbol)) {
return `https://typedoc.org/api/enums/Models.${symbol}-1.html`;
}
if (interfaces.includes(symbol)) {
return `https://typedoc.org/api/${interfaces}/TypeDocOptions.html`;
}
if (configuration.includes(symbol)) {
return `https://typedoc.org/api/types/Configuration.${symbol}.html`;
}
if (types.includes(symbol)) {
return `https://typedoc.org/api/types/${symbol}.DeclarationOption.html`;
}
}

return '';
}
});
}
8 changes: 8 additions & 0 deletions docs/pages/api-docs/Class.MarkdownPageEvent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ The complete `string` filename where the file will be written..

***

### group?

> `optional` **group**: `string`
The group that the reflection belongs too

***

### contents?

> `optional` **contents**: `string`
Expand Down
Loading

0 comments on commit 5e95bba

Please sign in to comment.