You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

markdownextensions.md 5.1 kB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. DocNet Markdown extensions
  2. ==========================
  3. `Docnet` defines the following markdown extensions to make writing documentation easier.
  4. ## Alert boxes
  5. To quickly define alert boxes, `Docnet` defines the `@alert` element. Three types of alerts are defined: *danger* (displayed in red), *warning* or *important* (displayed in yellow) and *info* or *neutral*, which is displayed in blue. You specify the type of the alert after the `@alert` statement using @alert *name*. Close the `@alert` with `@end`.
  6. Below are examples for each alert box and the markdown used to create them.
  7. The markdown:
  8. ```nohighlight
  9. @alert danger
  10. This is a dangerous text, it will be displayed in a danger alert box!
  11. @end
  12. ```
  13. results in
  14. @alert danger
  15. This is a dangerous text, it will be displayed in a danger alert box!
  16. @end
  17. The markdown:
  18. ```nohighlight
  19. @alert warning
  20. This is a warning text, it will be displayed in a warning alert box!
  21. @end
  22. ```
  23. results in
  24. @alert warning
  25. This is a warning text, it will be displayed in a warning alert box!
  26. @end
  27. The markdown:
  28. ```nohighlight
  29. @alert important
  30. This is an important text, it will be displayed in a warning/important alert box!
  31. @end
  32. ```
  33. results in
  34. @alert important
  35. This is an important text, it will be displayed in a warning/important alert box!
  36. @end
  37. The markdown:
  38. ```nohighlight
  39. @alert info
  40. This is an info text, it will be displayed in an info alert box!
  41. @end
  42. ```
  43. Results in
  44. @alert info
  45. This is an info text, it will be displayed in an info alert box!
  46. @end
  47. The markdown:
  48. ```nohighlight
  49. @alert tip
  50. This is a tip! It will be displayed in a tip alert box!
  51. @end
  52. ```
  53. Results in
  54. @alert tip
  55. This is a tip! It will be displayed in a tip alert box!
  56. @end
  57. ## Font Awesome icons
  58. To specify a font-awesome icon, use `@fa-iconname`, where _iconname_ is the name of the font-awesome icon.
  59. Example: To specify the font awesome icon for GitHub, use `@fa-github`, which will result in: @fa-github
  60. ## Tabs
  61. It's very easy with `Docnet` to add a tab control with one or more tabs to the HTML with a simple set of markdown statements. The tab statements are converted into pure CSS3/HTML tabs, based on the work of [Joseph Fusco](http://codepen.io/fusco/pen/Wvzjrm).
  62. To start a Tab control, start with `@tabs` and end the tabs definition with `@endtabs`. Between those two statements, which each need to be suffixed with a newline, you define one or more tabs using `@tab` followed by the label text for that tab, followed by a newline. End your tab contents with `@end`.
  63. The following example shows two tabs, one with label 'First Tab' and one with 'Second Tab':
  64. ```nohighlight
  65. @tabs
  66. @tab First Tab
  67. This is the text for the first tab. It's nothing special
  68. As you can see, it can deal with newlines as well.
  69. @end
  70. @tab Second Tab
  71. Now, the second tab however is very interesting. At least let's pretend it is!
  72. @end
  73. @endtabs
  74. ```
  75. will result in:
  76. @tabs
  77. @tab First Tab
  78. This is the text for the first tab. It's nothing special
  79. As you can see, it can deal with newlines as well.
  80. @end
  81. @tab Second Tab
  82. Now, the second tab however is very interesting. At least let's pretend it is!
  83. @end
  84. @endtabs
  85. ##Snippets
  86. You can include snippets from other files as fenced code blocks using the directive `@snippet` which has the following syntax:
  87. `@snippet language [file specification] pattern`
  88. 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 `[]`
  89. 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.
  90. 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`
  91. feature's power as it keeps the documentation in sync with the embedded code without the necessity of updating things.
  92. The following snippet, if the DocNet sourcecode is located at the spot reachable by the path below:
  93. ```nohighlight
  94. @snippet cs [../../DocNet/src/DocNet/NavigationLevel.cs] GenerateToCFragment
  95. ```
  96. will result in:
  97. @snippet cs [../../DocNet/src/DocNet/NavigationLevel.cs] GenerateToCFragment
  98. ##Include files
  99. 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.
  100. 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
  101. specified in the [docnet.json](docnetjson.htm) file, the folder `Includes` is assumed.
  102. The directive `@@include("somehtmlinclude.htm")`
  103. results in the contents of `somehtmlinclude.htm` being included at the spot where the @@include statement is given, as shown below:
  104. @@include("includedhtml.htm")
  105. You can also include markdown, which is then processed with the other markdown as if it's part of it.
  106. @@include("includedmarkdown.md")

No Description