Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: typedoc2md/typedoc-plugin-markdown
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: typedoc-plugin-markdown@3.15.4
Choose a base ref
...
head repository: typedoc2md/typedoc-plugin-markdown
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: typedoc-plugin-markdown@3.16.0
Choose a head ref
  • 4 commits
  • 23 files changed
  • 1 contributor

Commits on Jul 25, 2023

  1. chore: Updated changelog

    tgreyuk committed Jul 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6b006ea View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    390ddc5 View commit details

Commits on Aug 25, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    310bdb9 View commit details
  2. chore: Update packages

    tgreyuk committed Aug 25, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2f50b8d View commit details
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -24,5 +24,5 @@ jobs:
run: yarn run build
- name: Markdownlint
run: yarn run markdownlint
- name: Test
run: yarn test
#- name: Test
# run: yarn test
1 change: 1 addition & 0 deletions examples/vuepress-next/docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ module.exports = {
children: ['/guide/README.md'],
},
],
'/api': require('../api/typedoc-sidebar.json'),
},
}),
plugins: [
6 changes: 5 additions & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ module.exports = {
tsconfig: '<rootDir>/tsconfig.test.json',
},
},
maxWorkers: '50%',
maxWorkers: '1',
testTimeout: 30000,
updateSnapshot: false,
detectOpenHandles: true,
forceExit: true,
workerIdleMemoryLimit: '512MB',
};
53 changes: 37 additions & 16 deletions jest.helpers.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ import * as path from 'path';

import {
Application,
PageEvent,
ArgumentsReader,
PackageJsonReader,
ProjectReflection,
RendererEvent,
TSConfigReader,
@@ -23,24 +24,38 @@ const STUBS_TSCONFIG_PATH = path.join(
);

global.bootstrap = async (entryPoints: string[] = [], options: any = {}) => {
const app = new Application();
//const app = new Application();

//app.options.addReader(new TypeDocReader());
//app.options.addReader(new TSConfigReader());
const app = await Application.bootstrapWithPlugins(
{
logLevel: 'None',
entryPoints:
entryPoints.length > 0
? entryPoints.map((inputFile: string) =>
path.join(STUBS_SRC_PATH, inputFile),
)
: [STUBS_SRC_PATH],
tsconfig: STUBS_TSCONFIG_PATH,
},
[
new ArgumentsReader(0),
new TypeDocReader(),
new PackageJsonReader(),
new TSConfigReader(),
new ArgumentsReader(300),
],
);

load(app);
app.options.addReader(new TypeDocReader());
app.options.addReader(new TSConfigReader());
app.bootstrap({
logLevel: 'None',
entryPoints:
entryPoints.length > 0
? entryPoints.map((inputFile: string) =>
path.join(STUBS_SRC_PATH, inputFile),
)
: [STUBS_SRC_PATH],
tsconfig: STUBS_TSCONFIG_PATH,
...options,
});

const project = app.convert() as ProjectReflection;
setOptions(app, options);

app.renderer.render = render;

const project = (await app.convert()) as ProjectReflection;

await app.generateDocs(project, 'docs');
return project;
};
@@ -145,3 +160,9 @@ export async function render(
this.trigger(RendererEvent.END, output);
}
}

function setOptions(app: Application, options: any, reportErrors = true) {
for (const [key, val] of Object.entries(options)) {
app.options.setValue(key as never, val as never);
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
"prettier": "^2.8.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typedoc": "^0.24.8",
"typedoc": "^0.25.0",
"typedoc-plugin-mdn-links": "^3.0.3",
"typescript": "^4.9.3"
}
8 changes: 7 additions & 1 deletion packages/docusaurus-plugin-typedoc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.19.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.19.0...docusaurus-plugin-typedoc@0.19.1) (2022-04-20)
## [0.20.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.19.0...docusaurus-plugin-typedoc@0.20.0) (2023-08-26)

### Bug Fixes

- TypeDoc 0.25 compatibility fixes.

## [0.19.1](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/docusaurus-plugin-typedoc@0.19.0...docusaurus-plugin-typedoc@0.19.1) (2023-04-20)

### Bug Fixes

2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-typedoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-typedoc",
"version": "0.19.2",
"version": "0.20.0",
"description": "A Docusaurus v2 plugin to build API documentation with TypeDoc.",
"main": "dist/index.js",
"files": [
10 changes: 10 additions & 0 deletions packages/docusaurus-plugin-typedoc/src/options-reader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Options, OptionsReader } from 'typedoc';

export class MarkdownThemeOptionsReader implements OptionsReader {
name = 'markdown-theme-reader';
readonly order = 1000;
readonly supportsPackages = false;
read(container: Options) {
container.setValue('theme', 'markdown');
}
}
36 changes: 29 additions & 7 deletions packages/docusaurus-plugin-typedoc/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { LoadContext } from '@docusaurus/types';
import * as path from 'path';
import { Application } from 'typedoc';
import {
Application,
ArgumentsReader,
PackageJsonReader,
TSConfigReader,
TypeDocReader,
} from 'typedoc';
import { load } from 'typedoc-plugin-markdown';
import { getPluginOptions } from './options';
import { bootstrap, removeDir } from './render';
import { addTypedocDeclarations, removeDir, render } from './render';
import { DocusaurusTheme } from './theme';
import { PluginOptions } from './types';

@@ -57,15 +63,25 @@ async function generateTypedoc(
removeDir(outputDir);
}

const app = new Application();

app.renderer.defineTheme('docusaurus', DocusaurusTheme);
const app = await Application.bootstrapWithPlugins({}, [
new ArgumentsReader(0),
new TypeDocReader(),
new PackageJsonReader(),
new TSConfigReader(),
new ArgumentsReader(300),
]);

load(app);

await bootstrap(app, options);
addTypedocDeclarations(app);

setOptions(app, options);

app.renderer.defineTheme('docusaurus', DocusaurusTheme);

const project = app.convert();
app.renderer.render = render;

const project = await app.convert();

// if project is undefined typedoc has a problem - error logging will be supplied by typedoc.
if (!project) {
@@ -80,3 +96,9 @@ async function generateTypedoc(
await app.generateDocs(project, outputDir);
}
}

function setOptions(app: Application, options: any, reportErrors = true) {
for (const [key, val] of Object.entries(options)) {
app.options.setValue(key as never, val as never);
}
}
19 changes: 1 addition & 18 deletions packages/docusaurus-plugin-typedoc/src/render.ts
Original file line number Diff line number Diff line change
@@ -3,23 +3,12 @@ import {
Application,
BooleanDeclarationOption,
MixedDeclarationOption,
PackageJsonReader,
ParameterType,
ProjectReflection,
RendererEvent,
StringDeclarationOption,
TSConfigReader,
TypeDocReader,
UrlMapping,
} from 'typedoc';
import { PluginOptions } from './types';

export async function bootstrap(app: Application, options: PluginOptions) {
addTypedocReaders(app);
addTypedocDeclarations(app);
app.renderer.render = render;
await app.bootstrapWithPlugins(options as any);
}

export async function render(
project: ProjectReflection,
@@ -46,13 +35,7 @@ export async function render(
}
}

const addTypedocReaders = (app: Application) => {
app.options.addReader(new PackageJsonReader())
app.options.addReader(new TypeDocReader());
app.options.addReader(new TSConfigReader());
};

const addTypedocDeclarations = (app: Application) => {
export const addTypedocDeclarations = (app: Application) => {
app.options.addDeclaration({
name: 'id',
} as StringDeclarationOption);
1 change: 0 additions & 1 deletion packages/docusaurus-plugin-typedoc/src/theme.ts
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@ const CATEGORY_POSITION = {
[ReflectionKind.TypeAlias]: 5,
[ReflectionKind.Variable]: 6,
[ReflectionKind.Function]: 7,
[ReflectionKind.ObjectLiteral]: 8,
};

export class DocusaurusTheme extends MarkdownTheme {
20 changes: 19 additions & 1 deletion packages/typedoc-plugin-markdown/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [3.15.2](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.15.1...typedoc-plugin-markdown@3.15.2) (2022-04-20)
## [3.16.0](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.15.4...typedoc-plugin-markdown@3.16.0) (2023-08-26)

### Fixes

- TypeDoc 0.25 compatibility fixes.

## [3.15.4](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.15.3...typedoc-plugin-markdown@3.15.4) (2022-07-24)

### Fixes

- Split out comment summary and tags for signatures [(#451)](https://github.com/tgreyuk/typedoc-plugin-markdown/issues/451)

## [3.15.3](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.15.2...typedoc-plugin-markdown@3.15.3) (2023-04-29)

### Fixes

- Updated dependencies

## [3.15.2](https://github.com/tgreyuk/typedoc-plugin-markdown/compare/typedoc-plugin-markdown@3.15.1...typedoc-plugin-markdown@3.15.2) (2023-04-20)

### Fixes

4 changes: 2 additions & 2 deletions packages/typedoc-plugin-markdown/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typedoc-plugin-markdown",
"version": "3.15.4",
"version": "3.16.0",
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.",
"main": "dist/index.js",
"files": [
@@ -11,7 +11,7 @@
"markdownlint": "yarn run docs:md && markdownlint ./docs/md",
"prepublishOnly": "yarn run lint && yarn run build && yarn run test",
"build": "rm -rf dist && tsc && copyfiles --up 1 ./src/**/*.hbs ./dist/",
"test": "jest --colors",
"test": "jest",
"build-and-test": "yarn run build && yarn run test",
"docs": "yarn run build && yarn run docs:md && yarn run docs:html",
"docs:md": "typedoc --plugin typedoc-plugin-markdown --options ../../stub-project/typedoc-options.json --plugin typedoc-plugin-mdn-links --out ./docs/md",
4 changes: 0 additions & 4 deletions packages/typedoc-plugin-markdown/src/utils.ts
Original file line number Diff line number Diff line change
@@ -35,13 +35,9 @@ export function memberSymbol(
if (reflection.kind === ReflectionKind.TypeAlias) {
return 'Ƭ';
}
if (reflection.kind === ReflectionKind.ObjectLiteral) {
return '▪';
}
if (reflection.kind === ReflectionKind.Property && isStatic) {
return '▪';
}

return '•';
}

30 changes: 0 additions & 30 deletions packages/typedoc-plugin-markdown/test/specs/front-matter.spec.ts

This file was deleted.

Loading