|
- <!DOCTYPE html>
- <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
- <!--[if gt IE 8]><!-->
- <html class="no-js" lang="en">
- <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Site configuration with the docnet.json file - DocNet Documentation</title>
- <link rel="shortcut icon" href="favicon.ico">
- <link rel="stylesheet" href="css/theme.css" type="text/css" />
- <link rel="stylesheet" href="css/theme_colors.css" type="text/css" />
- <link rel="stylesheet" href="css/styles/vs.css">
- <link rel="stylesheet" href="css/font-awesome.4.5.0.min.css">
- </head>
- <body role="document">
- <div class="grid-for-nav">
- <nav data-toggle="nav-shift" class="nav-side stickynav">
- <div class="side-nav-search">
- <a href="index.htm"><i class="fa fa-home"></i> DocNet Documentation</a>
- <div role="search">
- <form id="search-form" class="form" action="Docnet_search.htm" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- </form>
- </div>
- </div>
- <div class="menu menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
- <ul>
- <li class="tocentry"><a href="index.htm">Home</a>
- </li>
-
- <li class="tocentry"><a href="usage.htm">Usage</a>
- </li>
- <li class="tocentry">
- <ul>
- <li><span class="navigationgroup"><i class="fa fa-caret-down"></i> <a href="Configuration.htm">Configuration</a></span></li>
- <li class="tocentry current"><a class="current" href="docnetjson.htm">Site configuration with the docnet.json file</a>
- <ul class="currentrelative">
- <li class="tocentry"><a href="#name">Name</a></li>
-
- <li class="tocentry"><a href="#source">Source</a></li>
-
- <li class="tocentry"><a href="#destination">Destination</a></li>
-
- <li class="tocentry"><a href="#includesource">IncludeSource</a></li>
-
- <li class="tocentry"><a href="#theme">Theme</a></li>
-
- <li class="tocentry"><a href="#sourcefolderstocopy">SourceFoldersToCopy</a></li>
-
- <li class="tocentry"><a href="#convertlocallinks">ConvertLocalLinks</a></li>
-
- <li class="tocentry"><a href="#pathspecification">PathSpecification</a></li>
-
- <li class="tocentry"><a href="#urlformatting">UrlFormatting</a></li>
-
- <li class="tocentry"><a href="#maxlevelintoc">MaxLevelInToC</a></li>
-
- <li class="tocentry"><a href="#stripindexhtm">StripIndexHtm</a></li>
-
- <li class="tocentry"><a href="#footer">Footer</a></li>
-
- <li class="tocentry"><a href="#startingpagename">StartingPageName</a></li>
-
- <li class="tocentry"><a href="#pages">Pages</a></li>
-
- <li class="tocentry"><a href="#levels-without-index-defined">Levels without __index defined</a></li>
-
- <li class="tocentry"><a href="#use-of-wildcard-inclusions">Use of wildcard inclusions</a></li>
-
-
-
- </ul>
- <li class="tocentry"><a href="h2leveldiscovery.htm">Automatic H2 level ToC entry discovery</a>
- </li>
- <li class="tocentry"><a href="notfound.htm">Not found (404) page</a>
- </li>
-
- </ul>
- </li>
- <li class="tocentry">
- <span class="navigationgroup"><i class="fa fa-caret-right"></i> <a href="Authoringcontent.htm">Authoring content</a></span>
- </li>
- <li class="tocentry"><a href="search.htm">Search</a>
- </li>
- <li class="tocentry"><a href="acknowledgements.htm">Acknowledgements</a>
- </li>
- <li class="tocentry"><a href="license.htm">License</a>
- </li>
- </ul>
- <div class="toc-footer">
- <span class="text-small">
- <hr/>
- <a href="https://github.com/FransBouma/DocNet" target="_blank">Made with <i class="fa fa-github"></i> DocNet</a>
- </span>
- </div>
- </div>
-
- </nav>
- <section data-toggle="nav-shift" class="nav-content-wrap">
- <nav class="nav-top" role="navigation" aria-label="top navigation">
- <i data-toggle="nav-top" class="fa fa-bars"></i>
- <a href="index.htm">DocNet Documentation</a>
- </nav>
- <div class="nav-content">
- <div role="navigation" aria-label="breadcrumbs navigation">
- <div class="breadcrumbs">
- <ul><li><a href="index.htm">Home</a></li> / <li><a href="Configuration.htm">Configuration</a></li> / <li><a href="docnetjson.htm">Site configuration with the docnet.json file</a></li></ul>
-
- </div>
- <hr />
- </div>
- <div role="main">
- <div class="section">
- <h1 id="the-configuration-file-docnet.json">The configuration file: 'docnet.json'<a class="headerlink" href="#the-configuration-file-docnet.json" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h1>
- <p>DocNet uses a json file to determine what to do in what form. The format is straight forward and described below</p>
- <pre><code class="json">{
- "Name" : "name of site",
- "Source" : "sourcefolder",
- "Destination" : "destinationfolder",
- "IncludeSource": "includefolder",
- "Theme" : "themefolder",
- "SourceFoldersToCopy" : ["folder1", "foldern"],
- "Footer" : "footer text or HTML",
- "StartingPageName" : "Home",
- "ConvertLocalLinks" : "true" | "false",
- "PathSpecification" : "Full" | "Relative" | "RelativeAsFolder",
- "UrlFormatting" : "None" | "Strip" | "Dashes",
- "MaxLevelInToC" : "3",
- "StripIndexHtm" : "true" | "false",
- "Pages" :
- {
- "__index" : "index.md",
- "Title Page 1" : "filename_page1.md",
- "Title Page 2" : "filename_page2.md",
- "Sub Header 1" :
- {
- "__index" : "index.md",
- "Title Page 3" : "filename_page3.md",
- "Title Page 4" : "filename_page4.md"
- },
- "Auto generated" : "reference/**"
- }
- }
- </code></pre>
-
- <p>The order in which the pages are specified is the order in which they'll appear in the navigation. </p>
- <h3 id="name">Name<a class="headerlink" href="#name" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Specifies the name of the site to generate. </p>
- <h3 id="source">Source<a class="headerlink" href="#source" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Specifies the root of the tree of folders in which markdown files are expected. <code>sourcefolder</code> can be a relative path or an absolute path and is used as the root folder for filenames specified in <code>Pages</code>.</p>
- <h3 id="destination">Destination<a class="headerlink" href="#destination" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Specifies the folder where the output will be written to (.htm files). The output will be written to this folder only, all files from subfolders in <code>Source</code> will be written to the folder specified in <code>Destination</code>. with the same structure as the <em>navigation</em> in <code>Pages</code>. <code>destinationfolder</code> can be a relative path or an absolute path.</p>
- <h3 id="includesource">IncludeSource<a class="headerlink" href="#includesource" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Specifies the folder where the files specified to be included using <a href="markdownextensions.htm#include-files">@@include directives</a> are located. If <code>IncludeSource</code> isn't specified, the value <code>Includes</code> is assumed. </p>
- <h3 id="theme">Theme<a class="headerlink" href="#theme" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Specifies the folder within the <code>Themes</code> folder in the folder the <code>docnet</code> executable is located which is used as the theme for the pages to generate. <code>Docnet</code> expects a file called <code>PageTemplate.htm</code> within the specified <code>Theme</code> folder, which contains the HTML which is used as the wrapper file for the HTML generated from the markdown. It has to contain a couple of marker, which are described later in this document. If <code>Theme</code> isn't specified, <code>Default</code> is assumed.</p>
- <h3 id="sourcefolderstocopy">SourceFoldersToCopy<a class="headerlink" href="#sourcefolderstocopy" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>This is an optional directive with, if specified, one or more folder names relative to <code>Source</code>, which contain files to copy to the <code>Destination</code> folder. E.g. image files used in the markdown files, located in an <code>Images</code> folder can be copied this way to the output folder reliably. All folders specified are copied recursively.</p>
- <h3 id="convertlocallinks">ConvertLocalLinks<a class="headerlink" href="#convertlocallinks" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>This is an optional directive which, if specified and set to <code>"true"</code>, will make DocNet convert all local links to <code>.md</code> suffixed files into <code>.htm</code> files. Example: <code>(local link)[somemarkdownfile.md]</code> will be converted to <code><a href="somemarkdownfile.htm">local link</a></code>. Non-local urls are not converted. Default: <code>"false"</code>. </p>
- <h3 id="pathspecification">PathSpecification<a class="headerlink" href="#pathspecification" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Determines the way (md) paths are treated by the tooling. The default value is <code>Full</code> for backwards compatibility.</p>
- <ul>
- <li><code>Full</code>: Assumes that all paths are full paths. All auto-generated index files will be placed in the root folder (this setting can lead to index clashes when reusing names in subfolders).</li>
- <li><code>Relative</code>: Assumes that all paths are relative paths. All auto-generated index files will be put in the right (sub)folder.</li>
- <li><code>RelativeAsFolder</code>: Behaves the same as <code>Relative</code>, but puts <em>every</em> source md in its own folder resulting in clean navigation urls (e.g. <code>/getting-started/introduction.htm</code> becomes <code>/getting-started/introduction/index.htm</code>)</li>
- </ul>
- <h3 id="urlformatting">UrlFormatting<a class="headerlink" href="#urlformatting" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Determines how the urls are formatted. The default value is <code>None</code> which will only remove unsupported characters from the urls.</p>
- <ul>
- <li><code>None</code>: Does not touch the urls except from removing unsupported characters from the urls.</li>
- <li><code>Strip</code>: Replaces all non-text characters (e.g. spaces, dots, commas, etc) by an empty string (e.g. <code>/my-documentation/Some Introduction.md</code> results in <code>/mydocumentation/someintroduction.htm</code>)
</li>
- <li><code>Dashes</code>: Replaces all non-text characters (e.g. spaces, dots, commas, etc) by a dash (<code>-</code>) (e.g. <code>/my-documentation/Some Introduction.md</code> results in <code>/my-documentation/some-introduction.htm</code>)
</li>
- </ul>
- <h3 id="maxlevelintoc">MaxLevelInToC<a class="headerlink" href="#maxlevelintoc" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Sets the level of headings to show in the Table of Contents (ToC). The default value is <code>2</code>. To show one additional level, one would use <code>3</code> for this value. </p>
- <div class="alert alert-info"><span class="alert-title"><i class="fa fa-info-circle"></i> Info</span><p>Note that level 1 headings (titles) are never shown in the ToC).</p>
- </div><h3 id="stripindexhtm">StripIndexHtm<a class="headerlink" href="#stripindexhtm" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>If set to <code>true</code>, the tool will strip <code>index.htm</code> from the end of urls. The default value is <code>false</code>. </p>
- <div class="alert alert-tip"><span class="alert-title"><i class="fa fa-info-circle"></i> Tip</span><p>Combined with <code>PathSpecification</code> set to <code>RelativeAsFolder</code>, this will result in a 'folder-based' browsing experience (e.g. <code>/getting-started/introduction/</code>)</p>
- </div><div class="alert alert-warning"><span class="alert-title"><i class="fa fa-warning"></i> Important!</span><p>Note that setting this value to <code>true</code> will remove the possibility to view the docs off-line
</p>
- </div><h3 id="footer">Footer<a class="headerlink" href="#footer" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>This is text and/or HTML which is placed in the footer of each page, using a <em>marker</em> (see below).</p>
- <h3 id="startingpagename">StartingPageName<a class="headerlink" href="#startingpagename" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>This is the name used for the home/starting page, i.e. the <code>__index</code> page at the root level. The default value is "Home".</p>
- <h3 id="pages">Pages<a class="headerlink" href="#pages" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h3>
- <p>Contains the pages to generate into the output, in the order and structure in which you want them to appear in the navigation. The name given is the value used in the navigation tree and has to be unique per level. The value specified with each name is the markdown file to load, parse and generate as .htm file in the output. The markdown file is relative to the path specified in <code>Source</code>. A file <code>foo.md</code> will be generated as <code>foo.htm</code> in the output. </p>
- <p>Paths are expected to use <code>\</code> characters, and as it's json, you have to escape them, so the path <code>.\foo</code> becomes <code>.\\foo</code>.</p>
- <p>Each level, starting with the root, has a special page defined, <code>__index</code>. This page is the page shown when the level header (in the example above this is e.g. <em>Sub Header 1</em>) is clicked in the navigation. If <code>__index</code> is specified in the root level, it's assigned to the navigation name <code>Home</code>. If there's no <code>__index</code> specified, there will still be a page generated but it will have default content (See below). The names of the elements are case sensitive.</p>
- <h2 id="levels-without-index-defined">Levels without __index defined<a class="headerlink" href="#levels-without-index-defined" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
- <p>If a level has no <code>__index</code> defined, <code>DocNet</code> will create a <code>__index</code> entry for the level and will specify as target <code><path to index of parent>/nameoflevel.md</code>. If the page exists it will be loaded as the content for the index of the level, if it doesn't exist, the HTML will simply contain the topictitle and a list of all the sub topics in the level. This guarantees the tree can always be navigated in full.
</p>
- <h2 id="use-of-wildcard-inclusions">Use of wildcard inclusions<a class="headerlink" href="#use-of-wildcard-inclusions" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
- <p>If a level has a string value ending with <code>**</code>, it will process all .md files in the folders and subfolders and generate htm files from them. It will use the following process:</p>
- <ol>
- <li>Search (recursively) for all markdown (<code>.md</code>) files inside the specified folder (e.g. <code>reference</code>)</li>
- <li>Generate index (htm) files for all folders</li>
- <li>The title of the markdown files will be retrieved from the actual markdown files (so the first non-empty line will be used as title)</li>
- </ol>
- <div class="alert alert-info"><span class="alert-title"><i class="fa fa-info-circle"></i> Info</span><p>The wildcard inclusion feature is extremely useful for referene or API documentation (mostly generated by a 3rd party tool)</p>
- </div>
- </div>
- </div>
- <footer>
- <hr />
- <div role="contentinfo">
- Made with DocNet. Get your copy at: <a href='https://github.com/FransBouma/DocNet' target='_blank'>https://github.com/FransBouma/DocNet</a>.
- </div>
- </footer>
- </div>
- </section>
- </div>
- <script src="js/jquery-2.1.1.min.js"></script>
- <script src="js/modernizr-2.8.3.min.js"></script>
- <script src="js/highlight.pack.js"></script>
- <script src="js/theme.js"></script>
-
- </body>
- </html>
|