typedoc-plugin-markdown
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -50,3 +50,3 @@ "use strict"; | ||
/** | ||
* Interate over declaration definitions and to the container. | ||
* Iterate over declaration definitions and to the container. | ||
*/ | ||
@@ -53,0 +53,0 @@ Object.entries(declarations).forEach(([name, declaration]) => { |
@@ -13,4 +13,6 @@ "use strict"; | ||
.replace(/\|/g, '\\|') | ||
.replace(/\[/g, '\\[') | ||
.replace(/\]/g, '\\]') | ||
.replace(/\*/g, '\\*'); | ||
} | ||
exports.escapeChars = escapeChars; |
@@ -10,4 +10,5 @@ "use strict"; | ||
.replace(/\`\`\`/g, '`') | ||
.replace(/\n/g, ''); | ||
.replace(/\n/g, '') | ||
.replace(/(<br \/>\s*)+$/g, ''); | ||
} | ||
exports.formatTableColumn = formatTableColumn; |
@@ -143,3 +143,3 @@ import { DeclarationOption } from 'typedoc'; | ||
* | ||
* This option will remove reference to `@scope` in the path when generating files and directories. It does not effect the name of the package or module in the output. | ||
* This option will remove reference to `@scope` in the path when generating files and directories. It does not affect the name of the package or module in the output. | ||
* | ||
@@ -297,3 +297,3 @@ * The following will be the directory structure for packages named `@scope/package-1` and `@scope/package-2`: | ||
/** | ||
* *Please note this options does not effect the rendering of inline code or code blocks (using single/triple backticks).* | ||
* *Please note this options does not affect the rendering of inline code or code blocks (using single/triple backticks).* | ||
* | ||
@@ -300,0 +300,0 @@ * By default all comments written inside JsDoc comments will be passed to the output as written, and parsers will interpret un-escaped angle brackets as HTML/JSX tags.. |
@@ -184,3 +184,3 @@ "use strict"; | ||
* | ||
* This option will remove reference to `@scope` in the path when generating files and directories. It does not effect the name of the package or module in the output. | ||
* This option will remove reference to `@scope` in the path when generating files and directories. It does not affect the name of the package or module in the output. | ||
* | ||
@@ -420,3 +420,3 @@ * The following will be the directory structure for packages named `@scope/package-1` and `@scope/package-2`: | ||
/** | ||
* *Please note this options does not effect the rendering of inline code or code blocks (using single/triple backticks).* | ||
* *Please note this options does not affect the rendering of inline code or code blocks (using single/triple backticks).* | ||
* | ||
@@ -423,0 +423,0 @@ * By default all comments written inside JsDoc comments will be passed to the output as written, and parsers will interpret un-escaped angle brackets as HTML/JSX tags.. |
@@ -23,3 +23,22 @@ "use strict"; | ||
if (opts.showTags && model.blockTags?.length) { | ||
const tags = model.blockTags | ||
const blockTags = model.blockTags.reduce((previous, current) => { | ||
if (current.tag === '@example') { | ||
const prevExampleTag = previous.find((tag) => ['@example', '@examples'].includes(tag.tag)); | ||
if (prevExampleTag) { | ||
return previous.map((prevTag) => { | ||
if (prevTag === prevExampleTag) { | ||
current.content.unshift({ kind: 'text', text: '\n\n' }); | ||
return { | ||
...prevTag, | ||
tag: '@examples', | ||
content: [...prevTag.content, ...current.content], | ||
}; | ||
} | ||
return prevTag; | ||
}); | ||
} | ||
} | ||
return [...previous, current]; | ||
}, []); | ||
const tags = blockTags | ||
.filter((tag) => tag.tag !== '@returns') | ||
@@ -26,0 +45,0 @@ .filter((tag) => !opts.isTableColumn || |
@@ -10,29 +10,35 @@ "use strict"; | ||
const md = []; | ||
const parent = !model.isTarget | ||
? model.types | ||
.map((hierarchyType) => { | ||
return this.helpers.getHierarchyType(hierarchyType, { | ||
isTarget: model.isTarget || false, | ||
}); | ||
}) | ||
.join('.') | ||
: null; | ||
if (model.next) { | ||
if (parent) { | ||
md.push((0, markdown_1.heading)(options.headingLevel, this.getText('label.extends'))); | ||
md.push(`- ${parent}`); | ||
const getHierarchy = (hModel) => { | ||
const parent = !hModel.isTarget | ||
? hModel.types | ||
.map((hierarchyType) => { | ||
return this.helpers.getHierarchyType(hierarchyType, { | ||
isTarget: hModel.isTarget || false, | ||
}); | ||
}) | ||
.join('.') | ||
: null; | ||
if (hModel.next) { | ||
if (parent) { | ||
md.push((0, markdown_1.heading)(options.headingLevel, this.getText('label.extends'))); | ||
md.push(`- ${parent}`); | ||
} | ||
else { | ||
md.push((0, markdown_1.heading)(options.headingLevel, this.getText('label.extendedBy'))); | ||
const lines = []; | ||
hModel.next.types.forEach((hierarchyType) => { | ||
lines.push(this.helpers.getHierarchyType(hierarchyType, { | ||
isTarget: hModel.next?.isTarget || false, | ||
})); | ||
}); | ||
md.push((0, markdown_1.unorderedList)(lines)); | ||
} | ||
if (hModel.next?.next) { | ||
getHierarchy(hModel.next); | ||
} | ||
} | ||
else { | ||
md.push((0, markdown_1.heading)(options.headingLevel, this.getText('label.extendedBy'))); | ||
const lines = []; | ||
model.next.types.forEach((hierarchyType) => { | ||
lines.push(this.helpers.getHierarchyType(hierarchyType, { | ||
isTarget: model.next?.isTarget || false, | ||
})); | ||
}); | ||
md.push((0, markdown_1.unorderedList)(lines)); | ||
} | ||
} | ||
}; | ||
getHierarchy(model); | ||
return md.join('\n\n'); | ||
} | ||
exports.hierarchy = hierarchy; |
{ | ||
"name": "typedoc-plugin-markdown", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,3 +15,3 @@ # typedoc-plugin-markdown | ||
Please visit the [https://typedoc-plugin-markdown.org/docs](https://typedoc-plugin-markdown.org/docs) for comprehensive documentation, including options and usage guides. | ||
Please visit the [https://typedoc-plugin-markdown.org](https://typedoc-plugin-markdown.org) for comprehensive documentation, including options and usage guides. | ||
@@ -18,0 +18,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305202
8019