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
<ahref="#copying-static-files-to-the-output-directory">Copying static files to the output directory</a>
32
+
</li>
33
+
<li>
34
+
<ahref="#showing-the-current-date-in-the-page-footer">Showing the current date in the page footer</a>
35
+
</li>
36
+
<li>
37
+
<ahref="#overriding-the-default-template-s-layout-file">Overriding the default template's layout file</a>
38
+
</li>
39
+
<li>
40
+
<ahref="#related-links">Related Links</a>
41
+
</li>
42
+
</ul>
43
+
<p>JSDoc's default template provides several options that you can use to customize the appearance and content of generated documentation.</p>
44
+
<p>To use these options, you must <ahref="about-configuring-jsdoc.html">create a configuration file</a> for JSDoc and set the appropriate options in the configuration
<p>By default, JSDoc's default template generates pretty-printed versions of your source files. It also links to these pretty-printed files in the documentation.</p>
48
+
<p>To disable pretty-printed files, set the option <code>templates.default.outputSourceFiles</code> to <code>false</code>. Using this option also removes links
49
+
to your source files from the documentation. This option is available in JSDoc 3.3.0 and later.</p>
50
+
<h2id="copying-static-files-to-the-output-directory">Copying static files to the output directory</h2>
51
+
<p>JSDoc's default template automatically copies a few static files, such as CSS stylesheets, to the output directory. In JSDoc 3.3.0 and later, you can tell
52
+
the default template to copy additional static files to the output directory. For example, you might want to copy a directory of images to the output directory
53
+
so you can display these images in your documentation.</p>
54
+
<p>To copy additional static files to the output directory, use the following options:</p>
55
+
<ul>
56
+
<li><code>templates.default.staticFiles.include</code>: An array of paths whose contents should be copied to the output directory. Subdirectories will be copied
57
+
as well.</li>
58
+
<li><code>templates.default.staticFiles.exclude</code>: An array of paths that should <em>not</em> be copied to the output directory.</li>
59
+
<li><code>templates.default.staticFiles.includePattern</code>: A regular expression indicating which files to copy. If this property is not defined, all files
60
+
will be copied.</li>
61
+
<li><code>templates.default.staticFiles.excludePattern</code>: A regular expression indicating which files to skip. If this property is not defined, nothing will
62
+
be skipped.</li>
63
+
</ul>
64
+
<figure>
65
+
<figcaption>Copying a directory of images to the output directory</figcaption>
66
+
<p>To copy all of the static files in <code>./myproject/static</code> to the output directory:</p>
67
+
<preclass="prettyprint lang-json"><code>{
68
+
"templates": {
69
+
"default": {
70
+
"staticFiles": {
71
+
"include": [
72
+
"./myproject/static"
73
+
]
74
+
}
75
+
}
76
+
}
77
+
}
78
+
</code></pre>
79
+
<p>If your static files directory contains the file <code>./myproject/static/img/screen.png</code>, you can display the image in your docs by using the HTML tag
<h2id="showing-the-current-date-in-the-page-footer">Showing the current date in the page footer</h2>
83
+
<p>By default, JSDoc's default template always shows the current date in the footer of the generated documentation. In JSDoc 3.3.0 and later, you can omit the
84
+
current date by setting the option
85
+
<code>templates.default.includeDate</code> to <code>false</code>.</p>
86
+
<h2id="overriding-the-default-template-s-layout-file">Overriding the default template's layout file</h2>
87
+
<p>The default template uses a file named <code>layout.tmpl</code> to specify the header and footer for each page in the generated documentation. In particular,
88
+
this file defines which CSS and JavaScript files are loaded for each page. In JSDoc 3.3.0 and later, you can specify your own <code>layout.tmpl</code> file
89
+
to use, which allows you to load your own custom CSS and JavaScript files in addition to, or instead of, the standard files.</p>
90
+
<p>To use this feature, set the option <code>templates.default.layoutFile</code> to the path to your customized layout file. Relative paths are resolved against
91
+
the path to the <code>config.json</code> file; the current working directory; and the JSDoc directory, in that order.</p>
92
+
<h2id="related-links">Related Links</h2>
93
+
<p>
94
+
<ahref="about-configuring-jsdoc.html">Configuring JSDoc with conf.json</a>
<ahref="https://github.com/jsdoc3/jsdoc3.github.com/contributors">contributors</a> to the JSDoc 3 documentation project.
103
+
<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>The options in <code>templates</code> affect how JSDoc's output looks (although custom templates may not be affected by these, depending on how they are
199
-
coded).</p>
198
+
<p>The options in <code>templates</code> affect the appearance and content of generated documentation. Custom templates may not implement all of these options.
199
+
See <ahref="about-configuring-default-template.html">Configuring JSDoc's Default
200
+
Template</a> for additional options that the default template supports.</p>
0 commit comments