Documentation Sample

Pages

  • Contents
  • Pages
  • HTML Page
  • Markdown Page
  • Templates
  • Example Pages
    • Typography
    • Tables
    • Code Blocks
    • Blockquotes
    • Other Markdown Features
    • More Pages
      • Hosting
      • Code Minifiers
      • Build Times
      • Even More Pages
        • And More
          • Blank Page 1
          • Blank Page 2
          • Blank Page 3
          • Blank Page 4
          • Blank Page 5
          • Blank Page 6
          • Blank Page 7
          • Blank Page 8
          • Blank Page 9
          • Blank Page 10
        • Blank Page 1
        • Blank Page 2
        • Blank Page 3
        • Blank Page 4
        • Blank Page 5
        • Blank Page 6
        • Blank Page 7
        • Blank Page 8
        • Blank Page 9
        • Blank Page 10
      • And More
        • Blank Page 1
        • Blank Page 2
        • Blank Page 3
        • Blank Page 4
        • Blank Page 5
        • Blank Page 6
        • Blank Page 7
        • Blank Page 8
        • Blank Page 9
        • Blank Page 10
  • Page Orders

Templates

Author: Jam-Es.com    -    Updated: 2nd June 2020    -    2 minutes to read

Templates allow you to avoid duplicating code in pages. They are similar to using custom elements in JavaScript frameworks like Angular and React. They work both in Markdown and Html pages.

For example using the code <card> ... some content ... <\card> produces a material design styled card which is used on this page containing this text.

The code for the entire <card> template looks like this:

<TName name="card"/>

<div class="card" style="padding: 20px; margin-top: 28px; margin-bottom: 20px;">
  @ChildContent;
</div>

Other than the main content text you see in these pages, everything else in this documentation is created using templates. This makes the documentation fully customizable. You can edit the templates to adjust the styles or layouts, or create your own template from scratch. For example, this template was made using the CSS framework Bulma, but you could write your own using Bootstrap if you prefer.

To create your own template you just need to create a HTML file in the Templates directory like the one shown above.

Templates can also accept parameters like this <mytemplate myproperty="myvalue"/> and have a few other features. To see all the features templates support, please see the GitHub Wiki.

© Copyright 2020, My Company.