You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Package files contain information that can be useful for your project's documentation, such as the project's name and version number. JSDoc can automatically
26
+
use information from your project's
27
+
<code>package.json</code> file when it generates documentation. For example, the default template shows the project's name and version number in the documentation.</p>
28
+
<p>There are two ways to incorporate a <code>package.json</code> file into your documentation:</p>
29
+
<ol>
30
+
<li>In the source paths to your JavaScript files, include the path to a <code>package.json</code> file. JSDoc will use the first <code>package.json</code> file
31
+
that it finds in your source paths.</li>
32
+
<li>Run JSDoc with the <code>-P/--package</code> command-line option, specifying the path to your <code>package.json</code> file. This option is available in JSDoc
33
+
3.3.0 and later.</li>
34
+
</ol>
35
+
<p>The <code>-P/--package</code> command-line option takes precedence over your source paths. If you use the
36
+
<code>-P/--package</code> command-line option, JSDoc will ignore any <code>package.json</code> files in your source paths.</p>
37
+
<p>The <code>package.json</code> file must use <ahref="https://docs.npmjs.com/files/package.json">npm's package format</a>.</p>
38
+
<h2id="examples">Examples</h2>
39
+
<figure>
40
+
<figcaption>Including a package file in your source paths</figcaption><preclass="prettyprint"><code>jsdoc path/to/js path/to/package/package.json
41
+
</code></pre>
42
+
</figure>
43
+
<figure>
44
+
<figcaption>Using the -P/--package option</figcaption><preclass="prettyprint"><code>jsdoc --package path/to/package/package-docs.json path/to/js
<ahref="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project.
54
+
<br> This website is <ahref="https://github.com/jsdoc3/jsdoc3.github.com">open source</a> and is licensed under the <arel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
<p>To include a readme file in your documentation, you simply specify the location of your readme file on the command line along with the location of your source
26
-
files. The readme file will be incorporated into the index.html of your documentation in the default template. The file must be written in markdown and given
27
-
a .md extension.</p>
24
+
<h1>Including a README File</h1>
25
+
<p>There are two ways to incorporate a <code>README</code> file into your documentation:</p>
26
+
<ol>
27
+
<li>In the source paths to your JavaScript files, include the path to a Markdown file named
28
+
<code>README.md</code>. JSDoc will use the first <code>README.md</code> file that it finds in your source paths.</li>
29
+
<li>Run JSDoc with the <code>-R/--readme</code> command-line option, specifying the path to your <code>README</code> file. This option is available in JSDoc 3.3.0
30
+
and later. The <code>README</code> file may have any name and extension, but it must be in Markdown format.</li>
31
+
</ol>
32
+
<p>The <code>-R/--readme</code> command-line option takes precedence over your source paths. If you use the
33
+
<code>-R/--readme</code> command-line option, JSDoc will ignore any <code>README.md</code> files in your source paths.</p>
34
+
<p>If you are using JSDoc's default template, the <code>README</code> file's contents will be rendered in HTML in the generated documentation's <code>index.html</code> file.</p>
35
+
<h2id="examples">Examples</h2>
28
36
<figure>
29
-
<figcaption>Including a readme file in your documentation</figcaption><preclass="prettyprint"><code>jsdoc C:\path\to\my\JS\project\sourceFiles C:\path\to\my\JS\project\README.md
37
+
<figcaption>Including a README file in your source paths</figcaption><preclass="prettyprint"><code>jsdoc path/to/js path/to/readme/README.md
38
+
</code></pre>
39
+
</figure>
40
+
<figure>
41
+
<figcaption>Using the -R/--readme option</figcaption><preclass="prettyprint"><code>jsdoc --readme path/to/readme/README path/to/js
30
42
</code></pre>
31
43
</figure>
32
-
<p>If your file is successfully incorporated into the default template, it's content will be rendered in beautiful HTML just before the files list.</p>
description: A guide to including a readme file in your documentation.
2
+
title: Including a README File
3
+
description: How to include a README file in your documentation.
4
4
---
5
5
6
-
To include a readme file in your documentation, you simply specify the location of your readme file on the command line along with the location of your source files. The readme file will be incorporated into the index.html of your documentation in the default template. The file must be written in markdown and given a .md extension.
6
+
There are two ways to incorporate a `README`file into your documentation:
7
7
8
-
{% example "Including a readme file in your documentation" %}
8
+
1. In the source paths to your JavaScript files, include the path to a Markdown file named
9
+
`README.md`. JSDoc will use the first `README.md` file that it finds in your source paths.
10
+
2. Run JSDoc with the `-R/--readme` command-line option, specifying the path to your `README` file.
11
+
This option is available in JSDoc 3.3.0 and later. The `README` file may have any name and
12
+
extension, but it must be in Markdown format.
13
+
14
+
The `-R/--readme` command-line option takes precedence over your source paths. If you use the
15
+
`-R/--readme` command-line option, JSDoc will ignore any `README.md` files in your source paths.
16
+
17
+
If you are using JSDoc's default template, the `README` file's contents will be rendered in HTML
18
+
in the generated documentation's `index.html` file.
19
+
20
+
21
+
## Examples
22
+
23
+
{% example "Including a README file in your source paths" %}
0 commit comments