Typedoc include不起作用

时间:2018-08-07 10:28:48

标签: typescript typedoc

我正在尝试使用typedoc include,所以这是我的操作方式。

// ./src/store/index.ts

/**
 * [[include:TypeScriptReactReduxTutorial.md]]
 */

import { combineReducers } from 'redux'

import { counterReducer } from './counter/reducer'

import { IApplicationState } from './types'

/**
 *  Whenever an action is dispatched, Redux will update each top-level application state property
 * using the reducer with the matching name. It's important that the names match exactly, and that
 * the reducer acts on the corresponding IApplicationState property type.
 */
export const rootReducer = combineReducers<IApplicationState>({
  counter: counterReducer
})

然后像这样运行typedoc

"create-docs": "typedoc --out ./doc/ ./src --externalPattern '**/node_modules/**' --ignoreCompilerErrors --includes 'mdDocs/'"

但是在文档中,仅添加了Defined in store/rootReducer.ts:18这样的行,而我的markdown文件中没有内容。我在这里想念什么?

1 个答案:

答案 0 :(得分:0)

我不确定这是否一直有效。 这对我有用。

https://typedoc.org/api/

我正在使用TypeDoc 0.14.2

这是我的命令行

typedoc --out docs ./src --includes ./doc

这是我的评论示例

/**
 * Process contents and returns a the processed contents.
 * <div>&nbsp;</div>
 * <strong>See:</strong> {@link BuildProcess.buildInclude}
 * @param contents The contents of the file currently being read
 * @param srcpath The source path of the file that contents were read from
 * @param destpath The destination file that the contents are to be written into.
 * @returns The contents of the file after they have been processed.
 * [[include:usercase.md]]
 */

更新1

还可以包括目录,然后包括子目录中的损坏文件。例如,我的doc目录包含一个名为javascript_string的目录。

typedoc --out docs ./src --includes ./doc

评论

/**
 * Process contents and returns a the processed contents.
 * <div>&nbsp;</div>
 * <strong>See:</strong> [[BuildProcess.buildInclude]]
 * @param contents The contents of the file currently being read
 * @param srcpath The source path of the file that contents were read from
 * @param destpath The destination file that the contents are to be written into.
 * @return The contents of the file after they have been processed.
 * [[include:javascript_string/usercase.md]]
 */