You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

docnetjson.htm 8.5 kB

9 years ago
9 years ago
9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE html>
  2. <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
  3. <!--[if gt IE 8]><!-->
  4. <html class="no-js" lang="en">
  5. <!--<![endif]-->
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. <title>Site configuration with the docnet.json file - DocNet Documentation</title>
  11. <link rel="shortcut icon" href="favicon.ico">
  12. <link rel="stylesheet" href="css/theme.css" type="text/css" />
  13. <link rel="stylesheet" href="css/theme_colors.css" type="text/css" />
  14. <link rel="stylesheet" href="css/styles/vs.css">
  15. <link rel="stylesheet" href="css/font-awesome.4.5.0.min.css">
  16. </head>
  17. <body role="document">
  18. <div class="grid-for-nav">
  19. <nav data-toggle="nav-shift" class="nav-side stickynav">
  20. <div class="side-nav-search">
  21. <a href="index.htm"><i class="fa fa-home"></i> DocNet Documentation</a>
  22. <div role="search">
  23. <form id="search-form" class="form" action="Docnet_search.htm" method="get">
  24. <input type="text" name="q" placeholder="Search docs" />
  25. </form>
  26. </div>
  27. </div>
  28. <div class="menu menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  29. <ul>
  30. <li class="tocentry"><a href="index.htm">Home</a>
  31. </li>
  32. <li class="tocentry"><a href="usage.htm">Usage</a>
  33. </li>
  34. <li class="tocentry">
  35. <ul>
  36. <li><span class="navigationgroup"><i class="fa fa-caret-down"></i> <a href="Configuration.htm">Configuration</a></span></li>
  37. <li class="tocentry current"><a class="current" href="docnetjson.htm">Site configuration with the docnet.json file</a>
  38. <ul class="currentrelative">
  39. <li class="tocentry"><a href="#Levelswithout__indexdefined">Levels without __index defined</a></li>
  40. </ul>
  41. <li class="tocentry"><a href="h2leveldiscovery.htm">Automatic H2 level ToC entry discovery</a>
  42. </li>
  43. </ul>
  44. </li>
  45. <li class="tocentry">
  46. <span class="navigationgroup"><i class="fa fa-caret-right"></i> <a href="Authoringcontent.htm">Authoring content</a></span>
  47. </li>
  48. <li class="tocentry"><a href="search.htm">Search</a>
  49. </li>
  50. <li class="tocentry"><a href="acknowledgements.htm">Acknowledgements</a>
  51. </li>
  52. <li class="tocentry"><a href="license.htm">License</a>
  53. </li>
  54. </ul>
  55. <div class="toc-footer">
  56. <span class="text-small">
  57. <hr/>
  58. <a href="https://github.com/FransBouma/DocNet" target="_blank">Made with <i class="fa fa-github"></i> DocNet</a>
  59. </span>
  60. </div>
  61. </div>
  62. &nbsp;
  63. </nav>
  64. <section data-toggle="nav-shift" class="nav-content-wrap">
  65. <nav class="nav-top" role="navigation" aria-label="top navigation">
  66. <i data-toggle="nav-top" class="fa fa-bars"></i>
  67. <a href="index.htm">DocNet Documentation</a>
  68. </nav>
  69. <div class="nav-content">
  70. <div role="navigation" aria-label="breadcrumbs navigation">
  71. <div class="breadcrumbs">
  72. <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>
  73. </div>
  74. <hr />
  75. </div>
  76. <div role="main">
  77. <div class="section">
  78. <p><h1>The configuration file: 'docnet.json'</h1></p>
  79. <p>DocNet uses a json file to determine what to do in what form. The format is straight forward and described below</p>
  80. <p><pre><code class="json">{
  81. "Name" : "name of site",
  82. "Source" : "sourcefolder",
  83. "Destination" : "destinationfolder",
  84. "Theme" : "themefolder",
  85. "SourceFoldersToCopy" : ["folder1", "foldern"],
  86. "Footer" : "footer text or HTML",
  87. "Pages" :
  88. {
  89. "__index" : "index.md",
  90. "Title Page 1": "filename_page1.md",
  91. "Title Page 2": "filename_page2.md",
  92. "Sub Header 1":
  93. {
  94. "__index" : "index.md",
  95. "Title Page 3" : "filename_page3.md",
  96. "Title Page 4" : "filename_page4.md"
  97. }
  98. }
  99. }
  100. </code></pre></p>
  101. <p>The order in which the pages are specified is the order in which they'll appear in the navigation. </p>
  102. <ul>
  103. <li><code>Name</code> specifies the name of the site to generate. </li>
  104. <li><code>Source</code> 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>. </li>
  105. <li><code>Destination</code> 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.</li>
  106. <li><code>Theme</code> 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.</li>
  107. <li><code>SourceFoldersToCopy</code>. 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.</li>
  108. <li><code>Footer</code>. This is text and/or HTML which is placed in the footer of each page, using a <em>marker</em> (see below).</li>
  109. <li><code>Pages</code> 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. </li>
  110. </ul>
  111. Paths are expected to use `\` characters, and as it's json, you have to escape them, so the path `.\foo` becomes `.\\foo`.
  112. <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>
  113. <p><a name="Levelswithout__indexdefined"></a><h2>Levels without __index defined</h2></p>
  114. <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>&lt;path to index of parent&gt;/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>
  115. </div>
  116. </div>
  117. <footer>
  118. <hr />
  119. <div role="contentinfo">
  120. Made with DocNet. Get your copy at: <a href='https://github.com/FransBouma/DocNet' target='_blank'>https://github.com/FransBouma/DocNet</a>.
  121. </div>
  122. </footer>
  123. </div>
  124. </section>
  125. </div>
  126. <script src="js/jquery-2.1.1.min.js"></script>
  127. <script src="js/modernizr-2.8.3.min.js"></script>
  128. <script src="js/highlight.pack.js"></script>
  129. <script src="js/theme.js"></script>
  130. {{ExtraScript}}
  131. </body>
  132. </html>

No Description

Contributors (1)