diff --git a/package-lock.json b/package-lock.json index 0adfe78..8d7ffe2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "jest": "29.5.0", "prettier": "2.8.7", "ts-jest": "29.0.5", - "ts-loader": "^9.5.1", + "ts-loader": "9.5.1", "ts-node": "10.4.0", "typescript": "4.9.5", "webpack": "5.90.3", diff --git a/src/class.ts b/src/class.ts index 5862437..e7b5b71 100644 --- a/src/class.ts +++ b/src/class.ts @@ -5,6 +5,13 @@ import { escapeHTML, serializeSignature, serializeSymbol } from "./utils"; export const printClass = (c: ClassDocEntry): string => { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference/class/${c.name}`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + + res.push(`# ${c.name}`); res.push(""); if (c.heritage.extends && c.heritage.extends.length > 0) { diff --git a/src/dts-docs.ts b/src/dts-docs.ts index a951be5..3dad3c8 100644 --- a/src/dts-docs.ts +++ b/src/dts-docs.ts @@ -87,6 +87,12 @@ function main(args: string[]): void { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + res.push("# API reference"); res.push(""); diff --git a/src/enum.ts b/src/enum.ts index ff2c699..ee73404 100644 --- a/src/enum.ts +++ b/src/enum.ts @@ -5,6 +5,12 @@ import { escapeHTML, serializeSymbol } from "./utils"; export const printEnum = (e: EnumDocEntry): string => { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference/enum/${e.name}`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + res.push(`# ${e.name}`); res.push(""); res.push("```ts"); diff --git a/src/function.ts b/src/function.ts index 03f75e3..1ddafc8 100644 --- a/src/function.ts +++ b/src/function.ts @@ -45,6 +45,13 @@ export const parseFunction = ( export const printFunction = (f: FunctionDocEntry): string => { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference/function/${f.name}`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + + res.push("# " + f.name); res.push(""); res.push("```ts"); diff --git a/src/interface.ts b/src/interface.ts index e16b83a..98e853a 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -5,6 +5,13 @@ import { escapeHTML, serializeSymbol } from "./utils"; export const printInterface = (i: InterfaceDocEntry): string => { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference/interface/${i.name}`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + + res.push(`# ${i.name}`); res.push(""); diff --git a/src/type.ts b/src/type.ts index 08e3b0a..d253e81 100644 --- a/src/type.ts +++ b/src/type.ts @@ -5,6 +5,12 @@ import { escapeHTML, serializeSymbol } from "./utils"; export const printType = (e: TypeDocEntry): string => { const res: string[] = []; + res.push("---"); + res.push(`title: dts-docs/api-reference/type/${e.name}`); + res.push(`group: dts-docs`) + res.push("---"); + res.push(""); + res.push(`# ${e.name}`); res.push("");