newstile 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (405) hide show
  1. data/AUTHORS +1 -0
  2. data/CONTRIBUTERS +6 -0
  3. data/COPYING +24 -0
  4. data/ChangeLog +5489 -0
  5. data/GPL +674 -0
  6. data/README +31 -0
  7. data/Rakefile +342 -0
  8. data/VERSION +1 -0
  9. data/benchmark/benchmark.rb +34 -0
  10. data/benchmark/generate_data.rb +112 -0
  11. data/benchmark/historic-jruby-1.4.0.dat +7 -0
  12. data/benchmark/historic-ruby-1.8.6.dat +7 -0
  13. data/benchmark/historic-ruby-1.8.7.dat +7 -0
  14. data/benchmark/historic-ruby-1.9.1p243.dat +7 -0
  15. data/benchmark/historic-ruby-1.9.2dev.dat +7 -0
  16. data/benchmark/mdbasics.text +306 -0
  17. data/benchmark/mdsyntax.text +888 -0
  18. data/benchmark/static-jruby-1.4.0.dat +7 -0
  19. data/benchmark/static-ruby-1.8.6.dat +7 -0
  20. data/benchmark/static-ruby-1.8.7.dat +7 -0
  21. data/benchmark/static-ruby-1.9.1p243.dat +7 -0
  22. data/benchmark/static-ruby-1.9.2dev.dat +7 -0
  23. data/benchmark/testing.sh +9 -0
  24. data/benchmark/timing.sh +10 -0
  25. data/bin/newstile +82 -0
  26. data/data/newstile/document.html +18 -0
  27. data/data/newstile/document.latex +43 -0
  28. data/doc/default.scss.css +519 -0
  29. data/doc/default.template +80 -0
  30. data/doc/documentation.page +72 -0
  31. data/doc/index.page +96 -0
  32. data/doc/installation.page +90 -0
  33. data/doc/links.markdown +6 -0
  34. data/doc/news.feed +10 -0
  35. data/doc/news.page +28 -0
  36. data/doc/quickref.page +564 -0
  37. data/doc/syntax.page +1615 -0
  38. data/doc/tests.page +51 -0
  39. data/doc/virtual +2 -0
  40. data/lib/newstile.rb +23 -0
  41. data/lib/newstile/compatibility.rb +34 -0
  42. data/lib/newstile/converter.rb +43 -0
  43. data/lib/newstile/converter/base.rb +111 -0
  44. data/lib/newstile/converter/html.rb +405 -0
  45. data/lib/newstile/converter/latex.rb +577 -0
  46. data/lib/newstile/converter/markdown.rb +426 -0
  47. data/lib/newstile/converter/newstile.rb +426 -0
  48. data/lib/newstile/document.rb +168 -0
  49. data/lib/newstile/error.rb +27 -0
  50. data/lib/newstile/options.rb +296 -0
  51. data/lib/newstile/parser.rb +39 -0
  52. data/lib/newstile/parser/base.rb +94 -0
  53. data/lib/newstile/parser/html.rb +499 -0
  54. data/lib/newstile/parser/newstile.rb +325 -0
  55. data/lib/newstile/parser/newstile/abbreviation.rb +66 -0
  56. data/lib/newstile/parser/newstile/attribute_list.rb +111 -0
  57. data/lib/newstile/parser/newstile/autolink.rb +54 -0
  58. data/lib/newstile/parser/newstile/blank_line.rb +43 -0
  59. data/lib/newstile/parser/newstile/block_boundary.rb +46 -0
  60. data/lib/newstile/parser/newstile/blockquote.rb +63 -0
  61. data/lib/newstile/parser/newstile/codeblock.rb +60 -0
  62. data/lib/newstile/parser/newstile/codespan.rb +57 -0
  63. data/lib/newstile/parser/newstile/emphasis.rb +70 -0
  64. data/lib/newstile/parser/newstile/eob.rb +39 -0
  65. data/lib/newstile/parser/newstile/escaped_chars.rb +38 -0
  66. data/lib/newstile/parser/newstile/extension.rb +116 -0
  67. data/lib/newstile/parser/newstile/footnote.rb +74 -0
  68. data/lib/newstile/parser/newstile/header.rb +84 -0
  69. data/lib/newstile/parser/newstile/horizontal_rule.rb +39 -0
  70. data/lib/newstile/parser/newstile/html.rb +175 -0
  71. data/lib/newstile/parser/newstile/html_entity.rb +39 -0
  72. data/lib/newstile/parser/newstile/line_break.rb +38 -0
  73. data/lib/newstile/parser/newstile/link.rb +177 -0
  74. data/lib/newstile/parser/newstile/list.rb +239 -0
  75. data/lib/newstile/parser/newstile/math.rb +64 -0
  76. data/lib/newstile/parser/newstile/paragraph.rb +55 -0
  77. data/lib/newstile/parser/newstile/smart_quotes.rb +214 -0
  78. data/lib/newstile/parser/newstile/table.rb +134 -0
  79. data/lib/newstile/parser/newstile/typographic_symbol.rb +54 -0
  80. data/lib/newstile/utils.rb +37 -0
  81. data/lib/newstile/utils/entities.rb +336 -0
  82. data/lib/newstile/utils/html.rb +75 -0
  83. data/lib/newstile/utils/ordered_hash.rb +79 -0
  84. data/lib/newstile/version.rb +28 -0
  85. data/man/man1/newstile.1 +246 -0
  86. data/setup.rb +1585 -0
  87. data/test/run_tests.rb +59 -0
  88. data/test/test_files.rb +162 -0
  89. data/test/testcases/block/01_blank_line/spaces.html +1 -0
  90. data/test/testcases/block/01_blank_line/spaces.text +3 -0
  91. data/test/testcases/block/01_blank_line/tabs.html +1 -0
  92. data/test/testcases/block/01_blank_line/tabs.text +6 -0
  93. data/test/testcases/block/02_eob/beginning.html +1 -0
  94. data/test/testcases/block/02_eob/beginning.text +3 -0
  95. data/test/testcases/block/02_eob/end.html +1 -0
  96. data/test/testcases/block/02_eob/end.text +3 -0
  97. data/test/testcases/block/02_eob/middle.html +1 -0
  98. data/test/testcases/block/02_eob/middle.text +5 -0
  99. data/test/testcases/block/03_paragraph/indented.html +18 -0
  100. data/test/testcases/block/03_paragraph/indented.text +19 -0
  101. data/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
  102. data/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
  103. data/test/testcases/block/03_paragraph/one_para.html +1 -0
  104. data/test/testcases/block/03_paragraph/one_para.text +1 -0
  105. data/test/testcases/block/03_paragraph/two_para.html +4 -0
  106. data/test/testcases/block/03_paragraph/two_para.text +4 -0
  107. data/test/testcases/block/04_header/atx_header.html +37 -0
  108. data/test/testcases/block/04_header/atx_header.text +34 -0
  109. data/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
  110. data/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
  111. data/test/testcases/block/04_header/setext_header.html +30 -0
  112. data/test/testcases/block/04_header/setext_header.html.19 +30 -0
  113. data/test/testcases/block/04_header/setext_header.text +36 -0
  114. data/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
  115. data/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
  116. data/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
  117. data/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
  118. data/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
  119. data/test/testcases/block/04_header/with_auto_ids.html +17 -0
  120. data/test/testcases/block/04_header/with_auto_ids.options +1 -0
  121. data/test/testcases/block/04_header/with_auto_ids.text +19 -0
  122. data/test/testcases/block/05_blockquote/indented.html +25 -0
  123. data/test/testcases/block/05_blockquote/indented.text +14 -0
  124. data/test/testcases/block/05_blockquote/lazy.html +34 -0
  125. data/test/testcases/block/05_blockquote/lazy.text +20 -0
  126. data/test/testcases/block/05_blockquote/nested.html +10 -0
  127. data/test/testcases/block/05_blockquote/nested.text +6 -0
  128. data/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
  129. data/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
  130. data/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
  131. data/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
  132. data/test/testcases/block/06_codeblock/error.html +4 -0
  133. data/test/testcases/block/06_codeblock/error.text +4 -0
  134. data/test/testcases/block/06_codeblock/lazy.html +4 -0
  135. data/test/testcases/block/06_codeblock/lazy.text +5 -0
  136. data/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
  137. data/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
  138. data/test/testcases/block/06_codeblock/no_newline_at_end_1.html +2 -0
  139. data/test/testcases/block/06_codeblock/no_newline_at_end_1.text +2 -0
  140. data/test/testcases/block/06_codeblock/normal.html +13 -0
  141. data/test/testcases/block/06_codeblock/normal.text +10 -0
  142. data/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
  143. data/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
  144. data/test/testcases/block/06_codeblock/whitespace.html +3 -0
  145. data/test/testcases/block/06_codeblock/whitespace.text +3 -0
  146. data/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
  147. data/test/testcases/block/06_codeblock/with_blank_line.text +12 -0
  148. data/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
  149. data/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
  150. data/test/testcases/block/06_codeblock/with_ial.html +6 -0
  151. data/test/testcases/block/06_codeblock/with_ial.text +5 -0
  152. data/test/testcases/block/07_horizontal_rule/error.html +7 -0
  153. data/test/testcases/block/07_horizontal_rule/error.html.19 +7 -0
  154. data/test/testcases/block/07_horizontal_rule/error.text +7 -0
  155. data/test/testcases/block/07_horizontal_rule/normal.html +17 -0
  156. data/test/testcases/block/07_horizontal_rule/normal.text +17 -0
  157. data/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
  158. data/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
  159. data/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
  160. data/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
  161. data/test/testcases/block/08_list/escaping.html +17 -0
  162. data/test/testcases/block/08_list/escaping.text +17 -0
  163. data/test/testcases/block/08_list/item_ial.html +7 -0
  164. data/test/testcases/block/08_list/item_ial.text +5 -0
  165. data/test/testcases/block/08_list/lazy.html +39 -0
  166. data/test/testcases/block/08_list/lazy.text +29 -0
  167. data/test/testcases/block/08_list/list_and_hr.html +9 -0
  168. data/test/testcases/block/08_list/list_and_hr.text +5 -0
  169. data/test/testcases/block/08_list/list_and_others.html +40 -0
  170. data/test/testcases/block/08_list/list_and_others.text +26 -0
  171. data/test/testcases/block/08_list/mixed.html +117 -0
  172. data/test/testcases/block/08_list/mixed.text +66 -0
  173. data/test/testcases/block/08_list/nested.html +17 -0
  174. data/test/testcases/block/08_list/nested.text +7 -0
  175. data/test/testcases/block/08_list/other_first_element.html +39 -0
  176. data/test/testcases/block/08_list/other_first_element.text +18 -0
  177. data/test/testcases/block/08_list/simple_ol.html +19 -0
  178. data/test/testcases/block/08_list/simple_ol.text +13 -0
  179. data/test/testcases/block/08_list/simple_ul.html +48 -0
  180. data/test/testcases/block/08_list/simple_ul.text +36 -0
  181. data/test/testcases/block/08_list/single_item.html +3 -0
  182. data/test/testcases/block/08_list/single_item.text +1 -0
  183. data/test/testcases/block/08_list/special_cases.html +55 -0
  184. data/test/testcases/block/08_list/special_cases.text +35 -0
  185. data/test/testcases/block/09_html/comment.html +18 -0
  186. data/test/testcases/block/09_html/comment.text +15 -0
  187. data/test/testcases/block/09_html/content_model/deflists.html +6 -0
  188. data/test/testcases/block/09_html/content_model/deflists.options +1 -0
  189. data/test/testcases/block/09_html/content_model/deflists.text +6 -0
  190. data/test/testcases/block/09_html/content_model/tables.html +14 -0
  191. data/test/testcases/block/09_html/content_model/tables.options +1 -0
  192. data/test/testcases/block/09_html/content_model/tables.text +14 -0
  193. data/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
  194. data/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
  195. data/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
  196. data/test/testcases/block/09_html/html_to_native/code.html +10 -0
  197. data/test/testcases/block/09_html/html_to_native/code.text +9 -0
  198. data/test/testcases/block/09_html/html_to_native/comment.html +7 -0
  199. data/test/testcases/block/09_html/html_to_native/comment.text +8 -0
  200. data/test/testcases/block/09_html/html_to_native/emphasis.html +3 -0
  201. data/test/testcases/block/09_html/html_to_native/emphasis.text +3 -0
  202. data/test/testcases/block/09_html/html_to_native/entity.html +1 -0
  203. data/test/testcases/block/09_html/html_to_native/entity.text +1 -0
  204. data/test/testcases/block/09_html/html_to_native/header.html +6 -0
  205. data/test/testcases/block/09_html/html_to_native/header.options +2 -0
  206. data/test/testcases/block/09_html/html_to_native/header.text +6 -0
  207. data/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
  208. data/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
  209. data/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
  210. data/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
  211. data/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
  212. data/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
  213. data/test/testcases/block/09_html/html_to_native/options +1 -0
  214. data/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
  215. data/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
  216. data/test/testcases/block/09_html/html_to_native/table_normal.html +14 -0
  217. data/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
  218. data/test/testcases/block/09_html/html_to_native/table_simple.html +48 -0
  219. data/test/testcases/block/09_html/html_to_native/table_simple.text +56 -0
  220. data/test/testcases/block/09_html/html_to_native/typography.html +1 -0
  221. data/test/testcases/block/09_html/html_to_native/typography.html.19 +1 -0
  222. data/test/testcases/block/09_html/html_to_native/typography.text +1 -0
  223. data/test/testcases/block/09_html/invalid_html_1.html +5 -0
  224. data/test/testcases/block/09_html/invalid_html_1.text +5 -0
  225. data/test/testcases/block/09_html/invalid_html_2.html +5 -0
  226. data/test/testcases/block/09_html/invalid_html_2.text +5 -0
  227. data/test/testcases/block/09_html/markdown_attr.html +38 -0
  228. data/test/testcases/block/09_html/markdown_attr.text +38 -0
  229. data/test/testcases/block/09_html/not_parsed.html +24 -0
  230. data/test/testcases/block/09_html/not_parsed.text +24 -0
  231. data/test/testcases/block/09_html/parse_as_raw.html +30 -0
  232. data/test/testcases/block/09_html/parse_as_raw.options +1 -0
  233. data/test/testcases/block/09_html/parse_as_raw.text +29 -0
  234. data/test/testcases/block/09_html/parse_as_span.html +12 -0
  235. data/test/testcases/block/09_html/parse_as_span.options +1 -0
  236. data/test/testcases/block/09_html/parse_as_span.text +9 -0
  237. data/test/testcases/block/09_html/parse_block_html.html +21 -0
  238. data/test/testcases/block/09_html/parse_block_html.options +1 -0
  239. data/test/testcases/block/09_html/parse_block_html.text +17 -0
  240. data/test/testcases/block/09_html/processing_instruction.html +13 -0
  241. data/test/testcases/block/09_html/processing_instruction.text +12 -0
  242. data/test/testcases/block/09_html/simple.html +64 -0
  243. data/test/testcases/block/09_html/simple.html.19 +64 -0
  244. data/test/testcases/block/09_html/simple.options +1 -0
  245. data/test/testcases/block/09_html/simple.text +59 -0
  246. data/test/testcases/block/10_ald/simple.html +2 -0
  247. data/test/testcases/block/10_ald/simple.text +8 -0
  248. data/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
  249. data/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
  250. data/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
  251. data/test/testcases/block/11_ial/simple.html +25 -0
  252. data/test/testcases/block/11_ial/simple.text +34 -0
  253. data/test/testcases/block/12_extension/comment.html +8 -0
  254. data/test/testcases/block/12_extension/comment.text +12 -0
  255. data/test/testcases/block/12_extension/ignored.html +8 -0
  256. data/test/testcases/block/12_extension/ignored.text +8 -0
  257. data/test/testcases/block/12_extension/nomarkdown.html +10 -0
  258. data/test/testcases/block/12_extension/nomarkdown.kramdown +20 -0
  259. data/test/testcases/block/12_extension/nomarkdown.latex +13 -0
  260. data/test/testcases/block/12_extension/nomarkdown.text +21 -0
  261. data/test/testcases/block/12_extension/options.html +21 -0
  262. data/test/testcases/block/12_extension/options.text +21 -0
  263. data/test/testcases/block/12_extension/options2.html +10 -0
  264. data/test/testcases/block/12_extension/options2.text +5 -0
  265. data/test/testcases/block/12_extension/options3.html +7 -0
  266. data/test/testcases/block/12_extension/options3.text +7 -0
  267. data/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
  268. data/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
  269. data/test/testcases/block/13_definition_list/item_ial.html +12 -0
  270. data/test/testcases/block/13_definition_list/item_ial.text +8 -0
  271. data/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
  272. data/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
  273. data/test/testcases/block/13_definition_list/no_def_list.html +2 -0
  274. data/test/testcases/block/13_definition_list/no_def_list.text +2 -0
  275. data/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
  276. data/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
  277. data/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
  278. data/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
  279. data/test/testcases/block/13_definition_list/simple.html +8 -0
  280. data/test/testcases/block/13_definition_list/simple.text +7 -0
  281. data/test/testcases/block/13_definition_list/styled_terms.html +4 -0
  282. data/test/testcases/block/13_definition_list/styled_terms.text +2 -0
  283. data/test/testcases/block/13_definition_list/too_much_space.html +3 -0
  284. data/test/testcases/block/13_definition_list/too_much_space.text +4 -0
  285. data/test/testcases/block/13_definition_list/with_blocks.html +38 -0
  286. data/test/testcases/block/13_definition_list/with_blocks.text +24 -0
  287. data/test/testcases/block/14_table/errors.html +8 -0
  288. data/test/testcases/block/14_table/errors.text +9 -0
  289. data/test/testcases/block/14_table/footer.html +65 -0
  290. data/test/testcases/block/14_table/footer.text +25 -0
  291. data/test/testcases/block/14_table/header.html +103 -0
  292. data/test/testcases/block/14_table/header.text +32 -0
  293. data/test/testcases/block/14_table/no_table.html +3 -0
  294. data/test/testcases/block/14_table/no_table.text +3 -0
  295. data/test/testcases/block/14_table/simple.html +139 -0
  296. data/test/testcases/block/14_table/simple.text +38 -0
  297. data/test/testcases/block/15_math/normal.html +26 -0
  298. data/test/testcases/block/15_math/normal.text +28 -0
  299. data/test/testcases/block/16_toc/no_toc_depth.html +33 -0
  300. data/test/testcases/block/16_toc/no_toc_depth.options +1 -0
  301. data/test/testcases/block/16_toc/no_toc_depth.text +16 -0
  302. data/test/testcases/block/16_toc/toc_depth_2.html +24 -0
  303. data/test/testcases/block/16_toc/toc_depth_2.options +1 -0
  304. data/test/testcases/block/16_toc/toc_depth_2.text +16 -0
  305. data/test/testcases/encoding.html +46 -0
  306. data/test/testcases/encoding.text +28 -0
  307. data/test/testcases/span/01_link/empty.html +5 -0
  308. data/test/testcases/span/01_link/empty.text +5 -0
  309. data/test/testcases/span/01_link/image_in_a.html +5 -0
  310. data/test/testcases/span/01_link/image_in_a.text +5 -0
  311. data/test/testcases/span/01_link/imagelinks.html +14 -0
  312. data/test/testcases/span/01_link/imagelinks.text +16 -0
  313. data/test/testcases/span/01_link/inline.html +46 -0
  314. data/test/testcases/span/01_link/inline.html.19 +46 -0
  315. data/test/testcases/span/01_link/inline.text +48 -0
  316. data/test/testcases/span/01_link/link_defs.html +9 -0
  317. data/test/testcases/span/01_link/link_defs.text +26 -0
  318. data/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
  319. data/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
  320. data/test/testcases/span/01_link/reference.html +35 -0
  321. data/test/testcases/span/01_link/reference.html.19 +35 -0
  322. data/test/testcases/span/01_link/reference.text +47 -0
  323. data/test/testcases/span/02_emphasis/empty.html +3 -0
  324. data/test/testcases/span/02_emphasis/empty.text +3 -0
  325. data/test/testcases/span/02_emphasis/errors.html +9 -0
  326. data/test/testcases/span/02_emphasis/errors.text +9 -0
  327. data/test/testcases/span/02_emphasis/nesting.html +38 -0
  328. data/test/testcases/span/02_emphasis/nesting.text +33 -0
  329. data/test/testcases/span/02_emphasis/normal.html +46 -0
  330. data/test/testcases/span/02_emphasis/normal.text +46 -0
  331. data/test/testcases/span/03_codespan/empty.html +5 -0
  332. data/test/testcases/span/03_codespan/empty.text +5 -0
  333. data/test/testcases/span/03_codespan/errors.html +1 -0
  334. data/test/testcases/span/03_codespan/errors.text +1 -0
  335. data/test/testcases/span/03_codespan/highlighting.html +1 -0
  336. data/test/testcases/span/03_codespan/highlighting.text +1 -0
  337. data/test/testcases/span/03_codespan/normal.html +16 -0
  338. data/test/testcases/span/03_codespan/normal.text +16 -0
  339. data/test/testcases/span/04_footnote/definitions.html +17 -0
  340. data/test/testcases/span/04_footnote/definitions.latex +17 -0
  341. data/test/testcases/span/04_footnote/definitions.text +24 -0
  342. data/test/testcases/span/04_footnote/footnote_nr.html +12 -0
  343. data/test/testcases/span/04_footnote/footnote_nr.latex +2 -0
  344. data/test/testcases/span/04_footnote/footnote_nr.options +1 -0
  345. data/test/testcases/span/04_footnote/footnote_nr.text +4 -0
  346. data/test/testcases/span/04_footnote/markers.html +46 -0
  347. data/test/testcases/span/04_footnote/markers.latex +23 -0
  348. data/test/testcases/span/04_footnote/markers.text +26 -0
  349. data/test/testcases/span/05_html/across_lines.html +1 -0
  350. data/test/testcases/span/05_html/across_lines.text +2 -0
  351. data/test/testcases/span/05_html/invalid.html +1 -0
  352. data/test/testcases/span/05_html/invalid.text +1 -0
  353. data/test/testcases/span/05_html/link_with_mailto.html +1 -0
  354. data/test/testcases/span/05_html/link_with_mailto.text +1 -0
  355. data/test/testcases/span/05_html/markdown_attr.html +6 -0
  356. data/test/testcases/span/05_html/markdown_attr.text +6 -0
  357. data/test/testcases/span/05_html/normal.html +30 -0
  358. data/test/testcases/span/05_html/normal.text +30 -0
  359. data/test/testcases/span/abbreviations/abbrev.html +8 -0
  360. data/test/testcases/span/abbreviations/abbrev.text +15 -0
  361. data/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
  362. data/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
  363. data/test/testcases/span/autolinks/url_links.html +12 -0
  364. data/test/testcases/span/autolinks/url_links.text +12 -0
  365. data/test/testcases/span/escaped_chars/normal.html +43 -0
  366. data/test/testcases/span/escaped_chars/normal.text +43 -0
  367. data/test/testcases/span/extension/comment.html +6 -0
  368. data/test/testcases/span/extension/comment.text +6 -0
  369. data/test/testcases/span/extension/ignored.html +1 -0
  370. data/test/testcases/span/extension/ignored.text +1 -0
  371. data/test/testcases/span/extension/nomarkdown.html +1 -0
  372. data/test/testcases/span/extension/nomarkdown.text +1 -0
  373. data/test/testcases/span/extension/options.html +1 -0
  374. data/test/testcases/span/extension/options.text +1 -0
  375. data/test/testcases/span/ial/simple.html +6 -0
  376. data/test/testcases/span/ial/simple.text +6 -0
  377. data/test/testcases/span/line_breaks/normal.html +11 -0
  378. data/test/testcases/span/line_breaks/normal.latex +12 -0
  379. data/test/testcases/span/line_breaks/normal.text +11 -0
  380. data/test/testcases/span/math/normal.html +5 -0
  381. data/test/testcases/span/math/normal.text +5 -0
  382. data/test/testcases/span/text_substitutions/entities.html +4 -0
  383. data/test/testcases/span/text_substitutions/entities.options +1 -0
  384. data/test/testcases/span/text_substitutions/entities.text +4 -0
  385. data/test/testcases/span/text_substitutions/entities_as_char.html +1 -0
  386. data/test/testcases/span/text_substitutions/entities_as_char.html.19 +1 -0
  387. data/test/testcases/span/text_substitutions/entities_as_char.options +1 -0
  388. data/test/testcases/span/text_substitutions/entities_as_char.text +1 -0
  389. data/test/testcases/span/text_substitutions/entities_as_input.html +1 -0
  390. data/test/testcases/span/text_substitutions/entities_as_input.options +1 -0
  391. data/test/testcases/span/text_substitutions/entities_as_input.text +1 -0
  392. data/test/testcases/span/text_substitutions/entities_numeric.html +1 -0
  393. data/test/testcases/span/text_substitutions/entities_numeric.options +1 -0
  394. data/test/testcases/span/text_substitutions/entities_numeric.text +1 -0
  395. data/test/testcases/span/text_substitutions/entities_symbolic.html +1 -0
  396. data/test/testcases/span/text_substitutions/entities_symbolic.options +1 -0
  397. data/test/testcases/span/text_substitutions/entities_symbolic.text +1 -0
  398. data/test/testcases/span/text_substitutions/greaterthan.html +1 -0
  399. data/test/testcases/span/text_substitutions/greaterthan.text +1 -0
  400. data/test/testcases/span/text_substitutions/lowerthan.html +1 -0
  401. data/test/testcases/span/text_substitutions/lowerthan.text +1 -0
  402. data/test/testcases/span/text_substitutions/typography.html +18 -0
  403. data/test/testcases/span/text_substitutions/typography.html.19 +18 -0
  404. data/test/testcases/span/text_substitutions/typography.text +18 -0
  405. metadata +476 -0
@@ -0,0 +1,1615 @@
1
+ ---
2
+ title: Syntax
3
+ in_menu: true
4
+ sort_info: 10
5
+ --- name:sidebar
6
+ <h1>Contents</h1>
7
+
8
+ {menu: {used_nodes: fragments, min_levels: 4, max_levels: 6}}
9
+ --- name:content
10
+
11
+ # newstile Syntax
12
+
13
+ This is version **<%= ::Newstile::VERSION %>** of the syntax documentation.
14
+
15
+ The newstile syntax is based on the Markdown syntax and has been enhanced with features that are
16
+ found in other Markdown implementations like [Maruku], [PHP Markdown Extra] and [Pandoc]. However,
17
+ it strives to provide a strict syntax with definite rules and therefore isn't completely compatible
18
+ with Markdown. Nonetheless, most Markdown documents should work fine when parsed with newstile. All
19
+ places where the newstile syntax differs from the Markdown syntax are highlighted.
20
+
21
+ Following is the complete syntax definition for all elements newstile supports. Together with the
22
+ documentation on the available converters, it is clearly specified what you will get when a newstile
23
+ document is converted.
24
+
25
+
26
+ ## Source Text Formatting
27
+
28
+ A newstile document may be in any encoding, for example ASCII, UTF-8 or ISO-8859-1, and the output
29
+ will have the same encoding as the source.
30
+
31
+ The document consists of two types of elements, block level elements and span level elements:
32
+
33
+ * Block level elements define the main structure of the content, for example, what part of the text
34
+ should be a paragraph, a list, a blockquote and so on.
35
+
36
+ * Span level elements mark up small text parts as, for example, emphasized text or a link.
37
+
38
+ Thus span level elements can only occur inside block level elements or other span level elements.
39
+
40
+ You will often find references to the "first column" or "first character" of a line in a block level
41
+ element descriptions. Such a reference is always to be taken relative to the current indentation
42
+ level because some block level elements open up a new indentation level (e.g. blockquotes). The
43
+ beginning of a newstile document opens up the default indentation level which begins at the first
44
+ column of the text.
45
+
46
+
47
+ ## Line Wrapping
48
+
49
+ Some lightweight markup syntax don't work well in environments where lines are hard-wrapped. For
50
+ example, this is the case with many email programs. Therefore newstile allows content like
51
+ paragraphs or blockquotes to be hard-wrapped, i.e. broken across lines. This is sometimes referred
52
+ to as "lazy syntax" since the indentation or line prefix required for the first line of content is
53
+ not required for the consecutive lines.
54
+
55
+ Block level elements that support line wrapping always end when one of the following conditions is
56
+ encountered:
57
+
58
+ * a [blank line](#blank-lines), an [EOB marker line](#eob-marker), a [block IAL](#block-ials) or the
59
+ end of the document (i.e. a [block boundary](#block-boundaries)),
60
+
61
+ * or an [HTML block](#html-blocks).
62
+
63
+ Line wrapping is allowed throughout a newstile document. There is one exception, however:
64
+ [headers](#headers) may not be wrapped across lines. This is not an issue in most situations since
65
+ headers normally fit on one line. If a header text gets too long for one line, use HTML syntax
66
+ instead.
67
+
68
+ **Note** that it is **NOT** recommended to use lazy syntax to write a newstile document. The
69
+ flexibility that the newstile syntax offers due to the issue of line wrapping hinders readability
70
+ and should therefore not be used.
71
+
72
+
73
+ ### Usage of Tabs
74
+
75
+ newstile assumes that tab stops are set at multiples of four. This is especially important when
76
+ using tabs for indentation in lists. Also, tabs may only be used at the beginning of a line when
77
+ indenting text and must not be preceded by spaces. Otherwise the results may be unexpected.
78
+
79
+
80
+ ### Automatic and Manual Escaping
81
+
82
+ Depending on the output format, there are often characters that need special treatment. For example,
83
+ when converting a newstile document to HTML one needs to take care of the characters `<`, `>` and
84
+ `&`. To ease working with these special characters, they are automatically and correctly escaped
85
+ depending on the output format.
86
+
87
+ This means, for example, that you can just use `<`, `>` and `&` in a newstile document and need not
88
+ think about when to use their HTML entity counterparts. However, if you *do use* HTML entities or
89
+ HTML tags which use one of the characters, the result will be correct nonetheless!
90
+
91
+ Since newstile also uses some characters to mark-up the text, there needs to be a way to escape
92
+ these special characters so that they can have their normal meaning. This can be done by using
93
+ backslash escapes. For example, you can use a literal backtick like this:
94
+
95
+ This \`is not a code\` span!
96
+
97
+ Following is a list of all the characters (character sequences) that can be escaped:
98
+
99
+ \ backslash
100
+ . period
101
+ * asterisk
102
+ _ underscore
103
+ + plus
104
+ - minus
105
+ = equal sign
106
+ ` backtick
107
+ ()[]{} left and right parens/brackets/braces
108
+ # hash
109
+ ! bang
110
+ << left guillemet
111
+ >> right guillemet
112
+ : colon
113
+ | pipe
114
+ " double quote
115
+ ' single quote
116
+ $ dollar sign
117
+
118
+
119
+ ## Block Boundaries
120
+
121
+ Some block level elements have to start and/or end on so called block boundaries, as stated in their
122
+ documentation. There are two cases where block boundaries come into play:
123
+
124
+ * If a block level element has to start on a block boundary, it has to be preceded by either a
125
+ [blank line](#blank-lines), an [EOB marker](#eob-marker), a [block IAL](#block-ials) or it has to
126
+ be the first element.
127
+
128
+ * If a block level element has to end on a block boundary, it has to be followed by either a [blank
129
+ line](#blank-lines), an [EOB marker](#eob-marker), a [block IAL](#block-ials) or it has to be the
130
+ last element.
131
+
132
+
133
+
134
+ # Structural Elements
135
+
136
+ All structural elements are block level elements and they are used to structure the content. They
137
+ can mark up some text as, for example, a simple paragraph, a quote or as a list item.
138
+
139
+
140
+ ## Blank lines
141
+
142
+ Any line that just contains white space characters such as spaces and tabs is considered a blank
143
+ line by newstile. One or more consecutive blank lines are handled as one empty blank line. Blank
144
+ lines are used to separate block level elements from each other and in this case they don't have
145
+ semantic meaning. However, there are some cases where blank lines do have a semantic meaning:
146
+
147
+ * When used in headers -- see the [headers section](#headers)
148
+ * When used in code blocks -- see the [code blocks section](#code-blocks)
149
+ * When used in lists -- see the [lists section](#lists)
150
+ * When used in math blocks -- see the [math blocks section](#math-blocks)
151
+ * When used for elements that have to start/end on [block boundaries](#block-boundaries)
152
+
153
+
154
+ ## Paragraphs
155
+
156
+ Paragraphs are the most used block level elements. One or more consecutive lines of text are
157
+ interpreted as one paragraph. The first line of a paragraph may be indented up to three spaces, the
158
+ other lines can have any amount of indentation because paragraphs support [line
159
+ wrapping](#line-wrapping). In addition to the rules outlined in the section about line wrapping, a
160
+ paragraph ends when a [definition list line](#definition-lists) is encountered.
161
+
162
+ You can separate two consecutive paragraphs from each other by using one or more blank lines. Notice
163
+ that a line break in the source does not mean a line break in the output (due to the [lazy
164
+ syntax](#line-wrapping))!. If you want to have an explicit line break (i.e. a `<br />` tag) you need
165
+ to end a line with two or more spaces or two backslashes! Note, however, that a line break on the
166
+ last text line of a paragraph is not possible and will be ignored. Leading and trailing spaces will
167
+ be stripped from the paragraph text.
168
+
169
+ The following gives you an example of how paragraphs look like:
170
+
171
+ This para line starts at the first column. However,
172
+ the following lines can be indented any number of spaces/tabs.
173
+ The para continues here.
174
+
175
+ This is another paragraph, not connected to the above one. But
176
+ with a hard line break. \\
177
+ And another one.
178
+ {: .show-whitespaces .ws-lr}
179
+
180
+
181
+ ## Headers
182
+
183
+ newstile supports so called Setext style and atx style headers. Both forms can be used inside a
184
+ single document.
185
+
186
+ ### Setext Style
187
+
188
+ Setext style headers have to start on a [block boundary](#block-boundaries) with a line of text (the
189
+ header text) and a line with only equal signs (for a first level header) or dashes (for a second
190
+ level header). The header text may be indented up to three spaces but any leading or trailing spaces
191
+ are stripped from the header text. The amount of equal signs or dashes is not significant, just one
192
+ is enough but more may look better. The equal signs or dashes have to begin at the first column. For
193
+ example:
194
+
195
+ First level header
196
+ ==================
197
+
198
+ Second level header
199
+ ------
200
+
201
+ Other first level header
202
+ =
203
+
204
+ Since Setext headers start on block boundaries, this means in most situations that they have to be
205
+ preceded by a blank line. However, blank lines are not necessary after a Setext header:
206
+
207
+ This is a normal
208
+ paragraph.
209
+
210
+ And A Header
211
+ ------------
212
+ And a paragraph
213
+
214
+ > This is a blockquote.
215
+
216
+ And A Header
217
+ ------------
218
+
219
+ However, it is generally a good idea to also use a blank line after a Setext header because it looks
220
+ more appropriate and eases reading of the document.
221
+
222
+ > The original Markdown syntax allows one to omit the blank line before a Setext header. However,
223
+ > this leads to ambiguities and makes reading the document harder than necessary. Therefore it is
224
+ > not allowed in a newstile document.
225
+ {: .markdown-difference}
226
+
227
+ An edge case worth mentioning is the following:
228
+
229
+ header
230
+ ---
231
+ para
232
+
233
+ One might ask if this represents two paragraphs separated by a [horizontal rule](#horizontal-rules)
234
+ or a second level header and a paragraph. As suggested by the wording in the example, the latter is
235
+ the case. The general rule is that Setext headers are processed before horizontal rules.
236
+
237
+ ### atx Style
238
+
239
+ atx style headers have to start on a [block boundary](#block-boundaries) with a line that contains
240
+ one or more hash characters and then the header text. No spaces are allowed before the hash
241
+ characters. The number of hash characters specifies the heading level: one hash character gives you
242
+ a first level heading, two a second level heading and so on until the maximum of six hash characters
243
+ for a sixth level heading. You may optionally use any number of hashes at the end of the line to
244
+ close the header. Any leading or trailing spaces are stripped from the header text. For example:
245
+
246
+ # First level header
247
+
248
+ ### Third level header ###
249
+
250
+ ## Second level header ######
251
+
252
+ > Again, the original Markdown syntax allows one to omit the blank line before an atx style header.
253
+ {: .markdown-difference}
254
+
255
+
256
+ ### Specifying a Header ID
257
+
258
+ newstile supports a nice way for explicitly setting the header ID which is taken from [PHP Markdown
259
+ Extra] and [Maruku]: If you follow the header text with an opening curly bracket (separated from the
260
+ text with a least one space), a hash, the ID and a closing curly bracket, the ID is set on the
261
+ header. If you use the trailing hash feature of atx style headers, the header ID has to go after the
262
+ trailing hashes. For example:
263
+
264
+ Hello {#id}
265
+ -----
266
+
267
+ # Hello {#id}
268
+
269
+ # Hello # {#id}
270
+
271
+ > This additional syntax is not part of standard Markdown.
272
+ {: .markdown-difference}
273
+
274
+
275
+ ## Blockquotes
276
+
277
+ A blockquote is started using the `>` marker followed by an optional space and the content of the
278
+ blockquote. The marker itself may be indented up to three spaces. All following lines, whether they
279
+ are started with the blockquote marker or just contain text, belong to the blockquote because
280
+ blockquotes support [line wrapping](#line-wrapping).
281
+
282
+ The contents of a blockquote are block level elements. This means that if you are just using text as
283
+ content that it will be wrapped in a paragraph. For example, the following gives you one blockquote
284
+ with two paragraphs in it:
285
+
286
+ > This is a blockquote.
287
+ > on multiple lines
288
+ that may be lazy.
289
+ >
290
+ > This is the second paragraph.
291
+
292
+ Since the contents of a blockquote are block level elements, you can nest blockquotes and use other
293
+ block level elements (this is also the reason why blockquotes need to support line wrapping):
294
+
295
+ > This is a paragraph.
296
+ >
297
+ > > A nested blockquote.
298
+ >
299
+ > ## Headers work
300
+ >
301
+ > * lists too
302
+ >
303
+ > and all other block level elements
304
+
305
+ Note that the first space character after the `>` marker does *not* count when counting spaces for
306
+ the indentation of the block level elements inside the blockquote! So [code blocks](#code-blocks)
307
+ will have to be indented with five spaces or one space and one tab, like this:
308
+
309
+ > A code block:
310
+ >
311
+ > ruby -e 'puts :works'
312
+
313
+ [Line wrapping](#line-wrapping) allows one to be lazy but hinders readability and should therefore
314
+ be avoided, especially with blockquotes. Here is an example of using blockquotes with line wrapping:
315
+
316
+ > This is a paragraph inside
317
+ a blockquote.
318
+ >
319
+ > > This is a nested paragraph
320
+ that continues here
321
+ > and here
322
+ > > and here
323
+
324
+
325
+ ## Code Blocks
326
+
327
+ Code blocks can be used to represent verbatim text like markup, HTML or a program fragment because
328
+ no syntax is parsed within a code block.
329
+
330
+ ### Standard Code Blocks
331
+
332
+ A code block can be started by using four spaces or one tab and then the text of the code block. All
333
+ following lines containing text, whether they adhere to this syntax or not, belong to the code block
334
+ because code blocks support [line wrapping](#line-wrapping)). A wrapped code line is automatically
335
+ appended to the preceding code line by substituting the line break with a space character. The
336
+ indentation (four spaces or one tab) is stripped from each line of the code block.
337
+
338
+ > The original Markdown syntax does not allow line wrapping in code blocks.
339
+ {: .markdown-difference}
340
+
341
+ Note that consecutive code blocks that are only separate by [blank lines](#blank-lines) are merged
342
+ together into one code block:
343
+
344
+ Here comes some code
345
+
346
+ This text belongs to the same code block.
347
+
348
+ If you want to have one code block directly after another one, you need to use an [EOB
349
+ marker](#eob-marker) to separate the two:
350
+
351
+ Here comes some code
352
+ ^
353
+ This one is separate.
354
+
355
+ ### Fenced Code Blocks
356
+
357
+ > This alternative syntax is not part of the original Markdown syntax. The idea and syntax comes
358
+ > from the [PHP Markdown Extra] package.
359
+ {: .markdown-difference}
360
+
361
+ newstile also supports an alternative syntax for code blocks which does not use indented blocks but
362
+ delimiting lines. The starting line needs to begin with three or more tilde characters (`~`) and the
363
+ closing line needs to have at least the number of tildes the starting line has. Everything between
364
+ is taken literally as with the other syntax but there is no need for indenting the text. For
365
+ example:
366
+
367
+ ~~~~~~~~
368
+ Here comes some code.
369
+ ~~~~~~~~
370
+
371
+ If you need lines of tildes in such a code block, just start the code block with more tildes. For
372
+ example:
373
+
374
+ ~~~~~~~~~~~~
375
+ ~~~~~~~
376
+ code with tildes
377
+ ~~~~~~~~
378
+ ~~~~~~~~~~~~~~~~~~
379
+
380
+ This type of code block is especially useful for copy-pasted code since you don't need to indent the
381
+ code.
382
+
383
+
384
+ ## Lists
385
+
386
+ newstile provides syntax elements for creating ordered and unordered lists as well as definition
387
+ lists.
388
+
389
+ ### Ordered and Unordered lists
390
+
391
+ Both ordered and unordered lists follow the same rules.
392
+
393
+ A list is started with a list marker (in case of unordered lists one of `+`, `-` or `*` -- you can
394
+ mix them -- and in case of ordered lists a number followed by a period) followed by one tab or at
395
+ least one space, optionally followed by an [IAL](#inline-attribute-lists) that should be applied to
396
+ the list item and then the first part of the content of the list item. The leading tabs or spaces
397
+ are stripped away from this first line of content to allow for a nice alignment with the following
398
+ content of a list item (see below). All following list items with the same marker type (unordered or
399
+ ordered) are put into the same list. The numbers used for ordered lists are irrelevant, an ordered
400
+ list always starts at 1.
401
+
402
+ The following gives you an unordered list and an ordered list:
403
+
404
+ * kram
405
+ + down
406
+ - now
407
+
408
+ 1. kram
409
+ 2. down
410
+ 3. now
411
+
412
+ > The original Markdown syntax allows the markers of ordered and unordered lists to be mixed, the
413
+ > first marker specifying the list type (ordered or unordered). This is not allowed in newstile. As
414
+ > stated, the above example will give you two lists (an unordered and an ordered) in newstile and
415
+ > only one unordered list in Markdown.
416
+ {: .markdown-difference}
417
+
418
+ The first list marker in a list may be indented up to three spaces. The column number of the first
419
+ non-space character which appears after the list item marker on the same line specifies the
420
+ indentation that has to be used for the following lines of content of the list item. If there is no
421
+ such character, the indentation that needs to be used is four spaces or one tab. Indented lines may
422
+ be followed by lines containg text with any amount of indentation due to [line
423
+ wrapping](#line-wrapping). Note, however, that in addition to the rules outlined in the section
424
+ about line wrapping, a list item also ends when a line with another list item marker is encountered
425
+ -- see the next paragraph.
426
+
427
+ The indentation is stripped from the content and the content (note that the content naturally also
428
+ contains the content of the line with the item marker) is processed as text containing block level
429
+ elements. All other list markers in the list may be indented up to three spaces or the number of
430
+ spaces used for the indentation of the last list item minus one, whichever number is smaller. For
431
+ example:
432
+
433
+ * This is the first line. Since the first non-space characters appears in column 3, all other
434
+ indented lines have to be indented 2 spaces.
435
+ However, one could be lazy and not indent a line but this is not recommened.
436
+ * This is the another item of the list. It uses a different number of spaces for
437
+ indentation which is okay but should generally be avoided.
438
+ * The list item marker is indented 3 spaces which is allowed but should also be avoided and
439
+ starts the third list item. Note that the lazy line in the second list item may make you
440
+ believe that this is a sub-list which it isn't! So avoid being lazy!
441
+
442
+ So, while the above is possible and creates one list with three items, it is not advised to use
443
+ different (marker and list content) indents for same level list items as well as lazy indentation!
444
+ It is much better to write such a list in the following way:
445
+
446
+ * This is the first list item bla blabla blabla blabla blabla blabla blabla blabla blabla blabla
447
+ blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla
448
+ blabla blabla blabla bla
449
+ * This is the another item of the list. bla blabla blabla blabla blabla blabla blabla blabla
450
+ blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla bla
451
+
452
+ > The original Markdown syntax also allows you to indent the marker, however, the behaviour of what
453
+ > happens with the list items is not clearly specified and may surprise you.
454
+ >
455
+ > Also, Markdown uses a fixed number of spaces/tabs to indent the lines that belong to a list item!
456
+ {: .markdown-difference}
457
+
458
+ When using tabs for indenting the content of a list item, remember that tab stops occur at multiples
459
+ of four for newstile. Tabs are correctly converted to spaces for calculating the indentation. For
460
+ example:
461
+
462
+ * Using a tab to indent this line, the tab only counts as three spaces and therefore the
463
+ overall indentation is four spaces.
464
+
465
+ 1. The tab after the marker counts here as three spaces. Since the indentation of the
466
+ marker is three spaces and the marker itself takes two characters, the overall
467
+ indentation needed for the following lines is eight spaces or two tabs.
468
+
469
+ It is clear that you might get unexpected results if you mix tabs and spaces or if you don't have
470
+ the tab stops set to multiples of four in your editor! Therefore this should be avoided!
471
+
472
+ The content of a list item is made up of either text or block level elements. Simple list items only
473
+ contain text like in the above examples. They are not even wrapped in a paragraph tag. If the first
474
+ list text is followed by one or more blank lines, it will be wrapped in a paragraph tag:
475
+
476
+ * kram
477
+
478
+ * down
479
+ * now
480
+
481
+ In the above example, the first list item text will be wrapped in a paragraph tag since it is
482
+ followed by a blank line whereas the second list item contains just text. There is obviously a
483
+ problem for doing this with the last list item when it contains only text. You can circumvent this
484
+ by leaving a blank line after the last list item and using an EOB marker:
485
+
486
+ * Not wrapped in a paragraph
487
+ * Wrapped in a paragraph due to the following blank line.
488
+
489
+ * Also wrapped in a paragraph due to the
490
+ following blank line and the EOB marker.
491
+
492
+ ^
493
+
494
+ The text of the last list item is also wrapped in a paragraph tag if *all* other list items contain
495
+ a proper paragraph as first element. This makes the following use case work like expected, i.e.
496
+ *all* the list items are wrapped in paragraphs:
497
+
498
+ * First list item
499
+
500
+ * Second list item
501
+
502
+ * Last list item
503
+
504
+ > The original Markdown syntax page specifies that list items which are separated by one or more
505
+ > blank lines are wrapped in paragraph tags. This means that the first text will also be wrapped in
506
+ > a paragraph if you have block level elements in a list which are separated by blank lines. The
507
+ > above rule is easy to remember and lets you exactly specify when the first list text should be
508
+ > wrapped in a paragraph. The idea for the above rule comes from the [Pandoc] package.
509
+ {: .markdown-difference}
510
+
511
+ As seen in the examples above, blank lines between list items are allowed.
512
+
513
+ Since the content of a list item can contain block level elements, you can do the following:
514
+
515
+ * First item
516
+
517
+ A second paragraph
518
+
519
+ * nested list
520
+
521
+ > blockquote
522
+
523
+ * Second item
524
+
525
+ However, there is a problem when you want to have a code block immediately after a list item. You
526
+ can use an EOB marker to circumvent this problem:
527
+
528
+ * This is a list item.
529
+
530
+ The second para of the list item.
531
+ ^
532
+ A code block following the list item.
533
+
534
+ You can have any block level element as first element in a list item. However, as described above,
535
+ the leading tabs or spaces of the line with the list item marker are stripped away. This leads to a
536
+ problem when you want to have a code block as first element. The solution to this problem is the
537
+ following construct:
538
+
539
+ *
540
+ This is a code block (indentation needs to be 4(1)+4(1) spaces (tabs)).
541
+ {: .show-whitespaces .ws-lr}
542
+
543
+ Note that the list marker needs to be followed with at least one space or tab! Otherwise the line is
544
+ not recognized as the start of a list item but interpreted as a paragraph containing the list
545
+ marker.
546
+
547
+ If you want to have one list directly after another one (both with the same list type, i.e. ordered
548
+ or unordered), you need to use an EOB marker to separate the two:
549
+
550
+ * List one
551
+ ^
552
+ * List two
553
+
554
+ Since paragraphs support [line wrapping](#line-wrapping), it would usually not be possible to create
555
+ compact nested list, i.e. a list where the text is not wrapped in paragraphs because there is no
556
+ blank line but a sub list after it:
557
+
558
+ * This is just text.
559
+ * this is a sub list item
560
+ * this is a sub sub list item
561
+ * This is just text,
562
+ spanning two lines
563
+ * this is a nested list item.
564
+
565
+ However, this is an often used syntax and is therefore support by newstile.
566
+
567
+ If you want to start a paragraph with something that looks like a list item marker, you need to
568
+ escape it. This is done by escaping the period in an ordered list or the list item marker in an
569
+ unordered list:
570
+
571
+ 1984\. It was great
572
+ \- others say that, too!
573
+
574
+ As mentioned at the beginning, an optional IAL for applying attributes to a list item can be used
575
+ after the list item marker:
576
+
577
+ * {:.cls} This item has the class "cls".
578
+ Here continues the above paragraph.
579
+
580
+ * This is a normal list item.
581
+
582
+
583
+ ### Definition Lists
584
+
585
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
586
+ > the [PHP Markdown Extra] package.
587
+ {: .markdown-difference}
588
+
589
+ Definition lists allow you to assign one or more definitions to one or more terms.
590
+
591
+ A definition list is started when a normal paragraph is followed by a line with a definition marker
592
+ (a colon which may be optionally indented up to three spaces), then at least one tab or one space,
593
+ optionally followed by an [IAL](#inline-attribute-lists) that should be applied to the list item and
594
+ then the first part of the definition. The line with the definition marker may optionally be
595
+ separated from the preceding paragraph by a blank line. The leading tabs or spaces are stripped away
596
+ from this first line of the definition to allow for a nice alignment with the following definition
597
+ content. Each line of the preceding paragraph is taken to be a term and the lines separately parsed
598
+ as span level elements.
599
+
600
+ The following is a simple definition list:
601
+
602
+ newstile
603
+ : A Markdown-superset converter
604
+
605
+ Maruku
606
+ : Another Markdown-superset converter
607
+
608
+ The column number of the first non-space character which appears after a definition marker on the
609
+ same line specifies the indentation that has to be used for the following lines of the definition.
610
+ If there is no such character, the indentation that needs to be used is four spaces or one tab.
611
+ Indented lines may be followed by lines containg text with any amount of indentation due to [line
612
+ wrapping](#line-wrapping). Note, however, that in addition to the rules outlined in the section
613
+ about line wrapping, a list item also ends when a line with another definition marker is encountered.
614
+
615
+ The indentation is stripped from the definition and it (note that the definition naturally also
616
+ contains the content of the line with the definition marker) is processed as text containing block
617
+ level elements. If there is more than one definition, all other definition markers for the term may
618
+ be indented up to three spaces or the number of spaces used for the indentation of the last
619
+ definition minus one, whichever number is smaller. For example:
620
+
621
+ definition term 1
622
+ definition term 2
623
+ : This is the first line. Since the first non-space characters appears in column 3, all other
624
+ lines have to be indented 2 spaces (or lazy syntax may be used after an indented line). This
625
+ tells newstile that the lines belong to the definition.
626
+ : This is the another definition for the same term. It uses a different number of spaces
627
+ for indentation which is okay but should generally be avoided.
628
+ : The definition marker is indented 3 spaces which is allowed but should also be avoided.
629
+
630
+ So, while the above is possible and creates a definition list with two terms and three definitions
631
+ for them, it is not advised to use different (definition marker and definition) indents in the same
632
+ definition list as well as lazy indentation!
633
+
634
+ The definition for a term is made up of text and/or block level elements. If a definition is *not*
635
+ preceded by a blank line, the first part of the definition will just be text if it would be a
636
+ paragraph otherwise:
637
+
638
+ definition term
639
+ : This definition will just be text because it would normally be a paragraph and the there is
640
+ no preceding blank line.
641
+
642
+ > although the definition contains other block level elements
643
+
644
+ : This definition *will* be a paragraph since it is preceded by a blank line.
645
+
646
+ The rules about having any block level element as first element in a list item also apply to a
647
+ definition.
648
+
649
+
650
+ ## Tables
651
+
652
+ > This syntax feature is not part of the original Markdown syntax. The syntax is based on the one
653
+ > from the [PHP Markdown Extra] package.
654
+ {: .markdown-difference}
655
+
656
+ Sometimes one wants to include simple tabular data in a newstile document for which using a
657
+ full-blown HTML table is just too much. newstile supports this with a simple syntax for ASCII
658
+ tables.
659
+
660
+ Tables can be created with or without a leading pipe character: If the first line of a table
661
+ contains a pipe character at the start of the line (optionally indented up to three spaces), then
662
+ all leading pipe characters (i.e. pipe characters that are only preceded by whitespace) are ignored
663
+ on all table lines. Otherwise they are not ignored and count when dividing a table line into table
664
+ cells.
665
+
666
+ There are four different line types that can be used in a table:
667
+
668
+ * *Table rows* define the content of a table.
669
+
670
+ A table row is any line that contains at least one pipe character and is not identified as any
671
+ other type of table line! The table row is divided into indivdual table cells by pipe characters.
672
+ An optional trailing pipe character is ignored.
673
+
674
+ Header rows, footer rows and normal rows are all done using these table rows. Table cells can only
675
+ contain a single line of text, no multiline text is supported. The text of a table cell is parsed
676
+ as span level elements. Note that literal pipe characters need to be escaped, even if they occur
677
+ in code spans!
678
+
679
+ Here are some example table rows:
680
+
681
+ | First cell|Second cell|Third cell
682
+ | First | Second | Third |
683
+
684
+ First | Second | | Fourth |
685
+
686
+ * *Separator lines* are used to split the table body into multiple body parts.
687
+
688
+ A separator line is any line that contains only pipes, dashes, pluses, colons and spaces and which
689
+ contains at least one dash and one pipe character. The pipe and plus characters can be used to
690
+ visually separate columns although this is not needed. Multiple separator lines after another are
691
+ treated as one separator line.
692
+
693
+ Here are some example separator lines:
694
+
695
+ |----+----|
696
+ +----|----+
697
+ |---------|
698
+ |-
699
+ | :-----: |
700
+ -|-
701
+
702
+ * The first separator line after at least one table row is treated specially, namely as *header
703
+ separator line*. It is used to demarcate header rows from normal table rows and/or to set column
704
+ alignments. All table rows above the header separator line are considered to be header rows.
705
+
706
+ The header separator line can be specially formatted to contain column alignment definitions: An
707
+ alignment definition consists of an optional space followed by an optional colon, one or more
708
+ dashes, an optional colon and another optional space. The colons of an alignment definition are
709
+ used to set the alignment of a column: if there are no colons, the column uses the default
710
+ alignment, if there is a colon only before the dashes, the column is left aligned, if there are
711
+ colons before and after the dashes, the column is center aligned and if there is only a colon
712
+ after the dashes, the column is right aligned. Each alignment definition sets the alignment for
713
+ one column, the first alignment definition for the first column, the second alignment definition
714
+ for the second column and so on.
715
+
716
+ Here are some example header separator lines with alignment definitions:
717
+
718
+ |---+---+---|
719
+ + :-: |:------| ---:|
720
+ | :-: :- -: -
721
+ :-: | :-
722
+
723
+ * A *footer separator line* is used to demarcate footer rows from normal table rows. All table rows
724
+ below the footer separator line are considered to be footer rows.
725
+
726
+ A footer separator line is like a normal separator line except that dashes are replaced by equal
727
+ signs. A footer separator line may only appear once in a table. If multiple footer separator lines
728
+ are used in one table, only the last is treated as footer separator line, all others are treated
729
+ as normal separator lines. Normal separator lines that are used after the footer separator line
730
+ are ignored.
731
+
732
+ Here are some example footer separator lines:
733
+
734
+ |====+====|
735
+ +====|====+
736
+ |=========|
737
+ |=
738
+
739
+ Trailing spaces or tabs are ignored in all cases. To simplify table creation and maintenance,
740
+ header, footer and normal separator lines need not specify the same number of columns as table rows;
741
+ even `|-` and `|=` are a valid separators.
742
+
743
+ Given the above components, a table is specified by
744
+
745
+ * an optional separator line,
746
+ * optionally followed by zero, one or more table rows followed by a header separator line,
747
+ * one or more table rows, optionally interspersed with separator lines,
748
+ * optionally followed by a footer separator line and zero, one or more table rows and
749
+ * an optional trailing separator line.
750
+
751
+ Also note
752
+
753
+ * that the first line of a table must not have more than three spaces of indentation before the
754
+ first none space character,
755
+ * that each line of a table needs to have at least one not escaped pipe character so that newstile
756
+ recognizes it as a line belonging to the table and
757
+ * that tables have to start and end on [block boundaries](#block-boundaries)!
758
+
759
+ > The table syntax differs from the one used in [PHP Markdown Extra] as follows:
760
+ >
761
+ > * newstile tables do not need to have a table header.
762
+ > * newstile tables can be structured using separator lines.
763
+ > * newstile tables can contain a table footer.
764
+ > * newstile tables need to be separted from other block level elements.
765
+ {: .markdown-difference}
766
+
767
+ Here is an example for a newstile table with a table header row, two table bodies and a table footer
768
+ row:
769
+
770
+ |-----------------+------------+-----------------+----------------|
771
+ | Default aligned |Left aligned| Center aligned | Right aligned |
772
+ |-----------------|:-----------|:---------------:|---------------:|
773
+ | First body part |Second cell | Third cell | fourth cell |
774
+ | Second line |foo | **strong** | baz |
775
+ | Third line |quux | baz | bar |
776
+ |-----------------+------------+-----------------+----------------|
777
+ | Second body | | | |
778
+ | 2 line | | | |
779
+ |=================+============+=================+================|
780
+ | Footer row | | | |
781
+ |-----------------+------------+-----------------+----------------|
782
+
783
+ The above example table is rather time-consuming to create without the help of an ASCII table
784
+ editor. However, the table syntax is flexible and the above table could also be written like this:
785
+
786
+ |---
787
+ | Default aligned | Left aligned | Center aligned | Right aligned
788
+ |-|:-|:-:|-:
789
+ | First body part | Second cell | Third cell | fourth cell
790
+ | Second line |foo | **strong** | baz
791
+ | Third line |quux | baz | bar
792
+ |---
793
+ | Second body
794
+ | 2 line
795
+ |===
796
+ | Footer row
797
+
798
+
799
+ ## Horizontal Rules
800
+
801
+ A horizontal rule for visually separating content is created by using three or more asterisks,
802
+ dashes or underscores (these may not be mixed on a line), optionally separated by spaces or tabs, on
803
+ an otherwise blank line. The first asterisk, dash or underscore may optionally be indented up to
804
+ three spaces. The following examples show different possibilities to create a horizontal rule:
805
+
806
+ * * *
807
+
808
+ ---
809
+
810
+ _ _ _ _
811
+
812
+ ---------------
813
+
814
+
815
+ ## Math Blocks
816
+
817
+ > This syntax feature is not part of the original Markdown syntax. The idea comes from the [Maruku]
818
+ > and [Pandoc] packages.
819
+ {: .markdown-difference}
820
+
821
+ newstile has built-in support for block and span level mathematics written in LaTeX.
822
+
823
+ A math block needs to start and end on [block boundaries](#block-boundaries). It is started using
824
+ two dollar signs, optionally indented up to three spaces. The math block continues until the next
825
+ two dollar signs (which may be on the same line or on one of the next lines) that appear at the end
826
+ of a line, i.e. they may only be followed by whitespace characters. The content of a math block has
827
+ to be valid LaTeX math. It is always wrapped inside a `\begin{displaymath}...\end{displaymath}`
828
+ enviroment except if it begins with a `\begin` statement.
829
+
830
+ The following newstile fragment
831
+
832
+ $$
833
+ \begin{align*}
834
+ & \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right)
835
+ = \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\
836
+ & (x_1, \ldots, x_n) \left( \begin{array}{ccc}
837
+ \phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\
838
+ \vdots & \ddots & \vdots \\
839
+ \phi(e_n, e_1) & \cdots & \phi(e_n, e_n)
840
+ \end{array} \right)
841
+ \left( \begin{array}{c}
842
+ y_1 \\
843
+ \vdots \\
844
+ y_n
845
+ \end{array} \right)
846
+ \end{align*}
847
+ $$
848
+
849
+ renders as
850
+
851
+ $$
852
+ \begin{align*}
853
+ & \phi(x,y) = \phi \left(\sum_{i=1}^n x_ie_i, \sum_{j=1}^n y_je_j \right)
854
+ = \sum_{i=1}^n \sum_{j=1}^n x_i y_j \phi(e_i, e_j) = \\
855
+ & (x_1, \ldots, x_n) \left( \begin{array}{ccc}
856
+ \phi(e_1, e_1) & \cdots & \phi(e_1, e_n) \\
857
+ \vdots & \ddots & \vdots \\
858
+ \phi(e_n, e_1) & \cdots & \phi(e_n, e_n)
859
+ \end{array} \right)
860
+ \left( \begin{array}{c}
861
+ y_1 \\
862
+ \vdots \\
863
+ y_n
864
+ \end{array} \right)
865
+ \end{align*}
866
+ $$
867
+
868
+ Using inline math is also easy: just surround your math content with two dollar signs, like with a
869
+ math block.
870
+
871
+ If you don't want to start a math block or an inline math statement, just escape the dollar signs
872
+ and they will be treated as simple dollar signs. If you want to start an inline math statement at
873
+ the beginning of a paragraph, just escape the first dollar sign.
874
+
875
+
876
+ ## HTML Blocks
877
+
878
+ > The original Markdown syntax specifies that an HTML block must start at the left margin, i.e. no
879
+ > indentation is allowed. Also, the HTML block has to be surrounded by blank lines. Both
880
+ > restrictions are lifted for newstile documents. Additionally, the original syntax does not allow
881
+ > you to use Markdown syntax in HTML blocks which is allowed with newstile.
882
+ {: .markdown-difference}
883
+
884
+ An HTML block is potentially started if a line is encountered that begins with a non-span-level HTML
885
+ tag or a general XML tag (opening or closing) which may be indented up to three spaces.
886
+
887
+ The following HTML tags count as span level HTML tags and *won't* start an HTML block if found at
888
+ the beginning of an HTML block line:
889
+
890
+ a abbr acronym b big bdo br button cite code del dfn em i img input
891
+ ins kbd label option q rb rbc rp rt rtc ruby samp select small span
892
+ strong sub sup textarea tt var
893
+
894
+ Further parsing of a found start tag depends on the tag and in which of three possible ways its
895
+ content is parsed:
896
+
897
+ * Parse as raw HTML block: If the HTML/XML tag content should be handled as raw HTML, then only
898
+ HTML/XML tags are parsed from this point onwards and text is handled as raw, unparsed text until
899
+ the matching end tag is found or until the end of the document. Each found tag will be parsed as
900
+ raw HTML again. However, if a tag has a `markdown` attribute, this attribute controls parsing of
901
+ this one tag (see below).
902
+
903
+ Note that only correct XHTML is supported! This means that you have to use, for example, `<hr />`
904
+ instead of `<hr>` (although newstile tries to fix such things if possible). If an invalid closing
905
+ tag is found, it is ignored.
906
+
907
+ * Parse as block level elements: If the HTML/XML tag content should be parsed as text containing
908
+ block level elements, the remaining text on the line will be parsed by the block level parser as
909
+ if it appears on a separate line (**Caution**: This also means that if the line consists of the
910
+ start tag, text and the end tag, the end tag will not be found!). All following lines are parsed
911
+ as block level elements until an HTML block line with the matching end tag is found or until the
912
+ end of the document.
913
+
914
+ * Parse as span level elements: If the HTML/XML tag content should be parsed as text containing span
915
+ level elements, then all text until the *next* matching end tag or until the end of the document
916
+ will be the content of the tag and will later be parsed by the span level parser. This also means
917
+ that if the matching end tag is inside what appears to be a code span, it is still used!
918
+
919
+ If there is text after an end tag, it will be parsed as if it appears on a separate line except when
920
+ inside a raw HTML block.
921
+
922
+ Also, if an invalid closing tag is found, it is ignored.
923
+
924
+ By default, newstile parses all block HTML tags and all XML tags as raw HTML blocks. However, this
925
+ can be configured with the `parse_block_html`. If this is set to `true`, then syntax parsing in HTML
926
+ blocks is globally enabled. It is also possible to enable/disable syntax parsing on a tag per tag
927
+ basis using the `markdown` attribute:
928
+
929
+ * If an HTML tag has an attribute `markdown="0"`, then the tag is parsed as raw HTML block.
930
+
931
+ * If an HTML tag has an attribute `markdown="1"`, then the default mechanism for parsing syntax in
932
+ this tag is used.
933
+
934
+ * If an HTML tag has an attribute `markdown="block"`, then the content of the tag is parsed as block
935
+ level elements.
936
+
937
+ * If an HTML tag has an attribute `markdown="span"`, then the content of the tag is parsed as span
938
+ level elements.
939
+
940
+ The following list shows which HTML tags are parsed in which mode by default when `markdown="1"` is
941
+ applied or `parse_block_html` is `true`:
942
+
943
+ Parse as raw HTML block
944
+ :
945
+ script math option textarea
946
+
947
+ Also, all general XML tags are parsed as raw HTML blocks.
948
+
949
+ Parse as block level elements
950
+ :
951
+ applet button blockquote body colgroup dd div dl fieldset form iframe li
952
+ map noscript object ol table tbody thead tfoot tr td ul
953
+
954
+ Parse as span level elements
955
+ :
956
+ a abbr acronym address b bdo big cite caption code del dfn dt em
957
+ h1 h2 h3 h4 h5 h6 i ins kbd label legend optgroup p pre q rb rbc
958
+ rp rt rtc ruby samp select small span strong sub sup th tt var
959
+
960
+ > Remember that all span level HTML tags like `a` or `b` do not start a HTML block! However, the
961
+ > above lists also include span level HTML tags in the case the `markdown` attribute is used on a
962
+ > tag inside a raw HTML block.
963
+
964
+ Here is a simple example input and its HTML output with `parse_block_html` set to `false`:
965
+
966
+ This is a para.
967
+ <div>
968
+ Something in here.
969
+ </div>
970
+ Other para.
971
+ ^
972
+ <p>This is a para.</p>
973
+ <div>
974
+ Something in here.
975
+ </div>
976
+ <p>Other para.</p>
977
+
978
+ As one can see the content of the `div` tag will be parsed as raw HTML block and left alone.
979
+ However, if the `markdown="1"` attribute was used on the `div` tag, the content would be parsed as
980
+ block level elements and therefore converted to a paragraph.
981
+
982
+ You can also use several HTML tags at once:
983
+
984
+ <div id="content"><div id="layers"><div id="layer1">
985
+ This is some text in the `layer1` div.
986
+ </div>
987
+ This is some text in the `layers` div.
988
+ </div></div>
989
+ This is a para outside the HTML block.
990
+
991
+ However, remember that if the content of a tag is parsed as block level elements, the content that
992
+ appears after a start/end tag but on the same line, is processed as if it appears on a new line:
993
+
994
+ <div markdown="1">This is the first part of a para,
995
+ which is continued here.
996
+ </div>
997
+
998
+ <p markdown="1">This works without problems because it is parsed as span level elements</p>
999
+
1000
+ <div markdown="1">The end tag is not found because
1001
+ this line is parsed as a paragraph</div>
1002
+
1003
+ Since setting `parse_block_html` to `true` can lead to some not wanted behaviour, it is generally
1004
+ better to selectively enable or disable block/span level elements parsing by using the `markdown`
1005
+ attribute!
1006
+
1007
+ Unclosed block level HTML tags are correctly closed at the end of the document to ensure correct
1008
+ nesting and invalidly used end tags are removed from the output:
1009
+
1010
+ This is a para.
1011
+ <div markdown="1">
1012
+ Another para.
1013
+ </p>
1014
+ ^
1015
+ <p>This is a para.</p>
1016
+ <div>
1017
+ <p>Another para.</p>
1018
+ </div>
1019
+
1020
+ The parsing of processing instructions and XML comments is also supported. The content of both, PIs
1021
+ and XML comments, may span multiple lines. The start of a PI/XML comment may only appear at the
1022
+ beginning of a line, optionally indented up to three spaces. If there is text after the end of a PI
1023
+ or XML comment, it will be parsed as if it appears on a separate line. newstile syntax in PIs/XML
1024
+ comments is not processed:
1025
+
1026
+ This is a para.
1027
+ <!-- a *comment* -->
1028
+ <? a processing `instruction`
1029
+ spanning multiple lines
1030
+ ?> First part of para,
1031
+ continues here.
1032
+
1033
+
1034
+
1035
+ # Text Markup
1036
+
1037
+ These elements are all span level elements and used inside block level elements to markup text
1038
+ fragments. For example, one can easily create links or apply emphasis to certain text parts.
1039
+
1040
+ Note that empty span level elements are not converted to empty HTML tags but are copied as-is to the
1041
+ output.
1042
+
1043
+
1044
+
1045
+ ## Links and Images
1046
+
1047
+ Three types of links are supported: autolinks, inline links and reference links.
1048
+
1049
+ ### Autolinks
1050
+
1051
+ This is the easiest one to create: Just surround a web address or an email address with angle
1052
+ brackets and the address will be turned into a proper link. The address will be used as link target
1053
+ and as link text. For example:
1054
+
1055
+ Information can be found on the <http://example.com> homepage.
1056
+ You can also mail me: <me.example@example.com>
1057
+
1058
+ It is not possible to specify a different link text using autolinks -- use the other link types for
1059
+ this!
1060
+
1061
+
1062
+ ### Inline Links
1063
+
1064
+ As the wording suggests, inline links provide all information inline in the text flow. Reference
1065
+ style links only provide the link text in the text flow and everything else is defined
1066
+ elsewhere. This also allows you to reuse link definitions.
1067
+
1068
+ An inline style link can be created by surrounding the link text which must contain at least one
1069
+ character with square brackets, followed immediately by the link URL (and an optional title in
1070
+ single or double quotes preceded by at least one space) in normal parentheses. For example:
1071
+
1072
+ This is [a link](http://rubyforge.org) to a page.
1073
+ A [link](../test "local URI") can also have a title.
1074
+ And [spaces](link with spaces.html)!
1075
+
1076
+ Notes:
1077
+
1078
+ * The link text is treated like normal span level text and therefore is parsed and converted.
1079
+ However, if you use square brackets within the link text, you have to either properly nest them or
1080
+ to escape them. It is not possible to create nested links!
1081
+
1082
+ * The link URL must not contain single or double quotes and it has to contain properly nested
1083
+ parentheses if no title is specified, or the link URL must be contained in angle brackets
1084
+ (incorrectly nested parentheses are allowed).
1085
+
1086
+ * The link title may not contain its delimiters and may not be empty.
1087
+
1088
+ ### Reference Links
1089
+
1090
+ To create a reference style link, you need to surround the link text with square brackets (as with
1091
+ inline links), followed by optional spaces/tabs/line breaks and then optionally followed with
1092
+ another set of square brackets with the link identifier in them. A link identifier may only contain
1093
+ numbers, letters, spaces (line breaks and tabs are converted to spaces, multiple spaces are
1094
+ compressed to one) and punctuation characters (i.e. `_.:,;!?-`) and is not case sensitive. For
1095
+ example:
1096
+
1097
+ This is a [reference style link][linkid] to a page. And [this]
1098
+ [linkid] is also a link. As is [this][] and [THIS].
1099
+
1100
+ If you don't specify a link identifier (i.e. only use empty square brackets) or completely omit the
1101
+ second pair of square brackets, the link text is converted to a valid link identifier by removing
1102
+ all invalid characters and inserting spaces for line breaks. If there is a link definition found for
1103
+ the link identifier, a link will be created. Otherwise the text is not converted to a link.
1104
+
1105
+ ### Link Definitions
1106
+
1107
+ The link definition can be put anywhere in the document. It does not appear in the output. A link
1108
+ definition looks like this:
1109
+
1110
+ [linkid]: http://www.example.com/ "Optional Title"
1111
+
1112
+ > Link definitions are, despite being described here, non-content block level elements.
1113
+ {: .information}
1114
+
1115
+ The link definition has the following structure:
1116
+
1117
+ * The link identifier in square brackets, optionally indented up to three spaces,
1118
+ * then a colon and one or more spaces/tabs,
1119
+ * then the link URL which must not contain any single or double quotes and which must contain at
1120
+ least one non-space character, or a left angle bracket, the link URL and a right angle bracket,
1121
+ * then optionally the title in single or double quotes, separated from the link URL by one or more
1122
+ spaces or on the next line by itself indented any number of spaces/tabs.
1123
+
1124
+ > The original Markdown syntax also allowed the title to be specified in parenthesis. This is not
1125
+ > allowed for consistency with the inline title.
1126
+ {: .markdown-difference}
1127
+
1128
+ ### Images
1129
+
1130
+ Images can be specified via a syntax that is similar to the one used by links. The difference is
1131
+ that you have to use an exclamation mark before the first square bracket and that the link text of a
1132
+ normal link, which may also be the empty string in case of image links, becomes the alternative text
1133
+ of the image link. As with normal links, image links can be written inline or reference style. For
1134
+ example:
1135
+
1136
+ Here comes a ![smiley](../images/smiley.png)! And here
1137
+ ![too](../images/other.png 'Title text'). Or ![here].
1138
+ With empty alt text ![](see.jpg)
1139
+
1140
+ The link definition for images is exactly the same as the link definition for normal links.
1141
+
1142
+
1143
+ ## Emphasis
1144
+
1145
+ newstile supports two types of emphasis: light and strong emphasis. Text parts that are surrounded
1146
+ with single asterisks `*` or underscores `_` are treated as text with light emphasis, text parts
1147
+ surrounded with two asterisks or underscores are treated as text with strong emphasis. Surrounded
1148
+ means that the starting delimiter must not be followed by a space and that the stopping delimiter
1149
+ must not be preceded by a space.
1150
+
1151
+ Here is an example for text with light and strong emphasis:
1152
+
1153
+ *some text*
1154
+ _some text_
1155
+ **some text**
1156
+ __some text__
1157
+
1158
+ The asterisk form is also allowed within a single word:
1159
+
1160
+ This is un*believe*able! This d_oe_s not work!
1161
+
1162
+ Text can be marked up with both light and strong emphasis, possibly using different delimiters.
1163
+ However, it is not possible to nest strong within strong or light within light emphasized text:
1164
+
1165
+ This is a ***text with light and strong emphasis***.
1166
+ This **is _emphasized_ as well**.
1167
+ This *does _not_ work*.
1168
+ This **does __not__ work either**.
1169
+
1170
+ If one or two asterisks or underscores are surrounded by spaces, they are treated literally. If you
1171
+ want to force the literal meaning of an asterisk or an underscore you can backslash-escape it:
1172
+
1173
+ This is a * literal asterisk.
1174
+ These are ** two literal asterisk.
1175
+ As \*are\* these!
1176
+
1177
+
1178
+ ## Code Spans
1179
+
1180
+ This is the span level equivalent of the code block element. You can markup a text part as code span
1181
+ by surrounding it with backticks `` ` ``. For example:
1182
+
1183
+ Use `<html>` tags for this.
1184
+
1185
+ Note that all special characters in a code span are treated correctly. For example, when a code span
1186
+ is converted to HTML, the characters `<`, `>` and `&` are substituted by their respective HTML
1187
+ counterparts.
1188
+
1189
+ To include a literal backtick in a code span, you need to use two or more backticks as delimiters.
1190
+ You can insert one optional space after the starting and before the ending delimiter (these spaces
1191
+ are not used in the output). For example:
1192
+
1193
+ Here is a literal `` ` `` backtick.
1194
+ And here is `` `some` `` text (note the two spaces so that one is left in the output!).
1195
+
1196
+ A single backtick surrounded by spaces is treated as literal backtick. If you want to force the
1197
+ literal meaning of a backtick you can backslash-escape it:
1198
+
1199
+ This is a ` literal backtick.
1200
+ As \`are\` these!
1201
+
1202
+
1203
+ ## HTML Spans
1204
+
1205
+ HTML tags cannot only be used on the block level but also on the span level. Span level HTML tags
1206
+ can only be used inside one block level element, it is not possible to use a start tag in one block
1207
+ level element and the end tag in another. Note that only correct XHTML is supported! This means that
1208
+ you have to use, for example, `<br />` instead of `<br>` (although newstile tries to fix such errors
1209
+ if possible).
1210
+
1211
+ By default, newstile parses newstile syntax inside span HTML tags. However, this behaviour can be
1212
+ configured with the `parse_span_html` option. If this is set to `true`, then syntax parsing in HTML
1213
+ spans is enabled, if it is set to `false`, parsing is disabled. It is also possible to
1214
+ enable/disable syntax parsing on a tag per tag basis using the `markdown` attribute:
1215
+
1216
+ * If an HTML tag has an attribute `markdown="0"`, then no parsing (except parsing of HTML span tags)
1217
+ is done inside that HTML tag.
1218
+
1219
+ * If an HTML tag has an attribute `markdown="1"`, then the content of the tag is parsed as span
1220
+ level elements.
1221
+
1222
+ * If an HTML tag has an attribute `markdown="block"`, then a warning is issued because HTML spans
1223
+ cannot contain block level elements and the attribute is ignored.
1224
+
1225
+ * If an HTML tag has an attribute `markdown="span"`, then the content of the tag is parsed as span
1226
+ level elements.
1227
+
1228
+ The content of a span level HTML tag is normally parsed as span level elements. Note, however, that
1229
+ some tags like `<script>` are not parsed, i.e. their content is not modified.
1230
+
1231
+ Processing instructions and XML comments can also be used (their content is not parsed). However, as
1232
+ with HTML tags the start and the end have to appear in the same block level element.
1233
+
1234
+ Span level PIs and span level XML comments as well as general span level HTML and XML tags have to
1235
+ be preceded by at least one non whitespace character on the same line so that newstile correctly
1236
+ recognizes them as span level element and not as block level element. However, all span HTML tags,
1237
+ i.e. `a`, `em`, `b`, ..., (opening or closing) can appear at the start of a line.
1238
+
1239
+ Unclosed span level HTML tags are correctly closed at the end of the span level text to ensure
1240
+ correct nesting and invalidly used end tags or block HTML tags are removed from the output:
1241
+
1242
+ This is </invalid>.
1243
+
1244
+ This <span>is automatically closed.
1245
+ ^
1246
+ <p>This is .</p>
1247
+
1248
+ <p>This <span>is automatically closed.</span></p>
1249
+
1250
+ Also note that one or more consecutive new line characters in an HTML span tag are replaced by a
1251
+ single space, for example:
1252
+
1253
+ Link: <a href="some
1254
+ link">text</a>
1255
+ ^
1256
+ <p>Link: <a href="some link">text</a></p>
1257
+
1258
+
1259
+ ## Footnotes
1260
+
1261
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
1262
+ > the [PHP Markdown Extra] package.
1263
+ {: .markdown-difference}
1264
+
1265
+ Footnotes in newstile are similar to reference style links and link definitions. You need to place
1266
+ the footnote marker in the correct position in the text and the actual footnote content can be
1267
+ defined anywhere in the document.
1268
+
1269
+ More exactly, a footnote marker can be created by placing the footnote name in square brackets.
1270
+ The footnote name has to start with a caret (`^`), followed by a word character or a digit and then
1271
+ optionally followed by other word characters, digits or dashes. For example:
1272
+
1273
+ This is some text.[^1]. Other text.[^footnote].
1274
+
1275
+ The footnote name has to be unique in the whole newstile document. Therefore you can't link to the
1276
+ same footnote definition twice. The actual naming of a footnote does not matter since the numbering
1277
+ of footnotes is controlled via the position of the footnote markers in the document (the first found
1278
+ footnote marker will get the number 1, the second footnote marker the number 2 and so on). If there
1279
+ is a footnote definition found for the identifier, a footnote will be created. Otherwise the
1280
+ footnote marker is not converted to a footnote link. Also note that all attributes set via a span
1281
+ IAL are ignored for a footnote marker!
1282
+
1283
+ A footnote definition is used to define the content of a footnote and has the following structure:
1284
+
1285
+ * The footnote name in square brackets, optionally indented up to three spaces,
1286
+ * then a colon and one or more optional spaces,
1287
+ * then the text of the footnote
1288
+ * and optionally more text on the following lines which have to follow the syntax for [standard code
1289
+ blocks](#standard-code-blocks) (the leading four spaces/one tab are naturally stripped from the
1290
+ text)
1291
+
1292
+ > Footnote definitions are, despite being described here, non-content block level elements.
1293
+ {: .information}
1294
+
1295
+ The whole footnote content is treated like block level text and can therefore contain any valid
1296
+ block level element (also, any block level element can be the first element). If you want to have a
1297
+ code block as first element, note that all leading spaces/tabs on the first line are stripped away.
1298
+ Here are some example footnote definitions:
1299
+
1300
+ [^1]: Some *crazy* footnote definition.
1301
+
1302
+ [^footnote]:
1303
+ > Blockquotes can be in a footnote.
1304
+
1305
+ as well as code blocks
1306
+
1307
+ or, naturally, simple paragraphs.
1308
+
1309
+ [^other-note]: no code block here (spaces are stripped away)
1310
+
1311
+ [^codeblock-note]:
1312
+ this is now a code block (8 spaces indentation)
1313
+
1314
+ It does not matter where you put a footnote definition in a newstile document; the content of all
1315
+ referenced footnote definitions will be placed at the end of the newstile document. Not referenced
1316
+ footnote definitions are ignored. If more than one footnote definitions have the same footnote name,
1317
+ all footnote definitions but the last are ignored.
1318
+
1319
+
1320
+ ## Abbreviations
1321
+
1322
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
1323
+ > the [PHP Markdown Extra] package.
1324
+ {: .markdown-difference}
1325
+
1326
+ newstile provides a syntax to assign the full phrase to an abbreviation. When writing the text, you
1327
+ don't need to do anything special. However, once you add abbreviation definitions, the
1328
+ abbreviations in the text get marked up automatically. Abbreviations can consist of any character
1329
+ except a closing bracket.
1330
+
1331
+ An abbreviation definition is used to define the full phrase for an abbreviation and has the
1332
+ following structure:
1333
+
1334
+ * An asterisk and the abbreviation in square brackets, optionally indented up to three
1335
+ spaces,
1336
+ * then a colon and the full phrase of the abbreviation on one line (leading and trailing spaces are
1337
+ stripped from the full phrase).
1338
+
1339
+ Later abbreviation definition for the same abbreviation override prior ones and it does not matter
1340
+ where you put an abbreviation definition in a newstile document. Empty definitions are also allowed.
1341
+
1342
+ Here are some examples:
1343
+
1344
+ This is some text not written in HTML but in another language!
1345
+
1346
+ *[another language]: It's called Markdown
1347
+ *[HTML]: HyperTextMarkupLanguage
1348
+
1349
+ > Abbreviation definitions are, despite being described here, non-content block level elements.
1350
+ {: .information}
1351
+
1352
+
1353
+ ## Typographic Symbols
1354
+
1355
+ > The original Markdown syntax does not support these transformations.
1356
+ {: .markdown-difference}
1357
+
1358
+ newstile converts the following plain ASCII character into their corresponding typographic symbols:
1359
+
1360
+ * `---` will become an em-dash (like this ---)
1361
+ * `--` will become an en-dash (like this --)
1362
+ * `...` will become an ellipsis (like this ...)
1363
+ * `<<` will become a left guillemet (like this <<) -- an optional following space will become a
1364
+ non-breakable space
1365
+ * `>>` will become a right guillemet (like this >>) -- an optional leading space will become a
1366
+ non-breakable space
1367
+
1368
+ The parser also replaces normal single `'` and double quotes `"` with "fancy quotes". There *may* be
1369
+ times when newstile falsely replace the quotes. If this is the case, just \'escape\" the quotes and
1370
+ they won't be replaced with fancy ones.
1371
+
1372
+
1373
+
1374
+ # Non-content elements
1375
+
1376
+ This section describes the non-content elements that are used in newstile documents, i.e. elements
1377
+ that don't provide content for the document but have other uses such as separating block level
1378
+ elements or attaching attributes to elements.
1379
+
1380
+ Three non-content block level elements are not described here because they fit better where they
1381
+ are:
1382
+
1383
+ * [link definitions](#link-definitions)
1384
+ * [footnote definitions](#footnotes)
1385
+ * [abbreviation definition](#abbreviations)
1386
+
1387
+
1388
+ ## End-Of-Block Marker {#eob-marker}
1389
+
1390
+ > The EOB marker is not part of the standard Markdown syntax.
1391
+ {: .markdown-difference}
1392
+
1393
+ The End-Of-Block (EOB) marker -- a `^` as first character on an otherwise empty line -- is a block
1394
+ level element that can be used to specify the end of a block level element even if the block level
1395
+ element, after which it is used, would continue otherwise. If there is no block level element to
1396
+ end, the EOB marker is simply ignored.
1397
+
1398
+ You won't find an EOB marker in most newstile documents but sometimes it is necessary to use it to
1399
+ achieve the wanted results which would be impossible otherwise. However, it should only be used when
1400
+ absolutely necesary!
1401
+
1402
+ For example, the following gives you one list with two items:
1403
+
1404
+ * list item one
1405
+
1406
+ * list item two
1407
+
1408
+ By using an EOB marker, you can make two lists with one item each:
1409
+
1410
+ * list one
1411
+ ^
1412
+ * list two
1413
+
1414
+
1415
+ ## Attribute List Definitions
1416
+
1417
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
1418
+ > the [Maruku] package.
1419
+ {: .markdown-difference}
1420
+
1421
+ This is an implementation of [Maruku]'s feature for adding attributes to block and span level
1422
+ elements (the naming is also taken from Maruku). This block level element is used to define
1423
+ attributes which can be referenced later. The [Block Inline Attribute List](#block-ials) is used to
1424
+ attach attributes to a block level element and the [Span Inline Attribute List](#span-ials) is used
1425
+ to attach attributes to a span level element.
1426
+
1427
+ Following are some examples of attribute list definitions (ALDs) and afterwards comes the syntax
1428
+ explanation:
1429
+
1430
+ {:ref-name: #myid .my-class}
1431
+ {:other: ref-name #id-of-other title="hallo you"}
1432
+ {:test: key="value \" with quote" and other='quote brace \}'}
1433
+
1434
+ An ALD line has the following structure:
1435
+
1436
+ * a left brace, optionally preceded by up to three spaces,
1437
+ * followed by a colon, the reference name and another colon,
1438
+ * followed by attribute definitions (allowed characters are backslash-escaped closing braces or any
1439
+ character except a not escaped closing brace),
1440
+ * followed by a closing brace and optional spaces until the end of the line.
1441
+
1442
+ The reference name needs to start with a word character or a digit, optionally followed by other
1443
+ word characters, digits or dashes.
1444
+
1445
+ There are four different types of attribute definitions which have to be separated by one or more
1446
+ spaces:
1447
+
1448
+ references
1449
+
1450
+ : This must be a valid reference name. It is used to reference an other ALD so that the attributes
1451
+ of the other ALD are also included in this one. The reference name is ignored when collecting the
1452
+ attributes if no attribute definition list with this reference name exists. For example, a simple
1453
+ reference looks like `id`.
1454
+
1455
+ key-value pairs
1456
+
1457
+ : A key-value pair is defined by a key name, which must follow the rules for reference names, then
1458
+ an equal sign and then the value in single or double quotes. If you need to use the value
1459
+ delimiter (a single or a double quote) inside the value, you need to escape it with a backslash.
1460
+ Key-value pairs can be used to specify arbitrary attributes for block or span level elements. For
1461
+ example, a key-value pair looks like `key1="bef \"quoted\" aft"` or `title='This is a title'`.
1462
+
1463
+ ID name
1464
+
1465
+ : An ID name is defined by using a hash and then the identifier name which needs to start with a
1466
+ word character or a digit, optionally followed by other word characters, digits, dashes or colons.
1467
+ This is a short hand for the key-value pair `id="IDNAME"` since this is often used. The ID name
1468
+ specifies the unique ID of a block or span level element. For example, an ID name looks like
1469
+ `#myid`.
1470
+
1471
+ class names
1472
+
1473
+ : A class name is defined by using a dot and then the class name. This is (almost, but not quite) a
1474
+ short hand for the key-value pair `class="class-name"`. Almost because it actually means that the
1475
+ class name should be appended to the current value of the `class` attribute. The following ALDs
1476
+ are all equivalent:
1477
+
1478
+ {:id: .cls1 .cls2}
1479
+ {:id: class="cls1" .cls2}
1480
+ {:id: class="something" class="cls1" .cls2}
1481
+ {:id: class="cls1 cls2}
1482
+
1483
+ As can be seen from the example of the class names, attributes that are defined earlier are
1484
+ overwritten by ones with the same name defined later. Also, everything in the attribute definitions
1485
+ part that does not match one of the above four types is ignored.
1486
+
1487
+ If there is more than one ALD with the same reference name, the attribute definitions of all the
1488
+ ALDs are processed like they are defined in one ALD.
1489
+
1490
+
1491
+ ## Inline Attribute Lists
1492
+
1493
+ These elements are used to attach attributes to another element.
1494
+
1495
+ ### Block Inline Attribute Lists {#block-ials}
1496
+
1497
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
1498
+ > the [Maruku] package.
1499
+ {: .markdown-difference}
1500
+
1501
+ This block level element is used to attach attributes to a block level element. A block inline
1502
+ attribute list (block IAL) has the same structure as an [ALD](#attribute-list-definitions) except
1503
+ that the colon/reference name/colon part is replaced by a colon. A block IAL (or two or more block
1504
+ IALs) has to be put directly before or after the block level element to which the attributes should
1505
+ be attached. If a block IAL is directly after *and* before a block level element, it is applied to
1506
+ preceding element. The block IAL is ignored in all other cases, for example, when the block IAL is
1507
+ surrounded by blank lines.
1508
+
1509
+ Key-value pairs of an IAL take precedence over equally named key-value pairs in referenced ALDs.
1510
+
1511
+ Here are some examples for block IALs:
1512
+
1513
+ A simple paragraph with an ID attribute.
1514
+ {: #para-one}
1515
+
1516
+ > A blockquote with a title
1517
+ {:title="The blockquote title"}
1518
+ {: #myid}
1519
+
1520
+ {:.ruby}
1521
+ Some code here
1522
+
1523
+ ### Span Inline Attribute Lists {#span-ials}
1524
+
1525
+ > This syntax feature is not part of the original Markdown syntax. The idea and syntax comes from
1526
+ > the [Maruku] package.
1527
+ {: .markdown-difference}
1528
+
1529
+ This is a version of the [block inline attribute list](#block-ials) for span level elements. It has
1530
+ the same structure as the block IAL except that leading and trailing spaces are not allowed. A span
1531
+ IAL (or two or more span IALs) has to be put directly after the span level element to which it
1532
+ should be applied, no additional character is allowed between, otherwise it is ignored and only
1533
+ removed from the output.
1534
+
1535
+ Here are some examples for span IALs:
1536
+
1537
+ This *is*{:.underline} some `code`{:#id}{:.class}.
1538
+ A [link](test.html){:rel='something'} and some **tools**{:.tools}.
1539
+
1540
+
1541
+ ## Extensions
1542
+
1543
+ > This syntax feature is not part of the original Markdown syntax.
1544
+ {: .markdown-difference}
1545
+
1546
+ Extensions provide additional functionality but use the same syntax for it. They are available as
1547
+ block as well as span level elements.
1548
+
1549
+ The syntax for an extension is very similar to the syntax of [ALDs](#attribute-list-definitions).
1550
+ Here are some examples of how to specify extensions and afterwards is the syntax definition:
1551
+
1552
+ {::comment}
1553
+ This text is completely ignored by newstile - a comment in the text.
1554
+ {:/comment}
1555
+
1556
+ Do you see {::comment}this text{:/comment}?
1557
+ {::comment}some other comment{:/}
1558
+
1559
+ {::options key="val" /}
1560
+
1561
+ An extension can be specified with or without a body. Therefore there exist a start and an end tag
1562
+ for extensions. The start tag has the following structure:
1563
+
1564
+ * a left brace,
1565
+ * followed by two colons and the extension name,
1566
+ * optionally followed by a space and attribute definitions (allowed characters are backslash-escaped
1567
+ closing braces or any character except a not escaped closing brace -- same as with ALDs),
1568
+ * followed by a slash and a right brace (in case the extension has no body) or only a right
1569
+ brace (in case the extension has a body).
1570
+
1571
+ The stop tag has the following structure:
1572
+
1573
+ * a left brace,
1574
+ * followed by a colon and a slash,
1575
+ * optionally followed by the extension name,
1576
+ * followed by a right brace.
1577
+
1578
+ A stop tag is only needed if the extension has a body!
1579
+
1580
+ The above syntax can be used as is for span level extensions. The starting and ending lines for block level
1581
+ extensions are defined as:
1582
+
1583
+ * The starting line consists of the extension start tag, optionally preceded by up to three spaces,
1584
+ and followed by optional spaces until the end of the line.
1585
+ * The ending line consists of the extension stop tag, optionally preceded by up to three spaces,
1586
+ and followed by optional spaces until the end of the line.
1587
+
1588
+ If no end tag can be found for an extension start tag, the start tag is treated as if it has no
1589
+ body. If an invalid extension stop tag is found, it is ignored. If an invalid extension name is
1590
+ specified the extension (and the eventually specified body) are ignored.
1591
+
1592
+ The following extensions can be used with newstile:
1593
+
1594
+ `comment`
1595
+
1596
+ : Treat the body text as a comment which does not show in the output.
1597
+
1598
+ `nomarkdown`
1599
+
1600
+ : Don't process the body with newstile but output it as-is. The attribute `type` specifies which
1601
+ converters should output the body: if the attribute is missing, all converters should output it.
1602
+ Otherwise the attribute value has to be a space separated list of converter names and these
1603
+ converters should output the body.
1604
+
1605
+ `options`
1606
+
1607
+ : Should be used without a body since the body is ignored. Is used for setting the global options
1608
+ for the newstile processor (for example, to disable automatic header ID generation). Note that
1609
+ options that are used by the parser are immediately effective whereas all other options are not!
1610
+ This means, for example, that it is not possible to set converter options only for some part of a
1611
+ newstile document.
1612
+
1613
+
1614
+
1615
+ {include_file: doc/links.markdown}