Providing menus using the Master/Detail model

The Markdown engine supports a Master/Detail model when rendering HTML output. Content is typically provided in the Detail pages. Menus on the other hand are provided in the Master pages. The Master pages are shared between multiple Detail pages and can therefore act as placeholders for a menu system. When writing a content page, define the Master page using the Master metadata tag:

Master: Master.md 

In the Master page, define where the Detail page is to be introduced, by referring to the Details metadata tag using the [%Details] construct. Master pages can complement the metadata provided by Detail pages, by providing their own set of metadata tags.

The following shows the default menu in Master.md in the Root folder:

<header> 
<nav> 
 
* [Home](/Index.md) 
* [Markdown](/Markdown.md) 
* [Script](/Script.md) 
* [Calculator](/Calculator.md) 
* [License](/Copyright.md) 
* [IoT Gateway](https://github.com/PeterWaher/IoTGateway) 
* [Waher Data](http://waher.se/) 
 
</nav> 
</header> 
<main> 
 
[%Details] 
 
</main> 
Note that empty rows have syntactical meaning in Markdown. They separate blocks (or paragraphs) of text.
The bullet list is rendered as a series of <li> elements inside an <ul> tag. If the link inside the bullet refers to the current page, the <li> element will be annotated with the class attribute active. This allows you to display the item differently.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset