包括自述文件
将 README 文件纳入你的文档有两种方法:
🌐 There are two ways to incorporate a README file into your documentation:
- 在指向你的 JavaScript 文件的源路径中,包含一个名为
README.md的 Markdown 文件的路径。JSDoc 将使用它在你的源路径中找到的第一个README.md文件。 - 使用
-R/--readme命令行选项运行 JSDoc,并指定README文件的路径。此选项在 JSDoc 3.3.0 及更高版本中可用。README文件可以有任意名称和扩展名,但必须是 Markdown 格式。
-R/--readme 命令行选项优先于你的源路径。如果你使用 -R/--readme 命令行选项,JSDoc 将会忽略源路径中的任何 README.md 文件。
🌐 The -R/--readme command-line option takes precedence over your source paths. If you use the
-R/--readme command-line option, JSDoc will ignore any README.md files in your source paths.
如果你使用 JSDoc 的默认模板,README 文件的内容将在生成的文档的 index.html 文件中以 HTML 形式呈现。
🌐 If you are using JSDoc's default template, the README file's contents will be rendered in HTML
in the generated documentation's index.html file.
示例
🌐 Examples
jsdoc path/to/js path/to/readme/README.md
jsdoc --readme path/to/readme/README path/to/js