<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="jemdoc-rs, see https://github.com/haozhu10015/jemdoc-rs" />
<link rel="stylesheet" href="jemdoc.css" type="text/css" />
<title>Header Directives and Configuration</title>
<script>
MathJax = {
tex: {
inlineMath: [['\\(','\\)']],
displayMath: [['\\[','\\]']],
tags: 'ams'
}
};
</script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js">
</script>
</head>
<link rel="icon" href="img/favicon-jr.svg" type="image/svg+xml" />
<body>
<table summary="Table for page layout." id="tlayout">
<tr valign="top">
<td id="layout-menu">
<div class="menu-category">jemdoc-rs</div>
<div class="menu-item"><a href="index.html">Overview</a></div>
<div class="menu-category">Markup</div>
<div class="menu-item"><a href="formatting.html">Formatting</a></div>
<div class="menu-item"><a href="lists.html">Lists</a></div>
<div class="menu-item"><a href="link.html">Links</a></div>
<div class="menu-item"><a href="images.html">Images</a></div>
<div class="menu-item"><a href="mathjax.html">Equations</a></div>
<div class="menu-category">Blocks</div>
<div class="menu-item"><a href="codeblocks.html">Code Blocks</a></div>
<div class="menu-item"><a href="tables.html">Tables</a></div>
<div class="menu-item"><a href="infoblocks.html">Info Blocks</a></div>
<div class="menu-category">Configuration</div>
<div class="menu-item"><a href="directives.html" class="current">Directives</a></div>
<div class="menu-item"><a href="http://www.example.com" target="_blank">Open in New Tab</a></div>
</td>
<td id="layout-content">
<div id="toptitle">
<h1>Header Directives and Configuration</h1>
</div>
<h2>Header Directives</h2>
<p>Directives are placed at the top of a <tt>.jemdoc</tt> file as special comments. They control page-level settings.
</p>
<div class="codeblock">
<div class="blockcontent"><tt class="tthl">
</tt><pre class="tthl"># jemdoc: menu{MENU}{thispage.html}
</pre><tt class="tthl"></tt><pre class="tthl"># jemdoc: addcss{custom.css}
</pre><tt class="tthl"></tt><pre class="tthl"># jemdoc: title{Custom Window Title}
</pre><tt class="tthl"></tt></div></div>
<h3>Available Directives</h3>
<table id="directives-table">
<tr class="r1"><td class="c1">Directive </td><td class="c2"> Description </td></tr>
<tr class="r2"><td class="c1"><tt>menu{FILE}{current.html}{prefix}</tt> </td><td class="c2"> Add a navigation menu (prefix is optional) </td></tr>
<tr class="r3"><td class="c1"><tt>addcss{file.css}</tt> </td><td class="c2"> Include an additional CSS file </td></tr>
<tr class="r4"><td class="c1"><tt>addjs{file}</tt> </td><td class="c2"> Include an additional JavaScript file </td></tr>
<tr class="r5"><td class="c1"><tt>analytics{G-XXXXXXXXXX}</tt> </td><td class="c2"> Add Google Analytics 4 tracking </td></tr>
<tr class="r6"><td class="c1"><tt>title{Window Title}</tt> </td><td class="c2"> Override the browser window title </td></tr>
<tr class="r7"><td class="c1"><tt>nodefaultcss</tt> </td><td class="c2"> Don't include the default CSS </td></tr>
<tr class="r8"><td class="c1"><tt>nofooter</tt> </td><td class="c2"> Hide the page footer </td></tr>
<tr class="r9"><td class="c1"><tt>nodate</tt> </td><td class="c2"> Hide the “last updated” date </td></tr>
<tr class="r10"><td class="c1"><tt>notime</tt> </td><td class="c2"> Show date only (no time) in the footer </td></tr>
<tr class="r11"><td class="c1"><tt>noeqs</tt> </td><td class="c2"> Disable equation processing and MathJax loading </td></tr>
<tr class="r12"><td class="c1"><tt>fwtitle</tt> </td><td class="c2"> Use full-width title (spans above the menu) </td></tr>
<tr class="r13"><td class="c1"><tt>showsource</tt> </td><td class="c2"> Add a link to the <tt>.jemdoc</tt> source in the footer
</td></tr></table>
<p>Multiple directives can go on a single line, separated by commas:
</p>
<div class="codeblock">
<div class="blockcontent"><tt class="tthl">
</tt><pre class="tthl"># jemdoc: menu{MENU}{page.html}, analytics{G-XXXXXXXXXX}, showsource
</pre><tt class="tthl"></tt></div></div>
<h2>Menu Files</h2>
<p>A <tt>MENU</tt> file defines the navigation sidebar. Non-indented lines are category headers; indented lines with <tt>[link]</tt> are menu items. See the <tt>MENU</tt> file used by this example site.
</p>
<ul>
<li><p>The <i>current page</i> is automatically highlighted based on the second argument of the <tt>menu</tt> directive.
</p>
</li>
<li><p>Prefix a link with <tt>\</tt> to open it in a new tab (useful for external links).
</p>
</li>
<li><p>Menu items open in the <i>same tab</i> by default (unlike text links, which open in a new tab).
</p>
</li>
</ul>
<h3>Subfolder Pages</h3>
<p>For pages in subdirectories, use the third <tt>prefix</tt> argument:
</p>
<div class="codeblock">
<div class="blockcontent"><tt class="tthl">
</tt><pre class="tthl"># jemdoc: menu{MENU}{}{../}
</pre><tt class="tthl"></tt></div></div>
<p>This prepends <tt>../</tt> to each menu link, so they resolve correctly from the subfolder.
</p>
<h2>Configuration Files</h2>
<p>jemdoc-rs uses a default HTML template that can be partially or fully overridden. Run <tt>jemdoc-rs --show-config</tt> to see all configurable sections.
</p>
<h3>Example Configuration</h3>
<div class="codeblock">
<div class="blocktitle">mysite.conf</div>
<div class="blockcontent"><pre>
<span class="comment"># Override the body start to add a favicon</span>
[bodystart]
</head>
<link rel="icon" href="img/icon.png" type="image/x-icon" />
<body>
<span class="comment"># Override the default CSS path</span>
[defaultcss]
<link rel="stylesheet" href="/css/jemdoc.css" type="text/css" />
</pre></div></div>
<p>Apply with <tt>-c</tt>:
</p>
<div class="codeblock">
<div class="blockcontent"><pre>
jemdoc-rs -c mysite.conf *.jemdoc
</pre></div></div>
<p>Multiple <tt>-c</tt> flags can be used; later files take precedence.
</p>
<h2>This Page</h2>
<p>This page uses <tt>showsource</tt> — check the footer for a link to its <tt>.jemdoc</tt> source.
</p>
<div id="footer">
<div id="footer-text">
Page generated by <a href="https://github.com/haozhu10015/jemdoc-rs" target="_blank">jemdoc-rs</a>.
(<a href="directives.jemdoc">source</a>)
</div>
</div>
</td>
</tr>
</table>
</body>
</html>