Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for MaxLevelInToC feature #69

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MarkdownSource/docnetjson.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DocNet uses a json file to determine what to do in what form. The format is stra
"Footer" : "footer text or HTML",
"ConvertLocalLinks: "true" | "false",
"PathSpecification": "Full" | "Relative" | "RelativeAsFolder",
"MaxLevelInToC": "3",
"Pages" :
{
"__index" : "index.md",
Expand Down Expand Up @@ -43,6 +44,7 @@ The order in which the pages are specified is the order in which they'll appear
* `Full`: 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).
* `Relative`: Assumes that all paths are relative paths. All auto-generated index files will be put in the right (sub)folder.
* `RelativeAsFolder`: Behaves the same as `Relative`, but puts *every* source md in its own folder resulting in clean navigation urls (e.g. `/getting-started/introduction.htm` becomes `/getting-started/introduction/index.htm`)
* `MaxLevelInToC`. Sets the level of headings to show in the Table of Contents (ToC). The default value is `2`. To show one additional level, one would use `3` for this value. *Note that level 1 headings (titles) are never shown in the ToC).*
* `Footer`. This is text and/or HTML which is placed in the footer of each page, using a _marker_ (see below).
* `Pages` 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 `Source`. A file `foo.md` will be generated as `foo.htm` in the output.

Expand Down
6 changes: 6 additions & 0 deletions MarkdownSource/h2leveldiscovery.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ Automatic H2 level ToC entry discovery
======================================

`Docnet` will automatically add all H2 (`##` marked) headers to the ToC as sub navigation elements below a page ToC item. It will automatically add anchors to these H2 headers in the HTML output for the page as well. This makes it very easy to create a fine-grained ToC for easy discovery.

This behavior can be overridden by the `MaxLevelInToC` [configuration option](./docnetjson.md).

@alert info
Note that level 1 headings (titles) are never shown in the ToC).
@end