Browse Source

Updated to v0.14 docs

pull/60/head
Frans Bouma 9 years ago
parent
commit
2b15b20667
7 changed files with 116 additions and 17 deletions
  1. +1
    -0
      MarkdownSource/acknowledgements.md
  2. +1
    -1
      MarkdownSource/docnet.json
  3. +21
    -0
      MarkdownSource/markdownextensions.md
  4. +1
    -0
      acknowledgements.htm
  5. +12
    -13
      css/theme_colors.css
  6. +78
    -1
      markdownextensions.htm
  7. +2
    -2
      search_index.json

+ 1
- 0
MarkdownSource/acknowledgements.md View File

@@ -6,3 +6,4 @@ This application wouldn't be possible without the work of others. The (likely in
* [MkDocs](http://www.mkdocs.org/). `Docnet` borrows a great deal from `MkDocs`: the theme css `Docnet` uses is based on a cleaned up version of their `Readthedocs` theme, as well as the javascript based search is from MkDocs. * [MkDocs](http://www.mkdocs.org/). `Docnet` borrows a great deal from `MkDocs`: the theme css `Docnet` uses is based on a cleaned up version of their `Readthedocs` theme, as well as the javascript based search is from MkDocs.
* [MarkdownDeep](http://www.toptensoftware.com/markdowndeep/). The markdown parser is an extended version of the `MarkdownDeep` parser from topten software. * [MarkdownDeep](http://www.toptensoftware.com/markdowndeep/). The markdown parser is an extended version of the `MarkdownDeep` parser from topten software.
* [Json.NET](http://www.newtonsoft.com/json). The reading/writing of json files is important for `Docnet` and it uses Json.NET for that. * [Json.NET](http://www.newtonsoft.com/json). The reading/writing of json files is important for `Docnet` and it uses Json.NET for that.
* [ProjBook](http://defrancea.github.io/Projbook/). The snippet extraction code in `DocNet` is based on ProjBook's extractors.

+ 1
- 1
MarkdownSource/docnet.json View File

@@ -3,7 +3,7 @@
"Source" : ".", "Source" : ".",
"Destination" : "..\\", "Destination" : "..\\",
"IncludeSource": "Includes", "IncludeSource": "Includes",
"Theme" : "Default",
"Theme" : "Light",
"Footer" : "Made with DocNet. Get your copy at: <a href='https://github.com/FransBouma/DocNet' target='_blank'>https://github.com/FransBouma/DocNet</a>.", "Footer" : "Made with DocNet. Get your copy at: <a href='https://github.com/FransBouma/DocNet' target='_blank'>https://github.com/FransBouma/DocNet</a>.",
"Pages" : "Pages" :
{ {


+ 21
- 0
MarkdownSource/markdownextensions.md View File

@@ -116,6 +116,27 @@ Now, the second tab however is very interesting. At least let's pretend it is!
@end @end
@endtabs @endtabs



##Snippets
You can include snippets from other files as fenced code blocks using the directive `@snippet` which has the following syntax:

`@snippet language [file specification] pattern`

Here, _language_ can be one of `cs`, `txt` or `xml`. If an unknown language is specified, `txt` is chosen. _Pattern_ is used to determine which part of the file specified between `[]`
is to be embedded at the spot of the `@snippet` fragment. This code is based on [Projbook's extractor feature](http://defrancea.github.io/Projbook/projbook.html#Pageextractormd) and follows the same pattern system.

Below, the method `GenerateToCFragment` is embedded in a C# fenced code block. This method is a DocNet method and is obtained directly from the source code. This shows the `@snippet`
feature's power as it keeps the documentation in sync with the embedded code without the necessity of updating things.

The following snippet, if the DocNet sourcecode is located at the spot reachable by the path below:

```nohighlight
@snippet cs [../../DocNet/src/DocNet/NavigationLevel.cs] GenerateToCFragment
```

will result in:
@snippet cs [../../DocNet/src/DocNet/NavigationLevel.cs] GenerateToCFragment

##Include files ##Include files
You can include other files in your markdown files using the directive `@@include("filename")`, where `filename` is the name of the file to include. The include system isn't recursive. You can include other files in your markdown files using the directive `@@include("filename")`, where `filename` is the name of the file to include. The include system isn't recursive.
The files to include are read from a special folder, specified under `IncludeSource` in the [docnet.json](docnetjson.htm) file. If no `IncludeSource` directive is The files to include are read from a special folder, specified under `IncludeSource` in the [docnet.json](docnetjson.htm) file. If no `IncludeSource` directive is


+ 1
- 0
acknowledgements.htm View File

@@ -76,6 +76,7 @@
<li><a href="http://www.mkdocs.org/" target="_blank">MkDocs</a>. <code>Docnet</code> borrows a great deal from <code>MkDocs</code>: the theme css <code>Docnet</code> uses is based on a cleaned up version of their <code>Readthedocs</code> theme, as well as the javascript based search is from MkDocs. </li> <li><a href="http://www.mkdocs.org/" target="_blank">MkDocs</a>. <code>Docnet</code> borrows a great deal from <code>MkDocs</code>: the theme css <code>Docnet</code> uses is based on a cleaned up version of their <code>Readthedocs</code> theme, as well as the javascript based search is from MkDocs. </li>
<li><a href="http://www.toptensoftware.com/markdowndeep/" target="_blank">MarkdownDeep</a>. The markdown parser is an extended version of the <code>MarkdownDeep</code> parser from topten software. </li> <li><a href="http://www.toptensoftware.com/markdowndeep/" target="_blank">MarkdownDeep</a>. The markdown parser is an extended version of the <code>MarkdownDeep</code> parser from topten software. </li>
<li><a href="http://www.newtonsoft.com/json" target="_blank">Json.NET</a>. The reading/writing of json files is important for <code>Docnet</code> and it uses Json.NET for that. </li> <li><a href="http://www.newtonsoft.com/json" target="_blank">Json.NET</a>. The reading/writing of json files is important for <code>Docnet</code> and it uses Json.NET for that. </li>
<li><a href="http://defrancea.github.io/Projbook/" target="_blank">ProjBook</a>. The snippet extraction code in <code>DocNet</code> is based on ProjBook's extractors. </li>
</ul> </ul>
</div> </div>


+ 12
- 13
css/theme_colors.css View File

@@ -16,7 +16,7 @@ a:visited {
} }


body { body {
color: #404040;
color: #222;
} }


code, pre.nocode { code, pre.nocode {
@@ -58,7 +58,7 @@ mark {
} }


.toc-footer hr { .toc-footer hr {
border-color: #3e3a3a;
border-color: #ccc;
} }
/* #endregion */ /* #endregion */


@@ -182,44 +182,43 @@ mark {
} }


.menu-vertical ul.currentrelative, .menu-vertical ul.currentrelativeroot { .menu-vertical ul.currentrelative, .menu-vertical ul.currentrelativeroot {
background-color: #e3e3e3;
background-color: #fcfcfc;
} }


.menu-vertical li.current { .menu-vertical li.current {
background-color: #fff;
background-color: #fcfcfc;
} }


.menu-vertical ul.current { .menu-vertical ul.current {
background-color: #3e3a3a;
background-color: #fcfcfc;
} }


.menu-vertical li.current a { .menu-vertical li.current a {
color: #777;
color: #6b6b6b;
} }


.menu-vertical li.current.tocentry > a, .menu-vertical li.current > a { .menu-vertical li.current.tocentry > a, .menu-vertical li.current > a {
color: #444;
color: #6b6b6b;
} }


.menu-vertical li.current.tocentry ul li > a { .menu-vertical li.current.tocentry ul li > a {
color: #777;
color: #6b6b6b;
} }


.menu-vertical a { .menu-vertical a {
color: #ccc;
color: #6b6b6b;
} }


.menu-vertical a:hover, .menu-vertical li.on a:hover { .menu-vertical a:hover, .menu-vertical li.on a:hover {
color: #ccc;
color: #999;
} }



.menu-vertical span, .menu-vertical span > a { .menu-vertical span, .menu-vertical span > a {
color: #999;
color: #6b6b6b;
} }


.nav-side { .nav-side {
background: #343131;
background: #eee;
} }


.nav-top { .nav-top {


+ 78
- 1
markdownextensions.htm View File

@@ -51,6 +51,7 @@
<li class="tocentry"><a href="#alert-boxes">Alert boxes</a></li> <li class="tocentry"><a href="#alert-boxes">Alert boxes</a></li>
<li class="tocentry"><a href="#font-awesome-icons">Font Awesome icons</a></li> <li class="tocentry"><a href="#font-awesome-icons">Font Awesome icons</a></li>
<li class="tocentry"><a href="#tabs">Tabs</a></li> <li class="tocentry"><a href="#tabs">Tabs</a></li>
<li class="tocentry"><a href="#snippets">Snippets</a></li>
<li class="tocentry"><a href="#include-files">Include files</a></li> <li class="tocentry"><a href="#include-files">Include files</a></li>
</ul> </ul>
@@ -146,7 +147,83 @@ Now, the second tab however is very interesting. At least let's pretend it is!
<div class="tab-wrap"><input type="radio" id="tab0_1" name="tabGroup1" class="tab" checked><label for="tab0_1">First Tab</label><input type="radio" id="tab1_1" name="tabGroup1" class="tab"><label for="tab1_1">Second Tab</label><div class="tab-content"><p>This is the text for the first tab. It's nothing special</p> <div class="tab-wrap"><input type="radio" id="tab0_1" name="tabGroup1" class="tab" checked><label for="tab0_1">First Tab</label><input type="radio" id="tab1_1" name="tabGroup1" class="tab"><label for="tab1_1">Second Tab</label><div class="tab-content"><p>This is the text for the first tab. It's nothing special</p>
<p>As you can see, it can deal with newlines as well. </p> <p>As you can see, it can deal with newlines as well. </p>
</div><div class="tab-content"><p>Now, the second tab however is very interesting. At least let's pretend it is!</p> </div><div class="tab-content"><p>Now, the second tab however is very interesting. At least let's pretend it is!</p>
</div></div><h2 id="include-files">Include files<a class="headerlink" href="#include-files" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
</div></div><h2 id="snippets">Snippets<a class="headerlink" href="#snippets" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
<p>You can include snippets from other files as fenced code blocks using the directive <code>@snippet</code> which has the following syntax:</p>
<p><code>@snippet language [file specification] pattern</code></p>
<p>Here, <em>language</em> can be one of <code>cs</code>, <code>txt</code> or <code>xml</code>. If an unknown language is specified, <code>txt</code> is chosen. <em>Pattern</em> is used to determine which part of the file specified between <code>[]</code>
is to be embedded at the spot of the <code>@snippet</code> fragment. This code is based on <a href="http://defrancea.github.io/Projbook/projbook.html#Pageextractormd" target="_blank">Projbook's extractor feature</a> and follows the same pattern system. </p>
<p>Below, the method <code>GenerateToCFragment</code> is embedded in a C# fenced code block. This method is a DocNet method and is obtained directly from the source code. This shows the <code>@snippet</code>
feature's power as it keeps the documentation in sync with the embedded code without the necessity of updating things. </p>
<p>The following snippet, if the DocNet sourcecode is located at the spot reachable by the path below:</p>
<pre class="nocode">@snippet cs [../../DocNet/src/DocNet/NavigationLevel.cs] GenerateToCFragment
</pre><p>will result in:</p>
<pre><code class="cs">/// &lt;summary&gt;
/// Generates the ToC fragment for this element, which can either be a simple line or a full expanded menu.
/// &lt;/summary&gt;
/// &lt;param name=&quot;navigatedPath&quot;&gt;The navigated path to the current element, which doesn't necessarily have to be this element.&lt;/param&gt;
/// &lt;param name=&quot;relativePathToRoot&quot;&gt;The relative path back to the URL root, e.g. ../.., so it can be used for links to elements in this path.&lt;/param&gt;
/// &lt;returns&gt;&lt;/returns&gt;
public override string GenerateToCFragment(NavigatedPath navigatedPath, string relativePathToRoot)
{
var fragments = new List&lt;string&gt;();
if(!this.IsRoot)
{
fragments.Add(&quot;&lt;li class=\&quot;tocentry\&quot;&gt;&quot;);
}
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 &amp;&amp; !this.IsRoot)
{
fragments.Add(&quot;&lt;ul class=\&quot;current\&quot;&gt;&quot;);
}
else
{
fragments.Add(&quot;&lt;ul&gt;&quot;);
}

// 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 = &quot;&lt;li&gt;&lt;span class=\&quot;navigationgroup\&quot;&gt;&lt;i class=\&quot;fa fa-caret-down\&quot;&gt;&lt;/i&gt; &quot;;
var indexElement = this.IndexElement;
if(indexElement == null)
{
fragments.Add(string.Format(&quot;{0}{1}&lt;/span&gt;&lt;/li&gt;&quot;, elementStartTag, this.Name));
}
else
{
if(this.IsRoot)
{
fragments.Add(indexElement.PerformGenerateToCFragment(navigatedPath, relativePathToRoot));
}
else
{
fragments.Add(string.Format(&quot;{0}&lt;a href=\&quot;{1}{2}\&quot;&gt;{3}&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&quot;, 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)
{
fragments.Add(element.GenerateToCFragment(navigatedPath, relativePathToRoot));
}
fragments.Add(&quot;&lt;/ul&gt;&quot;);
}
else
{
// just a link
fragments.Add(string.Format(&quot;&lt;span class=\&quot;navigationgroup\&quot;&gt;&lt;i class=\&quot;fa fa-caret-right\&quot;&gt;&lt;/i&gt; &lt;a href=\&quot;{0}{1}\&quot;&gt;{2}&lt;/a&gt;&lt;/span&gt;&quot;,
relativePathToRoot, HttpUtility.UrlPathEncode(this.TargetURL), this.Name));
}
if(!this.IsRoot)
{
fragments.Add(&quot;&lt;/li&gt;&quot;);
}
return string.Join(Environment.NewLine, fragments.ToArray());
}
</code></pre>

<h2 id="include-files">Include files<a class="headerlink" href="#include-files" title="Permalink to this headline"><i class="fa fa-link" aria-hidden="true"></i></a></h2>
<p>You can include other files in your markdown files using the directive <code>@@include(&quot;filename&quot;)</code>, where <code>filename</code> is the name of the file to include. The include system isn't recursive. <p>You can include other files in your markdown files using the directive <code>@@include(&quot;filename&quot;)</code>, where <code>filename</code> is the name of the file to include. The include system isn't recursive.
The files to include are read from a special folder, specified under <code>IncludeSource</code> in the <a href="docnetjson.htm">docnet.json</a> file. If no <code>IncludeSource</code> directive is The files to include are read from a special folder, specified under <code>IncludeSource</code> in the <a href="docnetjson.htm">docnet.json</a> file. If no <code>IncludeSource</code> directive is
specified in the <a href="docnetjson.htm">docnet.json</a> file, the folder <code>Includes</code> is assumed. </p> specified in the <a href="docnetjson.htm">docnet.json</a> file, the folder <code>Includes</code> is assumed. </p>


+ 2
- 2
search_index.json View File

@@ -33,7 +33,7 @@
{ {
"location": "markdownextensions.htm", "location": "markdownextensions.htm",
"breadcrumbs": "Home / Authoring content / Writing content using Markdown / DocNet Markdown extensions", "breadcrumbs": "Home / Authoring content / Writing content using Markdown / DocNet Markdown extensions",
"keywords": "_iconname_ 64 a add after alert Alert alerts also an and are as As assumed at At awesome Awesome based be being below Below Between blue box boxes by can Close codepen contents control converted create CSS3 danger dangerous deal define defined defines definition directive displayed docnet Docnet DocNet docnetjson documentation each easier easy element end End endtabs example Example examples extensions fa file filename files first First folder followed following font Font for from fusco Fusco github GitHub given however htm HTML http icon iconname icons if If important in include Include included includedhtml includedmarkdown Includes IncludeSource info interesting into io is isn it It Joseph json label least let make markdown Markdown md more name need neutral newline newlines no nohighlight nothing Now of on one or other part pen pretend processed pure quickly read recursive red result results Results second Second see set shown shows simple somehtmlinclude special specified specify spot start statement statements suffixed system tab Tab tabs Tabs text that the The them then This those Three tip to To two type types under use used using very warning well where which will with work writing Wvzjrm yellow you You your",
"keywords": "_iconname_ _language_ _Pattern_ 64 a add after alert Alert alerts also an and are as As assumed at At awesome Awesome based be being below Below between Between block blocks blue box boxes by C can chosen Close code codepen contents control converted create cs CSS3 danger dangerous deal define defined defines definition defrancea determine directive directly displayed docnet Docnet DocNet docnetjson documentation each easier easy element embedded end End endtabs example Example examples extensions extractor fa feature fenced file filename files first First folder followed following follows font Font for fragment from fusco Fusco GenerateToCFragment github GitHub given has Here however htm html HTML http icon iconname icons if If important in include Include included includedhtml includedmarkdown Includes IncludeSource info interesting into io is isn it It Joseph json keeps label language least let located make markdown Markdown md method more name NavigationLevel necessity need neutral newline newlines no nohighlight nothing Now obtained of on one or other Pageextractormd part path pattern pen power pretend processed projbook Projbook pure quickly reachable read recursive red result results Results same second Second see set shown shows simple snippet snippets Snippets somehtmlinclude source sourcecode special specification specified specify spot src start statement statements suffixed sync syntax system tab Tab tabs Tabs text that the The them then things This those Three tip to To two txt type types under unknown updating use used using very warning well where which will with without work writing Wvzjrm xml yellow you You your",
"title": "DocNet Markdown extensions" "title": "DocNet Markdown extensions"
}, },
{ {
@@ -45,7 +45,7 @@
{ {
"location": "acknowledgements.htm", "location": "acknowledgements.htm",
"breadcrumbs": "Home / Acknowledgements", "breadcrumbs": "Home / Acknowledgements",
"keywords": "a Acknowledgements an and application as based be below borrows builds cleaned com contains css deal Docnet extended files for from great http important incomplete is it javascript json Json likely list markdown markdowndeep MarkdownDeep mkdocs MkDocs NET newtonsoft of on org others parser possible reading Readthedocs search software that the The their theme This topten toptensoftware up upon uses version well without work wouldn writing www",
"keywords": "a Acknowledgements an and application as based be below borrows builds cleaned code com contains css deal defrancea Docnet DocNet extended extraction extractors files for from github great http important in incomplete io is it javascript json Json likely list markdown markdowndeep MarkdownDeep mkdocs MkDocs NET newtonsoft of on org others parser possible Projbook ProjBook reading Readthedocs search snippet software that the The their theme This topten toptensoftware up upon uses version well without work wouldn writing www",
"title": "Acknowledgements" "title": "Acknowledgements"
}, },
{ {


Loading…
Cancel
Save