Skip to content

Commit

Permalink
Merge branch 'next-dev' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed Jan 31, 2024
2 parents 80aad4d + f68f996 commit 646aa57
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 120 deletions.
7 changes: 7 additions & 0 deletions .changeset/two-meals-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"typedoc-plugin-markdown": patch
---

- Fix params being incorrectly escaped in list format.
- Removed generator in footer.
- Fix typing of the defineTheme method.
1 change: 0 additions & 1 deletion docs/pages/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ Below is the full list of keys and default values:
"header.readme": "Readme",
"header.docs": "API",
"breadcrumbs.home": "{projectName} {version}",
"footer.generator": "Generated using TypeDoc and typedoc-plugin-markdown.",
"title.indexPage": "{projectName} {version}",
"title.modulePage": "{name}",
"title.memberPage": "{kind}: {name}",
Expand Down
1 change: 0 additions & 1 deletion docs/pages/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ The majority of [TypeDoc's options](https://typedoc.org/options/) are supported,

Some typical (and frequently asked about) TypeDoc options that might be useful are:

- Using [hideGenerator](https://typedoc.org/options/output/#hidegenerator) to prevent outputting links in the footer.
- Using [disableSources](https://typedoc.org/options/output/#disablesources) to prevent outputting source references.
- Setting [readme](https://typedoc.org/options/input/#readme) to `none` to exclude the project readme from the docs.
2 changes: 0 additions & 2 deletions packages/docusaurus-plugin-typedoc/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const config = {
entryPoints: './test/stubs/src/*',
out: './test/out/default',
readme: 'none',
hideGenerator: true,
cleanOutputDir: true,
},
],
Expand All @@ -29,7 +28,6 @@ const config = {
entryPoints: './test/stubs/src/module-1.ts',
out: './test/out/global-members',
readme: 'none',
hideGenerator: true,
sidebar: { pretty: true },
},
],
Expand Down
1 change: 0 additions & 1 deletion packages/typedoc-github-wiki-theme/test/typedoc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
"readme": "none",
"disableSources": true,
"cleanOutputDir": true,
"hideGenerator": true,
"logLevel": "Warn"
}
3 changes: 1 addition & 2 deletions packages/typedoc-gitlab-wiki-theme/test/typedoc.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"plugin": ["typedoc-plugin-markdown", "typedoc-gitlab-wiki-theme"],
"readme": "none",
"disableSources": true,
"cleanOutputDir": true,
"hideGenerator": true
"cleanOutputDir": true
}
3 changes: 1 addition & 2 deletions packages/typedoc-plugin-frontmatter/test/typedoc-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"readme": "none",
"plugin": ["typedoc-plugin-markdown", "typedoc-plugin-frontmatter"],
"hidePageHeader": true,
"hideBreadcrumbs": true,
"hideGenerator": true
"hideBreadcrumbs": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export interface TextContentMappings {
'header.readme': string;
'header.docs': string;
'breadcrumbs.home': string;
'footer.generator': string;
'title.indexPage': string;
'title.modulePage': string;
'title.memberPage': string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const TEXT_MAPPING_DEFAULTS = {
'header.readme': 'Readme',
'header.docs': 'API',
'breadcrumbs.home': '{projectName} {version}',
'footer.generator': 'Generated using TypeDoc and typedoc-plugin-markdown.',
'title.indexPage': '{projectName} {version}',
'title.modulePage': '{name}',
'title.memberPage': '{kind}: {name}',
Expand Down
6 changes: 5 additions & 1 deletion packages/typedoc-plugin-markdown/src/plugin/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Application, EventHooks, Options, Renderer } from 'typedoc';
import { Application, EventHooks, Options, Renderer, Theme } from 'typedoc';
import { MarkdownThemeRenderContext } from '../theme';
import { MarkdownRendererEvent } from './events';

Expand All @@ -18,6 +18,10 @@ export interface MarkdownApplication extends Application {
* The plugin amends the renderer with additional hooks and options.
*/
export interface MarkdownRenderer extends Renderer {
defineTheme: (
name: string,
theme: new (renderer: MarkdownRenderer) => Theme,
) => void;
markdownHooks: EventHooks<MarkdownRendererHooks, string>;
packageOptions: Record<string, Options>;
preRenderAsyncJobs: Array<(output: MarkdownRendererEvent) => Promise<void>>;
Expand Down
2 changes: 0 additions & 2 deletions packages/typedoc-plugin-markdown/src/theme/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
breadcrumbs,
commentParts,
comment,
generator,
header,
pageIndex,
reflectionIndex,
Expand Down Expand Up @@ -93,7 +92,6 @@ export const partials = (context: MarkdownThemeRenderContext) => {
breadcrumbs: bind(breadcrumbs, context),
commentParts: bind(commentParts, context),
comment: bind(comment, context),
generator: bind(generator, context),
header: bind(header, context),
pageIndex: bind(pageIndex, context),
reflectionIndex: bind(reflectionIndex, context),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export { breadcrumbs } from './breadcrumbs';
export { commentParts } from './comment.parts';
export { comment } from './comment';
export { generator } from './generator';
export { header } from './header';
export { pageIndex } from './index.page';
export { reflectionIndex } from './index.reflection';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ParameterReflection, ReflectionKind } from 'typedoc';
import { MarkdownThemeRenderContext } from '../..';
import { backTicks } from '../markdown';
import { backTicks, bold } from '../markdown';
import { escapeChars } from '../utils';

export function parametersList(
Expand Down Expand Up @@ -53,7 +53,7 @@ export function parametersList(

const name = `${escapeChars(parameter.name)}${optional}`;

const identifier: string[] = [backTicks(name)];
const identifier: string[] = [bold(name)];

if (parameter.type) {
identifier.push(': ' + context.partials.someType(parameter.type));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export function memberTemplate(

md.push(context.partials.member(page.model, 1));

if (!context.options.getValue('hideGenerator')) {
md.push(context.partials.generator());
}

md.push(context.hook('page.end').join('\n'));

return md.join('\n\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ export function projectTemplate(

md.push(context.partials.members(page.model, 2));

if (!context.options.getValue('hideGenerator')) {
md.push(context.partials.generator());
}

md.push(context.hook('page.end').join('\n'));

return md.join('\n\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export function readmeTemplate(
md.push(context.partials.commentParts(page.model.readme));
}

if (!context.options.getValue('hideGenerator')) {
md.push(context.partials.generator());
}

md.push(context.hook('page.end').join('\n'));

return md.join('\n\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ export function reflectionTemplate(

md.push(context.partials.reflectionMember(page.model, 2));

if (!context.options.getValue('hideGenerator')) {
md.push(context.partials.generator());
}

md.push(context.hook('page.end').join('\n'));

return md.join('\n\n');
Expand Down
8 changes: 0 additions & 8 deletions packages/typedoc-plugin-markdown/test/fixtures/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const config: Record<string, Fixture> = {
entryPoints: '/reflections/index.ts',
commonOptions: {
plugin: [path.join(__dirname, 'custom-plugins', 'navigation-plugin.mjs')],
hideGenerator: true,
hidePageHeader: true,
hideBreadcrumbs: true,
},
Expand All @@ -32,7 +31,6 @@ const config: Record<string, Fixture> = {
commonOptions: {
plugin: [path.join(__dirname, 'custom-plugins', 'navigation-plugin.mjs')],
disableSources: true,
hideGenerator: true,
entryFileName: 'index.md',
},
options: [
Expand All @@ -57,7 +55,6 @@ const config: Record<string, Fixture> = {
disableSources: true,
hidePageHeader: true,
hideBreadcrumbs: true,
hideGenerator: true,
enumMembersFormat: 'table',
propertiesFormat: 'table',
readme: 'none',
Expand All @@ -77,7 +74,6 @@ const config: Record<string, Fixture> = {
commonOptions: {
plugin: [path.join(__dirname, 'custom-plugins', 'navigation-plugin.mjs')],
entryPointStrategy: 'packages',
hideGenerator: true,
name: 'packages-example',
entryFileName: 'index.md',
disableSources: true,
Expand All @@ -92,7 +88,6 @@ const config: Record<string, Fixture> = {
commonOptions: {
plugin: [path.join(__dirname, 'custom-plugins', 'navigation-plugin.mjs')],
entryPointStrategy: 'packages',
hideGenerator: true,
name: 'packages-example',
includeVersion: true,
disableSources: true,
Expand All @@ -105,7 +100,6 @@ const config: Record<string, Fixture> = {
plugin: [path.join(__dirname, 'custom-plugins', 'navigation-plugin.mjs')],
entryFileName: 'index.md',
entryModule: 'entry-module',
hideGenerator: true,
disableSources: true,
},
options: [{ entryFileName: 'README.md' }, { readme: 'none' }],
Expand All @@ -119,7 +113,6 @@ const config: Record<string, Fixture> = {
{
entryFileName: 'index.md',
disableSources: true,
hideGenerator: true,
mergeReadme: true,
},
],
Expand All @@ -144,7 +137,6 @@ const config: Record<string, Fixture> = {
outputFileStragies: ['members'],
commonOptions: {
disableSources: true,
hideGenerator: true,
readme: 'none',
outputFileStrategy: 'modules',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
'header.title': 'My API - {version}',
'header.readme': 'My Readme',
'header.docs': 'Docs',
'footer.generator': '@copyright My Test',
'title.indexPage': ':tada: Custom Index Title',
'title.memberPage': '{name}',
'title.modulePage': '{kind} - {name}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Comments for setter
#### Parameters
\`value\`: \`string\`
**value**: \`string\`
Param comments
Expand All @@ -153,7 +153,7 @@ Param comments
#### Parameters
\`x\`: \`string\`
**x**: \`string\`
#### Source
Expand Down Expand Up @@ -277,11 +277,11 @@ Comments for ClassWithConstructorOverloads
#### Parameters
\`x\`: \`number\`
**x**: \`number\`
Comments for x number
\`y\`: \`string\`
**y**: \`string\`
#### Returns
Expand All @@ -297,7 +297,7 @@ Comments for x number
#### Parameters
\`x\`: \`string\`
**x**: \`string\`
Comments for x string
Expand All @@ -315,7 +315,7 @@ Comments for x string
#### Parameters
\`s\`: \`string\`
**s**: \`string\`
#### Returns
Expand Down

0 comments on commit 646aa57

Please sign in to comment.