typedoc2md / typedoc-plugin-markdown Goto Github PK
View Code? Open in Web Editor NEWA plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
Home Page: https://typedoc-plugin-markdown.org
License: MIT License
A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
Home Page: https://typedoc-plugin-markdown.org
License: MIT License
According to http://typedoc.org/guides/doccomments/ in the second paragraph Additionally you can link to other classes, members or functions using double square brackets.
E.g. you link to another class not with the {@link OtherClass} markdown tag but with [[OtherClass]]. This plugin doesn't parse that and you are left with [[OtherClass]] on the .md file
Using --excludePrivate
, if none of the private properties have description they are included in generated doc:
--excludePrivate
/**
* Logger of data file
*/
private readonly _logger: Logger;
private readonly _option: Logger;
--excludePrivate
private readonly _logger: Logger;
private readonly _option: Logger;
I'd be happy to sort this out myself and make a PR, but I'm a bit lost as to what part of the codebase is causing this issue.
The following is related to github MD, I have not tried reproducing this in other styles.
When parsing an interface's method that is generic I get the following:
**reduce**R(reducer: *`function`*, initialReduction?: *`R`*, context?: *`any`*): `R`
The expected output should be something like this:
**reduce**<`R`>(reducer: *`function`*, initialReduction?: *`R`*, context?: *`any`*): `R`
I'd appreciate any input, or at least a nudge in the right direction, thanks.
@tgreyjs Thanks for the last fix but I find another issue in it.
Code:
export class MyFirstClass {
}
export class MySecondClass<T> {
}
export class MyThirdClass {
constructor(public arg: MyFourthClass<MyFirstClass, MySecondClass<MyFirstClass>>) {
// do nothing here
}
}
export class MyFourthClass<K, V> {
}
I have updated my repo accordingly.
Issue:
When a property has multiple allowable types, the asterisks that are supposed to italicize the property types have a space between the type and the asterisk. For example: * string | boolean *
. When the markdown file is generated, this results in a stray asterisk before the types, and a stray bullet below.
Proposed solution:
When a property can have multiple types, the asterisks should be located immediately next to the types, with no space, like this: *string | boolean*
.
The following sample interface would exhibit this behavior:
export interface ISettings {
aSetting: string | boolean;
}
Which renders the following (broken) markdown:
## Properties
<a id="asetting"></a>
### aSetting
**● aSetting**: * `boolean` | `string`
*
*Defined in [path/to/file](https://path/to/github/file)*
See the following screenshot:
I'm using typedoc-plugin-markdown (version 2.1.1) with typedoc version 0.15.0.
Symbol references (double square brackets) are no longer rendering as links. Is there any information I can provide that can help figure out why this is happening?
Thanks for the great work!
typedoc --module modules --theme markdown --platform vuepress --out docs src
Every time I run the command, the config.js
in folder .vuepress
deleted.
Hi,
I'm not sure if this is related to typedoc-plugin-markdown
or typedoc
. I can't compare output with bare typedoc
, because I cannot see those variables in bare typedoc
.
/** @ignore */
const em = chalk.yellow;
/** @ignore */
const { red, green } = chalk;
did not ignore red
and green
:
• green: Chalk
& object
Defined in messages.ts:20
• red: Chalk
& object
Defined in messages.ts:20
I'm getting this exception when generating documentation with --theme markdown
.
/Users/.../node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19
throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
^
Error: Missing helper: "relativeURL"
at DeclarationReflection.<anonymous> (/Users/.../node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js:19:13)
at eval (eval at createFunctionContext (/Users/.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:8:100)
at Object.prog [as fn] (/Users/.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at DeclarationReflection.ifDisplayIndexItem (/Users/.../node_modules/typedoc-plugin-markdown/dist/theme/helpers/ifDisplayIndexItem.js:10:21)
at eval (eval at createFunctionContext (/Users/.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:116)
at prog (/Users/.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at execIteration (/Users/.../node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)
at ReflectionGroup.<anonymous> (/Users/.../node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)
at eval (eval at createFunctionContext (/Users/.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:8:31)
at Object.prog [as fn] (/Users/.../node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
I'm currently using:
"typescript": "^3.1.3",
"typedoc": "0.13.0",
"typedoc-plugin-markdown": "1.1.17"
Thanks!
Hi,
I cannot create object destructuring object parameters in doc.
(I shortened for example purposes)
/**
* Some desc.
* @param value Indexed value to search for.
* @param key Param description
* @param fromIndex The index etc.
* @returns The first index of the element in the array; -1 if not found.
*/
public getIndex(value: any, { key = this.defaultField, fromIndex = 0 }: { key?: keyof I; fromIndex?: number } = {}): number {
return 1
}
key
and fromIndex
is missing in docs.
Kind Regards,
So far this has been working well for me, with only one exception. This is the command I am running to generate documentation:
typedoc --theme markdown --namedAnchors --platform docusaurus --out ./docs
In Azure DevOps I have a wiki configured to pull markdown files from code (see this description)
The links that are generated in the wiki (which I believe is just exposing the .MD files,) do not work. They appear to be anchors to areas lower in the page but when you click on them nothing happens.
Here is an example of the URL
_wiki/wikis/admin?pagePath=%2Fmodules%2F_admin_&wikiVersion=GBmaster&pageId=27&anchor=const-admin_list_create_fulfilled
I do not see any errors in the console and the links on the main page (Globals) work when linking to the child MD files.
Is there a workaround for this?
class
`
export abstract class DatabaseProviderBase {
private webSQLBase: any;
private base: SQLiteObject;
constructor() {
........
}
/**
* Создание связи с БД и создание необходимых таблиц в БД.
*
* @param {string[]} arrCreateTable
*/
createDB(arrCreateTable: string[], platform, sqlite, ga) {
............
}
/**
* Выполнение запроса к Базе данных
*
* @param {string} sql SQL строка
* @param {any[]} data Данные для запроса
* @returns {Promise<any>}
*/
executeSql(sql: string, data: any[]): Promise<any> {
........
}
/**
* Преобразование ответа от базы в масив нужного типа
*
* @param obj
* @param {{new(l: any): T}} type
* @returns {T[]}
*/
getRowsType<T>(obj: any, type: { new (l: any): T; }): T[] {
.........
}
/**
* преобразование ответа от базы в масив елементов простого типа(number, string и т.д.)
*
* @param obj
* @returns {T[]}
*/
getRowsSimple<T>(obj: any): T[] {
........
}
}
`
generated html
https://yadi.sk/i/E9H3iaRd3SLgJe
generated markdown
https://yadi.sk/i/bnF-xUiS3SLgd6
When using this documentation generator for Bitbucket, it is generating the links, but not the anchor tags for an item that it links to. For example in one of my classes, it's generating the following for the constructor at the top of the file:
* [constructor](handler.md#markdown-header-constructor)
But there is no anchor tag on the actual constructor. The constructor documentation looks like this:
### constructor
\+ **new Handler**(`controller`: `TController`, `event`: `APIGatewayEvent`): *[Handler](handler.md)*
Defined in handlers/base.handler.ts:14
**Parameters:**
Name | Type |
------ | ------ |
`controller` | `TController` |
`event` | `APIGatewayEvent` |
**Returns:** *[Handler](handler.md)*
In order for the link to work in bitbucket, it should look like this:
### <a name="markdown-header-constructor"></a> constructor
I have some scripts that inject @example
tags into my jsdoc with files. Was surprised to find that they get stripped by this plugin:
This seems to be different from a module annotation, where it's instead presented as
**example**
Hello! Very useful plugin!
But i have some problem with use them.
function GenDoc(_path) {
return new Promise((resolve, reject) => {
src([`./${_path}`])
.pipe(
typedoc({
tsconfig: "./tsconfig.json",
out: `./docs/${_path}/`,
readme: `./${_path}/README.md`,
name: `Player ${_path} documentation`,
ignoreCompilerErrors: true,
version: true,
excludePrivate: true,
mode: "file"
})
)
.on("end", () => {
console.log("[GULP Doc been generated]", _path);
resolve();
})
.on("error", (err) => {
reject(err);
})
})
}
I use this for generate doc with multiply readme.md
api-modules
|--->module1->readme.md
|--->module2->readme.md
ui-modules
|--->module1->readme.md
Function GenDoc i call by async await over for iterator
for (let i = pathToModules.length - 1; i >= 0; i--) {
await(function () {
return new Promise(res => {
const _path = pathToModules[i];
GenDoc(_path)
.then(() => {
console.log(`BUILD DOC ${_path} IS DONE!`);
res()
})
.catch((err) => {
reject(err)
})
})
})();
}
Run it by one gulp task.
First module generated with success, but second is fail with Error: Unknown option platform.
After minor debug i found that in typedoc-plugin-markdown\dist\index.js condition app.converter.hasComponent('markdown')
on second iteration return true, and app.options.addDeclaration not call for "platform", "hideSources" and other, but in Option(typedoc\dist\lib\utils\options\option.js) class declarations property not have this value and (typedoc-plugin-markdown\dist\plugin.js) options.getValue('platform') return error.
Its my bad or bug?
I'm trying to generate docs to some TS interfaces but the @param name is removed from the markdown.
Input:
interface TestInterface {
/**
* Description of property a
* @param a - Testing a description
*/
testFunction?: (a: string) => void;
}
Output:
___
### `Optional` testFunction
• **testFunction**? : *function*
Defined in test/src/test.tsx:32
Description of property a
**`param`** Testing a description
#### Type declaration:
▸ (`a`: string): *void*
**Parameters:**
Name | Type |
------ | ------ |
`a` | string |
___
The a
property name that was right after @param
is gone, am I doing something wrong?
It appears this commit broke my build, as yarn will now refuse to install the package on node v6:
855342f
Any reason why node 6 isn't supported anymore? Shouldn't this have been a breaking change, semver-wise?
Hitting the following issue wile trying to run typedoc
node_modules\typedoc\dist\lib\models\reflections\abstract.js:203
let alias = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();
^
TypeError: Cannot read property 'replace' of undefined
Steps to repro
installed typedoc and theis plugin using npm install -g typedoc typedoc-plugin-markdown
now tried to run typedoc with --theme markdown option
/**
* Foo method
* @param bar Some argument with | in description
*/
public foo (bar: number | string): void {
}
Parameter table generated as
| bar | `number` | `string` | Some argument with | in description |
instead of
| bar | `number` \| `string` | Some argument with \| in description |
Escape sequence missing for union types and pipe chars in method description.
Version:
[email protected]
[email protected]
Right now my project awesome-querystring (as well as other projects) gets output to a whole slew of files and folders that are by no means GitHub Wiki compatible which expects all files in the root output folder and especially to not start with a _
as those are not displayed as potential pages.
Example of a GitHub wiki files tree for my discord bot project
So in short some requirements:
-
_
, they are the GitHub proprietary files (like the footer and sidebar)In all honesty the ideal scenario I would want to be able to attain with Typedoc and thus this plugin is something like this markdown. Right now I achieve this through JSDoc but you can probably imagine it would be far more proper to use TypeDoc in a TypeScript based project.
Searches GoogleCommand - Gets information through Google
Note: prioritizes Knowledge Graphs for better searching
Aliases: search
, g
Category: searches
Param | Type | Description |
---|---|---|
SearchQuery | string |
Thing to find on Google |
Example
google Pyrrha Nikos
From these document tags:
/**
* @file Searches GoogleCommand - Gets information through Google
*
* Note: prioritizes Knowledge Graphs for better searching
*
* **Aliases**: `search`, `g`
* @module
* @category searches
* @name google
* @example google Pyrrha Nikos
* @param {string} SearchQuery Thing to find on Google
*/
Hello there, thank you for this plugin. I have run into an issue where optionals of an object type render strangely (missing space between Optional
and the object property. As an example:
Input:
export type SomeOptions = {
aFunction?: () => void
}
Output:
## Type aliases
<a id="someoptions"></a>
### SomeOptions
**Τ SomeOptions**: *object*
#### Type declaration
OptionalaFunction?: `undefined`⎮function
Command run:
typedoc ./src/Class.ts --mdHideSources --out ./docs --options ./config/typedoc.js
Config:
module.exports = {
mode: 'modules',
externalPattern: '**/node_modules/*',
excludeExternals: true,
excludePrivate: true,
readme: 'none',
theme: 'markdown'
}
Im getting a TypeError
when running ./node_modules/.bin/typedoc --theme markdown --out examples/md-doc ./src/reflect/var-name.ts
{
"typedoc": "^0.14.2",
"typedoc-plugin-markdown": "^1.1.21",
"typescript": "^3.2.2"
}
Loaded plugin ./node_modules/typedoc-plugin-markdown
Using TypeScript 3.2.2 from ./node_modules/typescript/lib
./node_modules/typedoc-plugin-markdown/dist/theme/helpers/getParamatersTableHeaders.js:5
const hasDefaultValues = parameters.find((param) => {
^
TypeError: Cannot read property 'find' of undefined
at ParameterReflection.getParametersTableHeaders (./node_modules/typedoc-plugin-markdown/dist/theme/helpers/getParamatersTableHeaders.js:5:40)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:146)
at Object.prog [as fn] (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at ParameterReflection.<anonymous> (./node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:14:32)
at prog (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
at execIteration (./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:51:19)
at SignatureReflection.<anonymous> (./node_modules/handlebars/dist/cjs/handlebars/helpers/each.js:61:13)
at eval (eval at createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:6:31)
at Object.prog [as fn] (./node_modules/handlebars/dist/cjs/handlebars/runtime.js:221:12)
Process finished with exit code 1
var-name.ts
const varExtractor = new RegExp('(return|=>) ([^;]+);?');
export function varName<TResult>(name: () => TResult, opts: {basename: boolean} = { basename: true}) {
const m = varExtractor.exec(name + '');
if (m == null) {
throw new Error("The function does not contain a statement matching 'return variableName;'");
}
return !opts.basename ? m[2] : m[2].split('.').pop() + '';
}
Type of this
is ParameterReflection
in getParamatersTableHeaders
when the error occurs.
jsdoc2md
optionally produce single markdown page from multiple modules/files by concatenating them. Also let developer use a handlebars template for that single page.
This is super useful to generate a README.md file for npm and github from code automatically.
Below is a simplified example handlebars template I use for that purpose:
All those can be achieved programmatically with typedoc-plugin-markdown
too, but it is helpful to have this feature built-in, because npm & github README.md
file generation may be used by lots of people.
EDIT:
Sometimes, especially for small modules, it's enough to have a single README.md file for the whole documentation, and there is no need to have extra web sites/github pages or wiki pages. For example:
# Install
# Synopsis
# Usage
# API
jsdoc2md generated API comes here.
Receive the following error when running with this theme:
Using TypeScript 2.4.1 from C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\node_modules\typescript\lib
C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\dist\lib\models\reflections\abstract.js:173
var alias = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();
^
TypeError: Cannot read property 'replace' of undefined
at ProjectReflection.Reflection.getAlias (C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\dist\lib\models\reflections\abstract.js:173:35)
at Function.DefaultTheme.getUrl (C:\Users\jdimarzio\node_modules\typedoc\dist\lib\output\themes\DefaultTheme.js:196:30)
at Function.DefaultTheme.getUrl (C:\Users\jdimarzio\node_modules\typedoc\dist\lib\output\themes\DefaultTheme.js:199:32)
at Function.MarkdownTheme.buildUrls (C:\Users\jdimarzio\node_modules\typedoc-plugin-markdown\dist\theme\index.js:36:57)
at C:\Users\jdimarzio\node_modules\typedoc-plugin-markdown\dist\theme\index.js:127:31
at Array.forEach ()
at MarkdownTheme.getUrls (C:\Users\jdimarzio\node_modules\typedoc-plugin-markdown\dist\theme\index.js:126:33)
at Renderer.render (C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\dist\lib\output\renderer.js:45:34)
at CliApplication.Application.generateDocs (C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\dist\lib\application.js:100:23)
at CliApplication.bootstrap (C:\Users\jdimarzio\AppData\Roaming\npm\node_modules\typedoc\dist\lib\cli.js:62:26)
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
First off, thanks to everybody collaborating on this TypeDoc theme! It's fantastic! 🎉
I'm using this theme to generate API docs in markdown for https://pdf-lib.js.org/docs/api/. These markdown files are then processed by Docusaurus. This works great, except for one small issue I discovered. I'll illustrate the problem with an example:
Here's a simple function with a single parameter typed as a union:
export function foo(a: string | Uint8Array | ArrayBuffer): void {
console.log(a);
}
And here's how this function's signature is rendered in Docusaurus:
As you can see, the |
separating the members of the union in the parameters table are not being escaped correctly by Docusaurus. This is due to how Docusaurus' markdown engine parses markdown tables:
Instead of escaping the pipe with \|
, we can replace it with |
. Here's what the function's signature looks like when rendered in Docusaurus after this change:
I'll create a PR with this fix shortly.
If you have a function or method with a parameter with multiple types like
function doOtherThings(value: string | number | SubClassA): void {}
the table isn't rendered correct:
Param | Type | Description |
---|---|---|
value | string |
|
number |
||
ElementFinder |
||
A description |
The output is:
| Param | Type | Description |
| ------ | ------ | ------ |
| value | `string` |
`number` |
`ElementFinder`
| A description |
I'm already working on a PR.
i am use typedoc-webpack-plugin like this:
var typeDocPlugin = new TypedocWebpackPlugin(
{
mdPagesSourcePath: './backend/test-page',
/// other settings
}
);
and get this error:
Error: Failed to get page collection. Error: Failed to get pages source path from options. Error: Pages source path must be specified.
It is possible to fix and use plugins together?
I got following error using 2.0.0.
Since error messages does not indicate where the problem is in my source files, I uploaded my project which produces error (it's open source) here: https://we.tl/t-SmU4D0u44Y
.../markdown/dist/theme/helpers/parameter-table.js:26
if (parameter.comment.shortText) {
^
TypeError: Cannot read property 'shortText' of undefined
at .../node_modules/typedoc-plugin-markdown/dist/theme/helpers/parameter-table.js:26:29
at Array.map (<anonymous>)
at Array.parameterTable (.../node_modules/typedoc-plugin-markdown/dist/theme/helpers/parameter-table.js:18:21)
...
After I changed if(parameter.comment.shortText)
and if (parameter.comment.text)
in dist/theme/helpers/parameter-table.js
to if(parameter && parameter.comment.shortText)
and if (parameter && parameter.comment.text)
, I got
.../markdown/dist/theme/helpers/parameter-table.js:26
if (parameter && parameter.comment.shortText) {
^
TypeError: Cannot read property 'shortText' of undefined
at .../node_modules/typedoc-plugin-markdown/dist/theme/helpers/parameter-table.js:26:42
at Array.map (<anonymous>)
at Array.parameterTable (.../node_modules/typedoc-plugin-markdown/dist/theme/helpers/parameter-table.js:18:21)
at eval (eval at createFunctionContext (.../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:257:23), <anonymous>:6:197)
I'm generating my readme files using typedoc-plugin-markdown
, but it always strips whitespace from my example annotations making them look bad. Is there a way to fix this?
Hello,
There seems a bug when this plugin handles generic types such as MyClass<T>
.
I have created a repository for your reference here.
Code:
export class MyFirstClass {
}
export class MySecondClass<T> {
}
export class MyThirdClass {
constructor(public arg: Array<MySecondClass<MyFirstClass>>) {
// do nothing here
}
}
md
file generated (or you can see it here):
You can see that type of arg
is rendered incorrectly.
Here's the html result by typedoc
without plugin:
It seems that this should be the correct result.
Thanks,
KidyovrS
This only happens with --mdEngine gitbook
.
Source:
export interface IMyInterface {
}
export const MyVariable: string = "HelloWorld";
Actual:
# Variables
<a id="myvariable"></a>
## `<Const>` MyVariable
**● MyVariable**: *`string`* = "HelloWorld"
___
Expected:
# Index
### Interfaces
* [IMyInterface](../interfaces/_index_.imyinterface.md)
### Variables
* [MyVariable](_index_.md#myvariable)
---
# Variables
<a id="myvariable"></a>
## `<Const>` MyVariable
**● MyVariable**: *`string`* = "HelloWorld"
___
It's fine to hide index if the module only contains variables/functions, since they're directly documented in the module page. However I suppose interfaces should be treated the same as classes and enums.
Hello, I'm trying to put together a basic example using the docusaurus workflow.
But something's not working with the typedoc MD generation, I get an index.md created, but no classes/enums/interfaces, and it doesn't seem to integrate properly with sidebars.json
what gets added to sidebars.json is:
"undefined": {
"Introduction": [
"index"
],
"External Modules": [
"",
"",
"",
"",
"",
""
]
}
and I'm not sure where the problem would be, maybe one of the following?:
So, having a basic example that I can get working and then customize seems neccesary. My example is pretty basic so far. I can post the code if needed, but probably quicker if a reference example can be created.
You're quick. Almost there. :-)
Error: ENOENT: no such file or directory, open 'C:\path\to\node_modules\typedoc-plugin-markdown\dist\theme\partials\member.objectliteral.hbs'
at Error (native)
at Object.fs.openSync (fs.js:640:18)
at Object.fs.readFileSync (fs.js:508:33)
at templateToString (C:\path\to\node_modules\typedoc-plugin-markdown\dist\theme\utils.js:13:15)
at Object.compileTemplate (C:\path\to\node_modules\typedoc-plugin-markdown\dist\theme\utils.js:7:18)
at DeclarationReflection.compileMember (C:\path\to\node_modules\typedoc-plugin-markdown\dist\theme\helpers\compileMember.js:15:26)
at eval (eval at createFunctionContext (C:\path\to\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), <anonymous>:5:106)
at Object.prog [as inverse] (C:\path\to\node_modules\handlebars\dist\cjs\handlebars\runtime.js:221:12)
at DeclarationReflection.<anonymous> (C:\path\to\node_modules\handlebars\dist\cjs\handlebars\helpers\if.js:17:22)
at DeclarationReflection.<anonymous> (C:\path\to\node_modules\handlebars\dist\cjs\handlebars\helpers\if.js:24:35)
Updating typedoc to 0.14.0 cause following error with this plugin. That's probably connected to typescript upgrade.
TypeError: Class constructor ConverterComponent cannot be invoked without 'new'
at new MarkdownPlugin (/home/user/something/node_modules/typedoc-plugin-markdown/dist/plugin.js:31:42)
at Converter.addComponent (/home/user/something/node_modules/typedoc/dist/lib/utils/component.js:123:19)
at Converter.addComponent (/home/user/something/node_modules/typedoc/dist/lib/converter/converter.js:28:33)
at module.exports (/home/user/something/node_modules/typedoc-plugin-markdown/dist/index.js:36:19)
Hi there,
I wanted to use this to generate a documented README in my repo
I ran
typedoc --theme markdown --out .
This actually blew away the whole directory which was kind of surprising
Currently, if a function accept named parameters, the documentation that is generated does include any documentation the named parameters like how it is with the default theme. Would be nice to include documentation of those parameters as well.
Hi,
If node module name contains username such as @someuser/module-name
, vuepress
and docusaurus
(maybe others too) generated index.md
and README.md
meta-data causes YAML parser to throw error when used with vuepress
.
---
id: README
title: @someuser/module-name
sidebar_label: Globals
---
## Variables
YAMLException: end of the stream or a document separator is expected at line 2, column 8:
title: @someuser/module-name
^
at generateError (.../node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
at throwError (.../node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
at readDocument (.../node_modules/js-yaml/lib/js-yaml/loader.js:1539:5)
Kind regards,
If all things (functions, classes, interfaces, enums, variables, etc.) are marked hidden using
/**
* @hidden
*/
in a module, then error would be thrown:
C:\workdir\typedoc-markdown-sample>node_modules\.bin\typedoc --theme markdown --out out_markdown
Loaded plugin typedoc-plugin-markdown
Using TypeScript 2.7.2 from C:\workdir\typedoc-markdown-sample\node_modules\typescript\lib
C:\workdir\typedoc-markdown-sample\node_modules\typedoc-plugin-markdown\dist\theme\helpers\ifDisplayIndex.js:8
var classModule = member.children ? member.children[0].kind === index_1.ReflectionKind.Class : false;
^
TypeError: Cannot read property 'kind' of undefined
at DeclarationReflection.ifDisplayIndex (C:\workdir\typedoc-markdown-sample\node_modules\typedoc-plugin-markdown\dist\theme\helpers\ifDisplayIndex.js:8:60)
at eval (eval at createFunctionContext (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), <anonymous>:5:108)
at prog (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\runtime.js:221:12)
at PageEvent.<anonymous> (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\helpers\with.js:22:14)
at Object.eval [as main] (eval at createFunctionContext (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\compiler\javascript-compiler.js:254:23), <anonymous>:17:34)
at main (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\runtime.js:175:32)
at PageEvent.ret (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\runtime.js:178:12)
at PageEvent.ret [as template] (C:\workdir\typedoc-markdown-sample\node_modules\handlebars\dist\cjs\handlebars\compiler\compiler.js:526:21)
at Renderer.renderDocument (C:\workdir\typedoc-markdown-sample\node_modules\typedoc\dist\lib\output\renderer.js:65:30)
at C:\workdir\typedoc-markdown-sample\node_modules\typedoc\dist\lib\output\renderer.js:53:23
Guess member.children
is an empty array here.
I'm not sure whether this is a bug with typedoc or this plugin.
const app = new typedoc.Application({ ... });
app.generateDocs(src, out);
// TypeDoc will print a stack trace saying that the plugin is already loaded
app.generateDocs(src2, out2);
console.log(app.hasErrors()); // true
The same thing happens when using two application instances.
Using app.converter.hasComponent('markdown')
to check for this may be a fix.
Can we remove the link to readme.md on top of the file trought and option like --hideReadme, something like that?
/**
* Some deprecation
* @deprecated
* ```typescript
* somethingElse();
* ```
*/
export function foo () : void {
}
is generated as
Some deprecation
*__deprecated__*: ```typescript
somethingElse();
```
**Returns:** `void`
and rendered as
Some deprecation
deprecated: ```typescript
somethingElse();
**Returns:** `void`
Instead a line break must be inserted before code block:
Some deprecation
*__deprecated__*:
```typescript
somethingElse();
```
**Returns:** `void`
to render correctly as
Some deprecation
deprecated:
somethingElse();
void
/**
* bar method.
*
* Doc outside tag
* - Line 1 [[Option]]
* - Line 2 [[Option]]
*
* @returns Doc inside tag
* - Line 1 [[Option]]
* - Line 2 [[Option]]
*/
function bar (o: Option): void {
}
/** Option for bar() */
type Option = 'One' | 'Two';
[[Option]] links within the returns tag are left unparsed.
Version: 0.14.2
Hi,
After I updated to latest version
/src/lib/theme/helpers/metadata.ts
line 13
const md = `---
id: ${getId(this)}
title: ${getReflectionTitle(this)}
sidebar_label: ${getLabel(this)}
---\n`;
produces below meta data part, which is invalid because of title: Class: DataFile
---
id: datafile
title: Class: DataFile
sidebar_label: DataFile
---
Kind regards,
Thanks for a great plugin!
However, I get TypeError: Cannot read property 'extendedTypes' of undefined
in dist/theme/helpers/hierachySymbol.js:5:29
with 0.0.12-2
. Works fine with 0.0.11-0
.
Hey guys!
This repo is awesome! :)
Have one question about generating README for f.e. github with your plugin...
I have README file in the project root, and when i generate docs via typedoc it generates new README which contains data from root's README (which is fine), and api docs (which is also fine). But github takes that readme from root as main by default, so there is no point to keep updated README in docs...
Question is - can i just generate api docs and then manually add link to my root README (this is a preferable variant) OR somehow generate final README (api + manual docs) for github ?
Hello, cool project! I'm super glad this is happening :)
I gave it a try and the first thing I want to do is exclude some stuff
https://github.com/TypeStrong/typedoc#source-file-handling
--excludeExternals
Prevent externally resolved TypeScript files from being documented.
--excludePrivate
Prevent private members from being included in the generated documentation.
Do the main options get passed to the markdown plugin?
Wonderful plugin that has finally gotten me to start using typedoc
-- thanks!
I am having an issue where it does not appear to render [[DoubleBracket]]
in typedoc comments as links to the contained symbol. The typedoc doccomments specify ...
Additionally you can link to other classes, members or functions using double square brackets.
... and this works in my project if I render to the default template. However the markdown
template renders it as plain text.
If you would like a reproducible example, I'd be happy to provide.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.