| @@ -229,6 +229,10 @@ code.code-large { | |||
| font-size: 90%; | |||
| } | |||
| div.alert > pre > code { | |||
| line-height: initial; | |||
| } | |||
| dfn { | |||
| font-style: italic; | |||
| } | |||
| @@ -39,6 +39,7 @@ | |||
| <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="#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> | |||
| @@ -100,7 +101,8 @@ | |||
| "__index" : "index.md", | |||
| "Title Page 3" : "filename_page3.md", | |||
| "Title Page 4" : "filename_page4.md" | |||
| } | |||
| }, | |||
| "Auto generated" : "reference/**" | |||
| } | |||
| } | |||
| </code></pre> | |||
| @@ -121,7 +123,15 @@ | |||
| <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> | |||
| @@ -166,15 +166,15 @@ feature's power as it keeps the documentation in sync with the embedded code wit | |||
| public override string GenerateToCFragment(NavigatedPath navigatedPath, string relativePathToRoot) | |||
| { | |||
| var fragments = new List<string>(); | |||
| if(!this.IsRoot) | |||
| if (!this.IsRoot) | |||
| { | |||
| fragments.Add("<li class=\"tocentry\">"); | |||
| } | |||
| if(navigatedPath.Contains(this)) | |||
| if (navigatedPath.Contains(this)) | |||
| { | |||
| // we're expanded. If we're not root and on the top of the navigated path stack, our index page is the page we're currently generating the ToC for, so | |||
| // we have to mark the entry as 'current' | |||
| if(navigatedPath.Peek() == this && !this.IsRoot) | |||
| if (navigatedPath.Peek() == this && !this.IsRoot) | |||
| { | |||
| fragments.Add("<ul class=\"current\">"); | |||
| } | |||
| @@ -186,24 +186,24 @@ public override string GenerateToCFragment(NavigatedPath navigatedPath, string r | |||
| // first render the level header, which is the index element, if present or a label. The root always has an __index element otherwise we'd have stopped at load. | |||
| var elementStartTag = "<li><span class=\"navigationgroup\"><i class=\"fa fa-caret-down\"></i> "; | |||
| var indexElement = this.IndexElement; | |||
| if(indexElement == null) | |||
| if (indexElement == null) | |||
| { | |||
| fragments.Add(string.Format("{0}{1}</span></li>", elementStartTag, this.Name)); | |||
| } | |||
| else | |||
| { | |||
| if(this.IsRoot) | |||
| if (this.IsRoot) | |||
| { | |||
| fragments.Add(indexElement.PerformGenerateToCFragment(navigatedPath, relativePathToRoot)); | |||
| } | |||
| else | |||
| { | |||
| fragments.Add(string.Format("{0}<a href=\"{1}{2}\">{3}</a></span></li>", elementStartTag, relativePathToRoot, HttpUtility.UrlPathEncode(indexElement.TargetURL), | |||
| fragments.Add(string.Format("{0}<a href=\"{1}{2}\">{3}</a></span></li>", elementStartTag, relativePathToRoot, HttpUtility.UrlPathEncode(indexElement.TargetURL), | |||
| this.Name)); | |||
| } | |||
| } | |||
| // then the elements in the container. Index elements are skipped here. | |||
| foreach(var element in this.Value) | |||
| foreach (var element in this.Value) | |||
| { | |||
| fragments.Add(element.GenerateToCFragment(navigatedPath, relativePathToRoot)); | |||
| } | |||
| @@ -212,10 +212,10 @@ public override string GenerateToCFragment(NavigatedPath navigatedPath, string r | |||
| else | |||
| { | |||
| // just a link | |||
| fragments.Add(string.Format("<span class=\"navigationgroup\"><i class=\"fa fa-caret-right\"></i> <a href=\"{0}{1}\">{2}</a></span>", | |||
| fragments.Add(string.Format("<span class=\"navigationgroup\"><i class=\"fa fa-caret-right\"></i> <a href=\"{0}{1}\">{2}</a></span>", | |||
| relativePathToRoot, HttpUtility.UrlPathEncode(this.TargetURL), this.Name)); | |||
| } | |||
| if(!this.IsRoot) | |||
| if (!this.IsRoot) | |||
| { | |||
| fragments.Add("</li>"); | |||
| } | |||
| @@ -9,7 +9,7 @@ | |||
| { | |||
| "location": "docnetjson.htm", | |||
| "breadcrumbs": "Home / Configuration / Site configuration with the docnet.json file", | |||
| "keywords": "__index _marker_ _Sub 1 1_ 2 3 4 a A above absolute all All always an and appear are as assigned assumed be becomes below but called can case characters clicked configuration contain contains content convert converted ConvertLocalLinks copied copy couple create default Default defined described Destination destinationfolder determine directive directives do docnet Docnet DocNet document doesn e E each Each elements entry escape example Example executable exist exists expected expects false file filename_page1 filename_page2 filename_page3 filename_page4 filenames files folder folder1 foldern folders foo footer Footer for form format forward from full g generate generated given guarantees has have header Header Home href htm HTML if If image Images in include included includefolder Includes IncludeSource index into is isn it It json later level Levels link links list load loaded local located make markdown markdownextensions marker md more name Name nameoflevel names navigated navigation no Non not of one only optional or order output page Page pages Pages PageTemplate parent parse path Paths per placed recursively relative reliably root same see See sensitive set shown simply site so somemarkdownfile Source sourcefolder SourceFoldersToCopy special specified specifies specify starting still straight structure sub Sub subfolders suffixed target text the The them theme Theme themefolder Themes there they this This Title to topics topictitle tree true unique urls use used uses using value want way what when where which will with within without wrapper written you", | |||
| "keywords": "__index _marker_ _Sub 1 1_ 2 3 3rd 4 a A above absolute actual alert all All always an and API appear are as assigned assumed Auto be becomes below but by called can case characters clicked configuration contain contains content convert converted ConvertLocalLinks copied copy couple create default Default defined described Destination destinationfolder determine directive directives do docnet Docnet DocNet document documentation doesn e E each Each elements empty end ending entry escape example Example executable exist exists expected expects extremely false feature file filename_page1 filename_page2 filename_page3 filename_page4 filenames files first folder folder1 foldern folders following foo footer Footer for form format forward from full g generate Generate generated given guarantees has have header Header Home href htm HTML if If image Images in include included includefolder Includes IncludeSource inclusion inclusions index info inside into is isn it It json later level Levels line link links list load loaded local located make markdown markdownextensions marker md more mostly name Name nameoflevel names navigated navigation no non Non not of one only optional or order output page Page pages Pages PageTemplate parent parse party path Paths per placed process recursively reference referene relative reliably retrieved root same Search see See sensitive set shown simply site so somemarkdownfile Source sourcefolder SourceFoldersToCopy special specified specifies specify starting still straight string structure sub Sub subfolders suffixed target text the The them theme Theme themefolder Themes there they this This title Title to tool topics topictitle tree true unique urls use Use used useful uses using value want way what when where which wildcard will with within without wrapper written you", | |||
| "title": "Site configuration with the docnet.json file" | |||
| }, | |||
| { | |||