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.

markdownsupport.md 5.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. Markdown support
  2. ================
  3. `DocNet` uses markdown files as input. The markdown is parsed with the markdown parser from topten software (called '[MarkdownDeep](http://www.toptensoftware.com/markdowndeep/)'). It supports the default markdown statements as well as github style code block markers and specific extensions for writing documentation, which are described below.
  4. ##Standard Markdown
  5. The standard markdown syntax as defined by [John Gruber](https://daringfireball.net/projects/markdown/) is supported in full.
  6. ##Php Markdown Extra
  7. MarkdownDeep supports [PHP Markdown Extra](https://michelf.ca/projects/php-markdown/extra/). PHP Markdown Extra comes with a set of neat extensions for markdown to define e.g. tables, footnotes and more. Please see the link above for all the syntax examples. Additionally, you can look at the [unit test files](https://github.com/FransBouma/DocNet/tree/master/src/MarkdownDeepTests/testfiles/extramode) for MarkdownDeep in the [DocNet respository at GitHub](https://github.com/FransBouma/DocNet).
  8. A couple of examples are given below
  9. ###Footnotes
  10. MarkdownDeep supports Footnotes, which can be added through the following system: To specify a footnote marker, specify `[^1]`, which will result in:[^1]
  11. The actual footnote text is then specified with `[^1]:` following the text of the actual footnote. Click on the superscript `1` link above to go to the footnote rendered at the bottom of this page.
  12. [^1]: And this is the footnote related to the example above.
  13. ###Definition lists
  14. To specify simple definition lists, simply do:
  15. ```
  16. Item one
  17. : this is the description of item one
  18. Item Two
  19. : this is the text of item 2
  20. ```
  21. which results in:
  22. Item one
  23. : this is the description of item one
  24. Item Two
  25. : this is the text of item 2
  26. ###Tables
  27. There's basic support for defining tables.
  28. Specifying:
  29. ```
  30. Fruit|Color
  31. --|--
  32. Apples|Red
  33. Pears|Green
  34. Bananas|Yellow
  35. Bongo|Bongo... it's a strange color, do you have a minute? It's a bit like the sea, but also a bit like the beach. You know how it is... oh and a bit like the wind too? You see it? Hey! Where're you going?!
  36. ```
  37. results in:
  38. Fruit|Color
  39. --|--
  40. Apples|Red
  41. Pears|Green
  42. Bananas|Yellow
  43. Bongo|Bongo... it's a strange color, do you have a minute? It's a bit like the sea, but also a bit like the beach. You know how it is... oh and a bit like the wind too? You see it? Hey! Where're you going?!
  44. ###Special attributes
  45. DocNet supports special attributes for Links and Images. Currently this is supported on normal links/image specifications only, e.g.:
  46. ```
  47. ![id text](imageurl){.cssclass1 .cssclass2 #idvalue name=value}
  48. ```
  49. which will result in:
  50. ```html
  51. <img src="imageurl" alt="id text" id="idvalue" class="cssclass1 cssclass2" name="value" />
  52. ```
  53. ###Image rendering
  54. By default images have no special rendering applied to them. To apply a shadow, specify '.shadowed' as css class in a special attribute specification.
  55. If you want to have an image rendered centered with a note below it, simply specify a title for the image:
  56. ```
  57. ![](mycenteredpicture.jpg "this is a picture")
  58. ```
  59. will be rendered as: (xxx and yyy are the width/height values of mycenteredpicture.jpg)
  60. ```html
  61. <div class="figure">
  62. <img src="mycenteredpicture.jpg" title="this is a picture" width="xxx" height="yyy"/>
  63. <p>this is a picture</p>
  64. </div>
  65. ```
  66. All images rendered contain the width/height of the picture file included in the html.
  67. ###Abbreviations
  68. There's also support for abbreviations, using the `<abbr>` HTML tag.
  69. Specifying:
  70. ```
  71. *[FuBar]: F**ked Up Beyond Any Repair.
  72. ```
  73. *[FuBar]: F**ked Up Beyond Any Repair.
  74. gives an abbreviation link in the following sentence: This is a test for abbreviations: FuBar.
  75. ##Highlighting code
  76. The markdown parser has been extended with GitHub code specifications, so it's easy to specify a specific code beautifying based on a language. This feature uses the [Highlight.js](https://highlightjs.org/) javascript library and most popular languages are included.
  77. Example: to specify a codeblock as C#, append `cs` after the first ``` marker:
  78. ```cs
  79. var i=42;
  80. ```
  81. To specify a block of text in a fixed sized font but not specify any language highlighting, specify `nohighlight` as language name:
  82. ```nohighlight
  83. this is a simple <pre> block
  84. ```
  85. ##Linking
  86. `Docnet` doesn't automatically transform links to markdown files by default. To enable automatic link conversion to local markdown files, please specify the `ConvertLocalLinks` option in the [docnet.json file](docnetjson.md) file with the value `true`. If `ConvertLocalLinks` isn't specified or set to `false`, any link to any document in your documentation has to use the url it will get in the destination folder.
  87. Example: you want to link to the file `How to\AddEntity.md` from a page. If `ConvertLocalLinks` isn't specified or set to `false`, you have to specify in the markdown the url it will need to be in the result site, which is the link `How%20to/AddEntity.htm`. If `ConvertLocalLinks` is set to `true`, you can specify `How%20to/AddEntity.md` and DocNet will convert it to `How%20to/AddEntity.htm`.
  88. @alert important
  89. The markdown parser also doesn't allow spaces to be present in the urls. If you need a space in the url, escape it with `%20`.
  90. @end

No Description

Contributors (1)