forked from jsdoc/jsdoc.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabout-including-package.html
64 lines (61 loc) · 3.06 KB
/
about-including-package.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<!-- THIS IS A GENERATED FILE. DO NOT EDIT. -->
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="How to show package details in your documentation.">
<title>Use JSDoc: Including a Package File</title>
<link rel="stylesheet" href="styles/usejsdoc.css">
<link rel="stylesheet" href="styles/prettify.css">
<link rel="stylesheet" href="styles/css3-github-ribbon.css">
<script src="scripts/prettify.js"></script>
</head>
<body>
<header>
<a href="./index.html">@use JSDoc</a>
</header>
<article>
<h1>Including a Package File</h1>
<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 use information from your project's
<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>
<p>There are two ways to incorporate a <code>package.json</code> file into your documentation:</p>
<ol>
<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 that it finds in your source paths.</li>
<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 3.3.0 and later.</li>
</ol>
<p>The <code>-P/--package</code> command-line option takes precedence over your source paths. If you use the
<code>-P/--package</code> command-line option, JSDoc will ignore any <code>package.json</code> files in your source paths.</p>
<p>The <code>package.json</code> file must use <a href="https://docs.npmjs.com/files/package.json">npm's package format</a>.</p>
<h2 id="examples">Examples</h2>
<figure>
<figcaption>Including a package file in your source paths</figcaption>
<pre class="prettyprint"><code>jsdoc path/to/js path/to/package/package.json
</code></pre>
</figure>
<figure>
<figcaption>Using the -P/--package option</figcaption>
<pre class="prettyprint"><code>jsdoc --package path/to/package/package-docs.json path/to/js
</code></pre>
</figure>
</article>
<footer>
<a class="license-badge" href="http://creativecommons.org/licenses/by-sa/3.0/">
<img alt="Creative Commons License" class="license-badge" src="images/cc-by-sa.svg" width="80" height="15" /></a>
<br>
Copyright © 2011-2017 the
<a href="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the
JSDoc 3 documentation project.
<br>
This website is <a href="https://github.com/jsdoc3/jsdoc3.github.com">open source</a> and is
licensed under the <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/">
Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.
</footer>
<script type="text/javascript">
prettyPrint();
</script>
</body>
</html>