gitdown 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (416) hide show
  1. data/AUTHORS +1 -0
  2. data/COPYING +24 -0
  3. data/GPL +674 -0
  4. data/README +43 -0
  5. data/Rakefile +370 -0
  6. data/VERSION +1 -0
  7. data/benchmark/benchmark.rb +34 -0
  8. data/benchmark/benchmark.sh +74 -0
  9. data/benchmark/generate_data.rb +119 -0
  10. data/benchmark/mdbasics.text +306 -0
  11. data/benchmark/mdsyntax.text +888 -0
  12. data/benchmark/testing.sh +9 -0
  13. data/benchmark/timing.sh +10 -0
  14. data/bin/kramdown +78 -0
  15. data/data/kramdown/document.html +18 -0
  16. data/data/kramdown/document.latex +43 -0
  17. data/doc/default.scss.css +530 -0
  18. data/doc/default.template +80 -0
  19. data/doc/documentation.page +71 -0
  20. data/doc/index.page +98 -0
  21. data/doc/installation.page +88 -0
  22. data/doc/links.markdown +6 -0
  23. data/doc/news.feed +10 -0
  24. data/doc/news.page +28 -0
  25. data/doc/quickref.page +585 -0
  26. data/doc/syntax.page +1644 -0
  27. data/doc/tests.page +52 -0
  28. data/doc/virtual +2 -0
  29. data/lib/kramdown.rb +23 -0
  30. data/lib/kramdown/compatibility.rb +35 -0
  31. data/lib/kramdown/converter.rb +41 -0
  32. data/lib/kramdown/converter/base.rb +169 -0
  33. data/lib/kramdown/converter/html.rb +410 -0
  34. data/lib/kramdown/converter/kramdown.rb +422 -0
  35. data/lib/kramdown/converter/latex.rb +607 -0
  36. data/lib/kramdown/converter/toc.rb +82 -0
  37. data/lib/kramdown/document.rb +117 -0
  38. data/lib/kramdown/element.rb +524 -0
  39. data/lib/kramdown/error.rb +30 -0
  40. data/lib/kramdown/options.rb +373 -0
  41. data/lib/kramdown/parser.rb +40 -0
  42. data/lib/kramdown/parser/base.rb +136 -0
  43. data/lib/kramdown/parser/github_markdown.rb +44 -0
  44. data/lib/kramdown/parser/github_markdown/github_codeblock.rb +44 -0
  45. data/lib/kramdown/parser/html.rb +570 -0
  46. data/lib/kramdown/parser/kramdown.rb +338 -0
  47. data/lib/kramdown/parser/kramdown/abbreviation.rb +71 -0
  48. data/lib/kramdown/parser/kramdown/autolink.rb +53 -0
  49. data/lib/kramdown/parser/kramdown/blank_line.rb +43 -0
  50. data/lib/kramdown/parser/kramdown/block_boundary.rb +46 -0
  51. data/lib/kramdown/parser/kramdown/blockquote.rb +51 -0
  52. data/lib/kramdown/parser/kramdown/codeblock.rb +63 -0
  53. data/lib/kramdown/parser/kramdown/codespan.rb +56 -0
  54. data/lib/kramdown/parser/kramdown/emphasis.rb +70 -0
  55. data/lib/kramdown/parser/kramdown/eob.rb +39 -0
  56. data/lib/kramdown/parser/kramdown/escaped_chars.rb +38 -0
  57. data/lib/kramdown/parser/kramdown/extensions.rb +204 -0
  58. data/lib/kramdown/parser/kramdown/footnote.rb +74 -0
  59. data/lib/kramdown/parser/kramdown/header.rb +68 -0
  60. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +39 -0
  61. data/lib/kramdown/parser/kramdown/html.rb +169 -0
  62. data/lib/kramdown/parser/kramdown/html_entity.rb +44 -0
  63. data/lib/kramdown/parser/kramdown/line_break.rb +38 -0
  64. data/lib/kramdown/parser/kramdown/link.rb +148 -0
  65. data/lib/kramdown/parser/kramdown/list.rb +240 -0
  66. data/lib/kramdown/parser/kramdown/math.rb +64 -0
  67. data/lib/kramdown/parser/kramdown/paragraph.rb +63 -0
  68. data/lib/kramdown/parser/kramdown/smart_quotes.rb +214 -0
  69. data/lib/kramdown/parser/kramdown/table.rb +178 -0
  70. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +52 -0
  71. data/lib/kramdown/parser/markdown.rb +69 -0
  72. data/lib/kramdown/utils.rb +37 -0
  73. data/lib/kramdown/utils/entities.rb +348 -0
  74. data/lib/kramdown/utils/html.rb +85 -0
  75. data/lib/kramdown/utils/ordered_hash.rb +100 -0
  76. data/lib/kramdown/version.rb +28 -0
  77. data/setup.rb +1585 -0
  78. data/test/run_tests.rb +59 -0
  79. data/test/test_files.rb +197 -0
  80. data/test/testcases/block/01_blank_line/spaces.html +1 -0
  81. data/test/testcases/block/01_blank_line/spaces.text +3 -0
  82. data/test/testcases/block/01_blank_line/tabs.html +1 -0
  83. data/test/testcases/block/01_blank_line/tabs.text +6 -0
  84. data/test/testcases/block/02_eob/beginning.html +1 -0
  85. data/test/testcases/block/02_eob/beginning.text +3 -0
  86. data/test/testcases/block/02_eob/end.html +1 -0
  87. data/test/testcases/block/02_eob/end.text +3 -0
  88. data/test/testcases/block/02_eob/middle.html +1 -0
  89. data/test/testcases/block/02_eob/middle.text +5 -0
  90. data/test/testcases/block/03_paragraph/indented.html +18 -0
  91. data/test/testcases/block/03_paragraph/indented.text +19 -0
  92. data/test/testcases/block/03_paragraph/no_newline_at_end.html +5 -0
  93. data/test/testcases/block/03_paragraph/no_newline_at_end.text +5 -0
  94. data/test/testcases/block/03_paragraph/one_para.html +1 -0
  95. data/test/testcases/block/03_paragraph/one_para.text +1 -0
  96. data/test/testcases/block/03_paragraph/two_para.html +4 -0
  97. data/test/testcases/block/03_paragraph/two_para.text +4 -0
  98. data/test/testcases/block/04_header/atx_header.html +37 -0
  99. data/test/testcases/block/04_header/atx_header.text +34 -0
  100. data/test/testcases/block/04_header/atx_header_no_newline_at_end.html +1 -0
  101. data/test/testcases/block/04_header/atx_header_no_newline_at_end.text +1 -0
  102. data/test/testcases/block/04_header/setext_header.html +30 -0
  103. data/test/testcases/block/04_header/setext_header.html.19 +30 -0
  104. data/test/testcases/block/04_header/setext_header.text +36 -0
  105. data/test/testcases/block/04_header/setext_header_no_newline_at_end.html +1 -0
  106. data/test/testcases/block/04_header/setext_header_no_newline_at_end.text +2 -0
  107. data/test/testcases/block/04_header/with_auto_id_prefix.html +3 -0
  108. data/test/testcases/block/04_header/with_auto_id_prefix.options +2 -0
  109. data/test/testcases/block/04_header/with_auto_id_prefix.text +3 -0
  110. data/test/testcases/block/04_header/with_auto_ids.html +17 -0
  111. data/test/testcases/block/04_header/with_auto_ids.options +1 -0
  112. data/test/testcases/block/04_header/with_auto_ids.text +19 -0
  113. data/test/testcases/block/05_blockquote/indented.html +25 -0
  114. data/test/testcases/block/05_blockquote/indented.text +14 -0
  115. data/test/testcases/block/05_blockquote/lazy.html +34 -0
  116. data/test/testcases/block/05_blockquote/lazy.text +20 -0
  117. data/test/testcases/block/05_blockquote/nested.html +10 -0
  118. data/test/testcases/block/05_blockquote/nested.text +6 -0
  119. data/test/testcases/block/05_blockquote/no_newline_at_end.html +4 -0
  120. data/test/testcases/block/05_blockquote/no_newline_at_end.text +2 -0
  121. data/test/testcases/block/05_blockquote/very_long_line.html +3 -0
  122. data/test/testcases/block/05_blockquote/very_long_line.text +1 -0
  123. data/test/testcases/block/05_blockquote/with_code_blocks.html +15 -0
  124. data/test/testcases/block/05_blockquote/with_code_blocks.text +11 -0
  125. data/test/testcases/block/06_codeblock/error.html +4 -0
  126. data/test/testcases/block/06_codeblock/error.text +4 -0
  127. data/test/testcases/block/06_codeblock/lazy.html +4 -0
  128. data/test/testcases/block/06_codeblock/lazy.text +5 -0
  129. data/test/testcases/block/06_codeblock/no_newline_at_end.html +2 -0
  130. data/test/testcases/block/06_codeblock/no_newline_at_end.text +1 -0
  131. data/test/testcases/block/06_codeblock/no_newline_at_end_1.html +2 -0
  132. data/test/testcases/block/06_codeblock/no_newline_at_end_1.text +2 -0
  133. data/test/testcases/block/06_codeblock/normal.html +13 -0
  134. data/test/testcases/block/06_codeblock/normal.text +10 -0
  135. data/test/testcases/block/06_codeblock/tilde_syntax.html +7 -0
  136. data/test/testcases/block/06_codeblock/tilde_syntax.text +9 -0
  137. data/test/testcases/block/06_codeblock/whitespace.html +3 -0
  138. data/test/testcases/block/06_codeblock/whitespace.text +3 -0
  139. data/test/testcases/block/06_codeblock/with_blank_line.html +13 -0
  140. data/test/testcases/block/06_codeblock/with_blank_line.text +12 -0
  141. data/test/testcases/block/06_codeblock/with_eob_marker.html +6 -0
  142. data/test/testcases/block/06_codeblock/with_eob_marker.text +5 -0
  143. data/test/testcases/block/06_codeblock/with_ial.html +6 -0
  144. data/test/testcases/block/06_codeblock/with_ial.text +5 -0
  145. data/test/testcases/block/07_horizontal_rule/error.html +7 -0
  146. data/test/testcases/block/07_horizontal_rule/error.html.19 +7 -0
  147. data/test/testcases/block/07_horizontal_rule/error.text +7 -0
  148. data/test/testcases/block/07_horizontal_rule/normal.html +17 -0
  149. data/test/testcases/block/07_horizontal_rule/normal.text +17 -0
  150. data/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
  151. data/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
  152. data/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
  153. data/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
  154. data/test/testcases/block/08_list/escaping.html +17 -0
  155. data/test/testcases/block/08_list/escaping.text +17 -0
  156. data/test/testcases/block/08_list/item_ial.html +10 -0
  157. data/test/testcases/block/08_list/item_ial.text +8 -0
  158. data/test/testcases/block/08_list/lazy.html +39 -0
  159. data/test/testcases/block/08_list/lazy.text +29 -0
  160. data/test/testcases/block/08_list/list_and_hr.html +9 -0
  161. data/test/testcases/block/08_list/list_and_hr.text +5 -0
  162. data/test/testcases/block/08_list/list_and_others.html +40 -0
  163. data/test/testcases/block/08_list/list_and_others.text +26 -0
  164. data/test/testcases/block/08_list/mixed.html +117 -0
  165. data/test/testcases/block/08_list/mixed.text +66 -0
  166. data/test/testcases/block/08_list/nested.html +17 -0
  167. data/test/testcases/block/08_list/nested.text +7 -0
  168. data/test/testcases/block/08_list/other_first_element.html +39 -0
  169. data/test/testcases/block/08_list/other_first_element.text +18 -0
  170. data/test/testcases/block/08_list/simple_ol.html +19 -0
  171. data/test/testcases/block/08_list/simple_ol.text +13 -0
  172. data/test/testcases/block/08_list/simple_ul.html +48 -0
  173. data/test/testcases/block/08_list/simple_ul.text +36 -0
  174. data/test/testcases/block/08_list/single_item.html +3 -0
  175. data/test/testcases/block/08_list/single_item.text +1 -0
  176. data/test/testcases/block/08_list/special_cases.html +55 -0
  177. data/test/testcases/block/08_list/special_cases.text +35 -0
  178. data/test/testcases/block/09_html/comment.html +18 -0
  179. data/test/testcases/block/09_html/comment.text +15 -0
  180. data/test/testcases/block/09_html/content_model/deflists.html +6 -0
  181. data/test/testcases/block/09_html/content_model/deflists.options +1 -0
  182. data/test/testcases/block/09_html/content_model/deflists.text +6 -0
  183. data/test/testcases/block/09_html/content_model/tables.html +14 -0
  184. data/test/testcases/block/09_html/content_model/tables.options +1 -0
  185. data/test/testcases/block/09_html/content_model/tables.text +14 -0
  186. data/test/testcases/block/09_html/html_and_codeblocks.html +15 -0
  187. data/test/testcases/block/09_html/html_and_codeblocks.options +1 -0
  188. data/test/testcases/block/09_html/html_and_codeblocks.text +13 -0
  189. data/test/testcases/block/09_html/html_and_headers.html +5 -0
  190. data/test/testcases/block/09_html/html_and_headers.text +6 -0
  191. data/test/testcases/block/09_html/html_to_native/code.html +10 -0
  192. data/test/testcases/block/09_html/html_to_native/code.text +9 -0
  193. data/test/testcases/block/09_html/html_to_native/comment.html +7 -0
  194. data/test/testcases/block/09_html/html_to_native/comment.text +8 -0
  195. data/test/testcases/block/09_html/html_to_native/emphasis.html +6 -0
  196. data/test/testcases/block/09_html/html_to_native/emphasis.text +6 -0
  197. data/test/testcases/block/09_html/html_to_native/entity.html +1 -0
  198. data/test/testcases/block/09_html/html_to_native/entity.text +1 -0
  199. data/test/testcases/block/09_html/html_to_native/header.html +6 -0
  200. data/test/testcases/block/09_html/html_to_native/header.options +2 -0
  201. data/test/testcases/block/09_html/html_to_native/header.text +6 -0
  202. data/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
  203. data/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
  204. data/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
  205. data/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
  206. data/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
  207. data/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
  208. data/test/testcases/block/09_html/html_to_native/options +1 -0
  209. data/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
  210. data/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
  211. data/test/testcases/block/09_html/html_to_native/table_normal.html +12 -0
  212. data/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
  213. data/test/testcases/block/09_html/html_to_native/table_simple.html +48 -0
  214. data/test/testcases/block/09_html/html_to_native/table_simple.text +56 -0
  215. data/test/testcases/block/09_html/html_to_native/typography.html +1 -0
  216. data/test/testcases/block/09_html/html_to_native/typography.html.19 +1 -0
  217. data/test/testcases/block/09_html/html_to_native/typography.text +1 -0
  218. data/test/testcases/block/09_html/invalid_html_1.html +5 -0
  219. data/test/testcases/block/09_html/invalid_html_1.text +5 -0
  220. data/test/testcases/block/09_html/invalid_html_2.html +5 -0
  221. data/test/testcases/block/09_html/invalid_html_2.text +5 -0
  222. data/test/testcases/block/09_html/markdown_attr.html +38 -0
  223. data/test/testcases/block/09_html/markdown_attr.text +38 -0
  224. data/test/testcases/block/09_html/not_parsed.html +24 -0
  225. data/test/testcases/block/09_html/not_parsed.text +24 -0
  226. data/test/testcases/block/09_html/parse_as_raw.html +35 -0
  227. data/test/testcases/block/09_html/parse_as_raw.htmlinput +34 -0
  228. data/test/testcases/block/09_html/parse_as_raw.options +1 -0
  229. data/test/testcases/block/09_html/parse_as_raw.text +33 -0
  230. data/test/testcases/block/09_html/parse_as_span.html +12 -0
  231. data/test/testcases/block/09_html/parse_as_span.htmlinput +12 -0
  232. data/test/testcases/block/09_html/parse_as_span.options +1 -0
  233. data/test/testcases/block/09_html/parse_as_span.text +9 -0
  234. data/test/testcases/block/09_html/parse_block_html.html +21 -0
  235. data/test/testcases/block/09_html/parse_block_html.options +1 -0
  236. data/test/testcases/block/09_html/parse_block_html.text +17 -0
  237. data/test/testcases/block/09_html/processing_instruction.html +13 -0
  238. data/test/testcases/block/09_html/processing_instruction.text +12 -0
  239. data/test/testcases/block/09_html/simple.html +64 -0
  240. data/test/testcases/block/09_html/simple.html.19 +64 -0
  241. data/test/testcases/block/09_html/simple.options +1 -0
  242. data/test/testcases/block/09_html/simple.text +59 -0
  243. data/test/testcases/block/10_ald/simple.html +2 -0
  244. data/test/testcases/block/10_ald/simple.text +8 -0
  245. data/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
  246. data/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
  247. data/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
  248. data/test/testcases/block/11_ial/nested.html +11 -0
  249. data/test/testcases/block/11_ial/nested.text +15 -0
  250. data/test/testcases/block/11_ial/simple.html +25 -0
  251. data/test/testcases/block/11_ial/simple.text +34 -0
  252. data/test/testcases/block/12_extension/comment.html +8 -0
  253. data/test/testcases/block/12_extension/comment.text +12 -0
  254. data/test/testcases/block/12_extension/ignored.html +8 -0
  255. data/test/testcases/block/12_extension/ignored.text +8 -0
  256. data/test/testcases/block/12_extension/nomarkdown.html +10 -0
  257. data/test/testcases/block/12_extension/nomarkdown.kramdown +20 -0
  258. data/test/testcases/block/12_extension/nomarkdown.latex +13 -0
  259. data/test/testcases/block/12_extension/nomarkdown.text +21 -0
  260. data/test/testcases/block/12_extension/options.html +21 -0
  261. data/test/testcases/block/12_extension/options.text +21 -0
  262. data/test/testcases/block/12_extension/options2.html +10 -0
  263. data/test/testcases/block/12_extension/options2.text +5 -0
  264. data/test/testcases/block/12_extension/options3.html +7 -0
  265. data/test/testcases/block/12_extension/options3.text +7 -0
  266. data/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
  267. data/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
  268. data/test/testcases/block/13_definition_list/item_ial.html +12 -0
  269. data/test/testcases/block/13_definition_list/item_ial.text +8 -0
  270. data/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
  271. data/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
  272. data/test/testcases/block/13_definition_list/no_def_list.html +2 -0
  273. data/test/testcases/block/13_definition_list/no_def_list.text +2 -0
  274. data/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
  275. data/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
  276. data/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
  277. data/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
  278. data/test/testcases/block/13_definition_list/simple.html +8 -0
  279. data/test/testcases/block/13_definition_list/simple.text +7 -0
  280. data/test/testcases/block/13_definition_list/styled_terms.html +4 -0
  281. data/test/testcases/block/13_definition_list/styled_terms.text +2 -0
  282. data/test/testcases/block/13_definition_list/too_much_space.html +3 -0
  283. data/test/testcases/block/13_definition_list/too_much_space.text +4 -0
  284. data/test/testcases/block/13_definition_list/with_blocks.html +38 -0
  285. data/test/testcases/block/13_definition_list/with_blocks.text +24 -0
  286. data/test/testcases/block/14_table/errors.html +8 -0
  287. data/test/testcases/block/14_table/errors.text +9 -0
  288. data/test/testcases/block/14_table/escaping.html +52 -0
  289. data/test/testcases/block/14_table/escaping.text +19 -0
  290. data/test/testcases/block/14_table/footer.html +65 -0
  291. data/test/testcases/block/14_table/footer.text +25 -0
  292. data/test/testcases/block/14_table/header.html +96 -0
  293. data/test/testcases/block/14_table/header.text +32 -0
  294. data/test/testcases/block/14_table/no_table.html +3 -0
  295. data/test/testcases/block/14_table/no_table.text +3 -0
  296. data/test/testcases/block/14_table/simple.html +177 -0
  297. data/test/testcases/block/14_table/simple.html.19 +177 -0
  298. data/test/testcases/block/14_table/simple.text +49 -0
  299. data/test/testcases/block/14_table/table_with_footnote.html +25 -0
  300. data/test/testcases/block/14_table/table_with_footnote.latex +11 -0
  301. data/test/testcases/block/14_table/table_with_footnote.text +6 -0
  302. data/test/testcases/block/15_math/normal.html +26 -0
  303. data/test/testcases/block/15_math/normal.text +28 -0
  304. data/test/testcases/block/16_toc/no_toc.html +33 -0
  305. data/test/testcases/block/16_toc/no_toc.options +1 -0
  306. data/test/testcases/block/16_toc/no_toc.text +16 -0
  307. data/test/testcases/block/16_toc/toc_levels.html +24 -0
  308. data/test/testcases/block/16_toc/toc_levels.options +1 -0
  309. data/test/testcases/block/16_toc/toc_levels.text +16 -0
  310. data/test/testcases/block/17_github_codeblock/backtick_syntax.html +7 -0
  311. data/test/testcases/block/17_github_codeblock/backtick_syntax.text +9 -0
  312. data/test/testcases/block/17_github_codeblock/error.html +4 -0
  313. data/test/testcases/block/17_github_codeblock/error.text +4 -0
  314. data/test/testcases/block/17_github_codeblock/no_newline_at_end.html +2 -0
  315. data/test/testcases/block/17_github_codeblock/no_newline_at_end.text +3 -0
  316. data/test/testcases/encoding.html +46 -0
  317. data/test/testcases/encoding.text +28 -0
  318. data/test/testcases/span/01_link/empty.html +5 -0
  319. data/test/testcases/span/01_link/empty.text +5 -0
  320. data/test/testcases/span/01_link/image_in_a.html +5 -0
  321. data/test/testcases/span/01_link/image_in_a.text +5 -0
  322. data/test/testcases/span/01_link/imagelinks.html +14 -0
  323. data/test/testcases/span/01_link/imagelinks.text +16 -0
  324. data/test/testcases/span/01_link/inline.html +46 -0
  325. data/test/testcases/span/01_link/inline.html.19 +46 -0
  326. data/test/testcases/span/01_link/inline.text +48 -0
  327. data/test/testcases/span/01_link/link_defs.html +9 -0
  328. data/test/testcases/span/01_link/link_defs.text +26 -0
  329. data/test/testcases/span/01_link/links_with_angle_brackets.html +3 -0
  330. data/test/testcases/span/01_link/links_with_angle_brackets.text +3 -0
  331. data/test/testcases/span/01_link/reference.html +36 -0
  332. data/test/testcases/span/01_link/reference.html.19 +36 -0
  333. data/test/testcases/span/01_link/reference.text +50 -0
  334. data/test/testcases/span/02_emphasis/empty.html +3 -0
  335. data/test/testcases/span/02_emphasis/empty.text +3 -0
  336. data/test/testcases/span/02_emphasis/errors.html +9 -0
  337. data/test/testcases/span/02_emphasis/errors.text +9 -0
  338. data/test/testcases/span/02_emphasis/nesting.html +38 -0
  339. data/test/testcases/span/02_emphasis/nesting.text +33 -0
  340. data/test/testcases/span/02_emphasis/normal.html +46 -0
  341. data/test/testcases/span/02_emphasis/normal.text +46 -0
  342. data/test/testcases/span/03_codespan/empty.html +5 -0
  343. data/test/testcases/span/03_codespan/empty.text +5 -0
  344. data/test/testcases/span/03_codespan/errors.html +1 -0
  345. data/test/testcases/span/03_codespan/errors.text +1 -0
  346. data/test/testcases/span/03_codespan/highlighting.html +1 -0
  347. data/test/testcases/span/03_codespan/highlighting.text +1 -0
  348. data/test/testcases/span/03_codespan/normal.html +16 -0
  349. data/test/testcases/span/03_codespan/normal.text +16 -0
  350. data/test/testcases/span/04_footnote/definitions.html +17 -0
  351. data/test/testcases/span/04_footnote/definitions.latex +17 -0
  352. data/test/testcases/span/04_footnote/definitions.text +24 -0
  353. data/test/testcases/span/04_footnote/footnote_nr.html +12 -0
  354. data/test/testcases/span/04_footnote/footnote_nr.latex +2 -0
  355. data/test/testcases/span/04_footnote/footnote_nr.options +1 -0
  356. data/test/testcases/span/04_footnote/footnote_nr.text +4 -0
  357. data/test/testcases/span/04_footnote/markers.html +46 -0
  358. data/test/testcases/span/04_footnote/markers.latex +23 -0
  359. data/test/testcases/span/04_footnote/markers.text +26 -0
  360. data/test/testcases/span/05_html/across_lines.html +1 -0
  361. data/test/testcases/span/05_html/across_lines.text +2 -0
  362. data/test/testcases/span/05_html/invalid.html +1 -0
  363. data/test/testcases/span/05_html/invalid.text +1 -0
  364. data/test/testcases/span/05_html/link_with_mailto.html +1 -0
  365. data/test/testcases/span/05_html/link_with_mailto.text +1 -0
  366. data/test/testcases/span/05_html/markdown_attr.html +6 -0
  367. data/test/testcases/span/05_html/markdown_attr.text +6 -0
  368. data/test/testcases/span/05_html/normal.html +34 -0
  369. data/test/testcases/span/05_html/normal.text +34 -0
  370. data/test/testcases/span/abbreviations/abbrev.html +8 -0
  371. data/test/testcases/span/abbreviations/abbrev.text +15 -0
  372. data/test/testcases/span/abbreviations/abbrev_defs.html +2 -0
  373. data/test/testcases/span/abbreviations/abbrev_defs.text +5 -0
  374. data/test/testcases/span/autolinks/url_links.html +12 -0
  375. data/test/testcases/span/autolinks/url_links.text +12 -0
  376. data/test/testcases/span/escaped_chars/normal.html +47 -0
  377. data/test/testcases/span/escaped_chars/normal.text +47 -0
  378. data/test/testcases/span/extension/comment.html +6 -0
  379. data/test/testcases/span/extension/comment.text +6 -0
  380. data/test/testcases/span/extension/ignored.html +1 -0
  381. data/test/testcases/span/extension/ignored.text +1 -0
  382. data/test/testcases/span/extension/nomarkdown.html +1 -0
  383. data/test/testcases/span/extension/nomarkdown.text +1 -0
  384. data/test/testcases/span/extension/options.html +1 -0
  385. data/test/testcases/span/extension/options.text +1 -0
  386. data/test/testcases/span/ial/simple.html +6 -0
  387. data/test/testcases/span/ial/simple.text +6 -0
  388. data/test/testcases/span/line_breaks/normal.html +11 -0
  389. data/test/testcases/span/line_breaks/normal.latex +12 -0
  390. data/test/testcases/span/line_breaks/normal.text +11 -0
  391. data/test/testcases/span/math/normal.html +5 -0
  392. data/test/testcases/span/math/normal.text +5 -0
  393. data/test/testcases/span/text_substitutions/entities.html +6 -0
  394. data/test/testcases/span/text_substitutions/entities.options +1 -0
  395. data/test/testcases/span/text_substitutions/entities.text +6 -0
  396. data/test/testcases/span/text_substitutions/entities_as_char.html +1 -0
  397. data/test/testcases/span/text_substitutions/entities_as_char.html.19 +1 -0
  398. data/test/testcases/span/text_substitutions/entities_as_char.options +1 -0
  399. data/test/testcases/span/text_substitutions/entities_as_char.text +1 -0
  400. data/test/testcases/span/text_substitutions/entities_as_input.html +1 -0
  401. data/test/testcases/span/text_substitutions/entities_as_input.options +1 -0
  402. data/test/testcases/span/text_substitutions/entities_as_input.text +1 -0
  403. data/test/testcases/span/text_substitutions/entities_numeric.html +1 -0
  404. data/test/testcases/span/text_substitutions/entities_numeric.options +1 -0
  405. data/test/testcases/span/text_substitutions/entities_numeric.text +1 -0
  406. data/test/testcases/span/text_substitutions/entities_symbolic.html +1 -0
  407. data/test/testcases/span/text_substitutions/entities_symbolic.options +1 -0
  408. data/test/testcases/span/text_substitutions/entities_symbolic.text +1 -0
  409. data/test/testcases/span/text_substitutions/greaterthan.html +1 -0
  410. data/test/testcases/span/text_substitutions/greaterthan.text +1 -0
  411. data/test/testcases/span/text_substitutions/lowerthan.html +1 -0
  412. data/test/testcases/span/text_substitutions/lowerthan.text +1 -0
  413. data/test/testcases/span/text_substitutions/typography.html +18 -0
  414. data/test/testcases/span/text_substitutions/typography.html.19 +18 -0
  415. data/test/testcases/span/text_substitutions/typography.text +18 -0
  416. metadata +817 -0
@@ -0,0 +1,80 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}" lang="{lang:}">
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <meta name="author" content="Thomas Leitner" />
6
+ <meta name="copyright" content="2009-2010 Thomas Leitner" />
7
+ <meta name="description" content="kramdown is a fast, pure-Ruby Markdown-superset converter" />
8
+ <meta name="keywords" content="ruby, kramdown, markdown, text markup" />
9
+ <link href="{relocatable: default.css}" type="text/css" rel="stylesheet" media="screen,projection" />
10
+ <link href="{relocatable: news.atom}" type="application/atom+xml" rel="alternate" />
11
+ <script src="http://kramdown.rubyforge.org/MathJax/MathJax.js" type="text/javascript"></script>
12
+ <title>{title:} | kramdown</title>
13
+ </head>
14
+ <body>
15
+ <div id="fullheader">
16
+ <div id="header">
17
+ <h1 id="logo"><a href="{relocatable: /}" title="Homepage">kramdown <span class='slogan'>fast, pure-Ruby Markdown-superset converter</span></a></h1>
18
+ </div>
19
+ <div id="donation">
20
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
21
+ <input type="hidden" name="cmd" value="_s-xclick" />
22
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHJwYJKoZIhvcNAQcEoIIHGDCCBxQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYDA8HEgfduoLW7LANqmfG9shb8sk23qWHt1vJ65J7bcOHFW1Hw/aZV7O2Xf2hRtVmHBQemuFBMVCLFFYn1Tj667ay65xPWrbtNdOcxJ6diwwVcrxMJ/EyS7niUKuTfujgmq5ra9CgNy84WSa0Cw/sWSMrK6XMX9brALPBcKbB003TELMAkGBSsOAwIaBQAwgaQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQITt+KFiwA4NOAgYBJEwBt4G0KjfWMn428qsUqj7nBGl9dhhOT9FsHPoKHm5lmzadeIhtu7vPwqaH5cZAbE/nZBhkV9/MdgWCt9kMkDLD4Jq+TGLa4RDK+ltxErnPNgr9TYvBOGPAoYTXvA12w+KUewhV1cB/gSdz43oHrBPAyO6x4ZWUhndD2+yqZhKCCA4cwggODMIIC7KADAgECAgEAMA0GCSqGSIb3DQEBBQUAMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTAeFw0wNDAyMTMxMDEzMTVaFw0zNTAyMTMxMDEzMTVaMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwUdO3fxEzEtcnI7ZKZL412XvZPugoni7i7D7prCe0AtaHTc97CYgm7NsAtJyxNLixmhLV8pyIEaiHXWAh8fPKW+R017+EmXrr9EaquPmsVvTywAAE1PMNOKqo2kl4Gxiz9zZqIajOm1fZGWcGS0f5JQ2kBqNbvbg2/Za+GJ/qwUCAwEAAaOB7jCB6zAdBgNVHQ4EFgQUlp98u8ZvF71ZP1LXChvsENZklGswgbsGA1UdIwSBszCBsIAUlp98u8ZvF71ZP1LXChvsENZklGuhgZSkgZEwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMDcxOTA2MzUwOVowIwYJKoZIhvcNAQkEMRYEFBdLGCmffPW6PMR/W24T+7ktQe1iMA0GCSqGSIb3DQEBAQUABIGAdn5PO7OJuHq/YpWaWKkJMDNhCqAyRyWpaM4LMQXzyA+ADoKvPnpgHrCdJpvB01L/Wk2apJ59CpB7iFerXh6QRgX85lE6HFl3C+GDRikabulgIn0F/1SMeUuvuRZ8g//Z3xcktOzdchB65K2LyUowAV8rpeWGmt8JFNwOZbeqcmw=-----END PKCS7-----
23
+ " />
24
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" />
25
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
26
+ </form>
27
+ </div>
28
+ </div>
29
+ <div id="fullnav">
30
+ <div id="nav">
31
+ {menu: {max_levels: 1, used_nodes: files}}
32
+ </div>
33
+ </div>
34
+ <div id="fullintro">
35
+ <% if context.content_node.node_info[:page].blocks.has_key?('intro') %>
36
+ <div id="intro">
37
+ <div id="intro-in">
38
+ <webgen:block name="intro" node="first" />
39
+ </div>
40
+ </div>
41
+ <% end %>
42
+ </div>
43
+
44
+ <div id="container">
45
+
46
+ <div id="sidebar"><div id="sidebar-content">
47
+ <webgen:block name="sidebar" node="first" notfound="ignore" />
48
+ </div></div>
49
+
50
+ <div id="main">
51
+ <webgen:block name="content" />
52
+ <div class="clear"></div>
53
+ </div>
54
+
55
+ </div>
56
+
57
+ <div id="footer" class="shadow">
58
+ <div class="float-left">Copyright © 2009 Thomas Leitner</div>
59
+ <div class="float-right">Based on a design by <a href="http://www.davidkohout.cz" title="Original template design">David Kohout</a></div>
60
+ </div>
61
+
62
+ <!-- Start of StatCounter Code -->
63
+ <script type="text/javascript">
64
+ var sc_project=4267845;
65
+ var sc_invisible=1;
66
+ var sc_partition=46;
67
+ var sc_click_stat=1;
68
+ var sc_security="41321455";
69
+ </script>
70
+
71
+ <script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script>
72
+ <noscript><div class="statcounter">
73
+ <a title="web counter" class="statcounter" href="http://www.statcounter.com/free_hit_counter.html">
74
+ <img class="statcounter" src="http://c.statcounter.com/4267845/0/41321455/1/" alt="web counter" />
75
+ </a>
76
+ </div></noscript>
77
+ <!-- End of StatCounter Code -->
78
+
79
+ </body>
80
+ </html>
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: Documentation
3
+ in_menu: true
4
+ sort_info: 7
5
+ ---
6
+ ## Overview
7
+
8
+ kramdown is first and foremost a library for converting text written in a superset of Markdown to
9
+ HTML. However, due to its modular architecture it is able to support additional input and output
10
+ formats. The following input and output formats are currently supported:
11
+
12
+ * Input: [kramdown](parser/kramdown.html) (a superset of Markdown), [Markdown](parser/markdown.html), [html](parser/html.html)
13
+ * Output: [HTML](converter/html.html), [LaTeX](converter/latex.html), [kramdown](converter/kramdown.html)
14
+
15
+
16
+ ## Usage
17
+
18
+ {:ruby: lang='ruby'}
19
+
20
+ The kramdown package provides two ways for using it:
21
+
22
+ * **As a library**
23
+
24
+ kramdown uses basically the same API as [RedCloth], [BlueCloth] and [Maruku]:
25
+
26
+ require 'kramdown'
27
+
28
+ puts Kramdown::Document.new(text).to_html
29
+ {:ruby}
30
+
31
+ The second parameter to the `new` call is an options hash for (de)activating certain features. For
32
+ example, to disable automatic header ID generation, you can do the following:
33
+
34
+ puts Kramdown::Document.new(text, :auto_ids => false).to_html
35
+ {:ruby}
36
+
37
+ The default parser used is `kramdown`, however, you can select a different one with the `:input`
38
+ option:
39
+
40
+ puts Kramdown::Document.new(text, :input => 'html').to_latex
41
+ {:ruby}
42
+
43
+ You can also reuse the created document object to produce multiple outputs:
44
+
45
+ doc = Kramdown::Document.new(text, :input => 'html')
46
+ puts doc.to_html
47
+ puts doc.to_latex
48
+ {:ruby}
49
+
50
+ More information on how to use or extend kramdown can be found in the [API
51
+ documentation](rdoc/index.html)!
52
+
53
+ * **As an application**
54
+
55
+ Together with the library files a binary called `kramdown` is shipped which can be used to convert
56
+ text in any supported input format to any supported output format. It either reads from the files
57
+ specified as the command line arguments or from the standard input. For example:
58
+
59
+ kramdown path/to/kramdown/doc/syntax.page
60
+
61
+ The input and output formats as well as all available kramdown options are supported through
62
+ command line switches.
63
+
64
+
65
+ ## Tests
66
+
67
+ kramdown uses various test suites to verify the correct working of the parsers and converters. For
68
+ more information, have a look at the [tests document](tests.html).
69
+
70
+
71
+ {include_file: doc/links.markdown}
data/doc/index.page ADDED
@@ -0,0 +1,98 @@
1
+ ---
2
+ title: Home
3
+ in_menu: true
4
+ sort_info: 1
5
+ ---
6
+ ## Overview
7
+
8
+ If you want to get started with kramdown, have a look at the [installation page](installation.html)
9
+ to see how you can install it on your system. Then look through the
10
+ [documentation](documentation.html) for finding information about how to actually use kramdown and
11
+ its parsers/converters. The [syntax page](syntax.html) provides a detailed description of the
12
+ superset of Markdown which kramdown supports.
13
+
14
+ {tikz:: path: overview.png
15
+ img_attr: {style: 'background:transparent'}
16
+ libraries: [mindmap, trees, arrows]
17
+ transparent: true
18
+ resolution: 300 100
19
+ opts: |
20
+ mindmap, concept color=black, text=white,
21
+ root concept/.append style={font=\Large},
22
+ level 1 concept/.append style={font=\Large, minimum size=2.6cm},
23
+ level 2 concept/.append style={font=\Large},
24
+ }
25
+ \node[concept, font=\Large] (lib) {kramdown's internal representation}
26
+ child[concept color=orange, grow=140, ->] {node[concept] (i-kramdown) {kramdown}}
27
+ child[concept color=orange, grow=180] {node[concept] (i-html) {HTML}}
28
+ child[concept color=orange, grow=220] {node[concept] (i-markdown) {Markdown}}
29
+ child[concept color=green!50!black, grow=40] {node[concept] (o-html) {HTML}}
30
+ child[concept color=green!50!black, grow=0] {node[concept] (o-kramdown) {kramdown}}
31
+ child[concept color=green!50!black, grow=-40] {
32
+ node[concept] (o-latex) {\LaTeX}
33
+ child[grow=0] {
34
+ node[concept] (o-latex-pdf) {PDF}
35
+ }
36
+ }
37
+ child[concept color=green!50!black, grow=-40] {node[concept] {\LaTeX}}
38
+ ;
39
+ \draw [dash pattern=on 0pt off 2pt,line width=5pt,arrows=-angle 60,shorten >=15pt,shorten <=10pt,color=orange]
40
+ (i-kramdown) edge(lib)
41
+ (i-markdown) edge(lib)
42
+ (i-html) edge (lib);
43
+ \draw [dash pattern=on 0pt off 2pt,line width=5pt,arrows=-angle 60,shorten >=10pt,shorten <=15pt,color=green!50!black]
44
+ (lib) edge(o-html)
45
+ (lib) edge (o-kramdown)
46
+ (lib) edge (o-latex);
47
+ {tikz}
48
+ {: style="text-align: center"}
49
+
50
+
51
+ ## Bugs, Forums, Mailing Lists
52
+
53
+ If you have found a bug, you should [report it here][bug_report]. Also, there are [forums][forum]
54
+ and [mailing lists][ml] available if you have any questions!
55
+
56
+ [bug_report]: http://rubyforge.org/tracker/?atid=28673&group_id=7403&func=browse
57
+ [forum]: http://rubyforge.org/forum/?group_id=7403
58
+ [ml]: http://rubyforge.org/mail/?group_id=7403
59
+
60
+
61
+ ## Thanks
62
+
63
+ kramdown would not be possible without the prior work of many other people. I want to thank everyone
64
+ involved with making Markdown such a nice markup language and especially the developers of other
65
+ Markdown implementations because kramdown borrowed many ideas from existing packages.
66
+
67
+
68
+ ## Author
69
+
70
+ * Thomas Leitner
71
+ * e-Mail: <t_leitner@gmx.at>
72
+ * GPG Key-Id: 0xB2D0A854
73
+
74
+
75
+ [PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
76
+ [Maruku]: http://maruku.rubyforge.org
77
+ [BlueCloth]: http://www.deveiate.org/projects/BlueCloth
78
+
79
+
80
+ --- name:intro
81
+
82
+ ## Welcome to the kramdown site
83
+
84
+ **kramdown** (sic, not Kramdown or KramDown, just kramdown) is a *free* GPL-licensed
85
+ [Ruby](http://www.ruby-lang.org) library for parsing and converting a superset of Markdown. It is
86
+ completely written in Ruby, supports standard Markdown (with some minor modifications) and various
87
+ extensions that have been made popular by the [PHP Markdown Extra] package and [Maruku].
88
+
89
+ It is probably the fastest pure-Ruby Markdown converter available (January 2011), being about 4x
90
+ faster than [Maruku] and about 5x faster than [BlueFeather].
91
+
92
+ <p class="a-center">
93
+ The latest version of kramdown is <b>0.13.4</b> and it was released on <b>2011-12-16</b>.
94
+ </p>
95
+
96
+ [PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
97
+ [Maruku]: http://maruku.rubyforge.org
98
+ [BlueFeather]: http://ruby.morphball.net/bluefeather/index_en.html
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: Download &amp; Installation
3
+ in_menu: true
4
+ sort_info: 5
5
+ ---
6
+ # Download & Installation
7
+
8
+ ## Dependencies
9
+
10
+ Since kramdown is written in Ruby, you just need the [Ruby interpreter](http://www.ruby-lang.org),
11
+ version 1.8.5, 1.8.6, 1.8.7 or 1.9.2. There are no other dependencies.
12
+
13
+
14
+ ## Compatibility Notes
15
+
16
+ kramdown should work on any platform which supports Ruby. It has been successfully tested on the
17
+ following platforms:
18
+
19
+ * Linux with Ruby 1.8.5, 1.8.6, 1.8.7, 1.9.2 and jruby 1.5.0.
20
+
21
+ See the platform specific installation notes for more information!
22
+
23
+
24
+ ## Platform Specific Installation Instructions
25
+
26
+ ### Linux
27
+
28
+ There are a variety of Linux distributions out there with different package management systems. So
29
+ we will focus on instructions for Ubuntu 9.04 here (which should probably also work for any newer
30
+ Ubuntu version or any recent Debian based distribution).
31
+
32
+ After running the following commands, kramdown is installed and ready to use:
33
+
34
+ sudo aptitude install ruby rubygems
35
+ sudo gem1.8 install kramdown
36
+
37
+ > You will also need to add `export PATH=$PATH:/var/lib/gems/1.8/bin` to your `~/.bashrc` because
38
+ > this is the binary path the executable files get installed to.
39
+
40
+
41
+ ### Mac OS X
42
+
43
+ Mac OS X Snow Leopard comes with Ruby and Rubygems preinstalled. So installing kramdown is as easy
44
+ as running:
45
+
46
+ sudo gem install kramdown
47
+
48
+
49
+ ### Windows
50
+
51
+ You need to install Ruby first. This can easily be done by using the [RubyInstaller] - just download
52
+ the installation binary and run it. After that open a command shell (select `Start -> Run...`, then
53
+ enter `cmd` and click on `Ok`) and type in the following:
54
+
55
+ gem install kramdown
56
+
57
+ [RubyInstaller]: http://rubyinstaller.org
58
+
59
+
60
+ ## Generic Installation Instructions
61
+
62
+
63
+ ### Using Rubygems
64
+
65
+ If you are using Rubygems, installing the latest version of kramdown is as simple as executing
66
+
67
+ gem install kramdown
68
+
69
+
70
+ ### Manual Installation
71
+
72
+ The latest version of kramdown can always be downloaded as `.tar.gz` or `.zip` from [its files
73
+ section on Rubyforge](http://rubyforge.org/frs/?group_id=7403). After the download the package needs
74
+ to be decompressed and then you can install kramdown using the included `setup.rb` installation
75
+ method:
76
+
77
+ $ ruby setup.rb config
78
+ $ ruby setup.rb setup
79
+ $ ruby setup.rb install
80
+
81
+
82
+ ### Using the repository version
83
+
84
+ kramdown uses git as its versioning system and kramdown's repository is hosted on GitHub. The
85
+ repository always contains a clean state of the current development version of kramdown. To check
86
+ out kramdown use the following command:
87
+
88
+ git clone git://github.com/gettalong/kramdown.git
@@ -0,0 +1,6 @@
1
+ [Maruku]: http://maruku.rubyforge.org
2
+ [PHP Markdown Extra]: http://michelf.com/projects/php-markdown/extra/
3
+ [Pandoc]: http://johnmacfarlane.net/pandoc/
4
+ [MathJax]: http://www.mathjax.org
5
+ [BlueCloth]: http://deveiate.org/projects/BlueCloth
6
+ [RedCloth]: http://redcloth.org/
data/doc/news.feed ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: kramdown News
3
+ description: kramdown - a fast, pure Ruby Markdown-superset converter
4
+ site_url: http://kramdown.rubyforge.org/
5
+ author: Thomas Leitner
6
+ author_url: http://kramdown.rubyforge.org
7
+ number_of_entries: 10
8
+ rss: false
9
+ entries: [news/*.html]
10
+
data/doc/news.page ADDED
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: News
3
+ in_menu: true
4
+ sort_info: 30
5
+ --- pipeline:tags,blocks,fragments
6
+
7
+ <h1>News</h1>
8
+
9
+ <a href="{relocatable: news.atom}">Atom-Feed</a>
10
+
11
+ <webgen:block name="newsdata" node="current" />
12
+
13
+ --- name:newsdata pipeline:erb
14
+ <%
15
+ context.content_node.tree.node_access[:alcn].select do |na,no|
16
+ na =~ /\/news\/.+/ && no.is_file?
17
+ end.collect {|na,no| no}.sort.reverse.each do |node|
18
+ context.options['contentprocessor.kramdown.options'] = {:auto_id_prefix => node.lcn.tr('.', '-')}
19
+ %>
20
+
21
+ <div class='news-item'>
22
+ <div class="news-date float-right">
23
+ Published on <%= node['created_at'].strftime("%A, %d %B %Y") %>
24
+ </div>
25
+ <%= context.render_block(:name => 'content', :chain => [node]) %>
26
+ </div>
27
+
28
+ <% end %>
data/doc/quickref.page ADDED
@@ -0,0 +1,585 @@
1
+ ---
2
+ title: Quick Reference
3
+ in_menu: true
4
+ sort_info: 9
5
+ --- name:sidebar
6
+ <h1>Contents</h1>
7
+
8
+ {menu: {used_nodes: fragments, min_levels: 4, max_levels: 6}}
9
+ --- name:content
10
+ # Quick Reference
11
+
12
+ Below are examples of all available structural elements that can be used in a kramdown text. Since
13
+ the kramdown syntax is a superset of the Markdown syntax, only a small part of the available syntax
14
+ is not available in standard Markdown syntax. Note, that only the most basic syntax information is
15
+ given. However, a link to the detailed syntax for each element is provided (which also details the
16
+ differences to the standard Markdown syntax). The quick reference is for version **<%=
17
+ ::Kramdown::VERSION %>** of the syntax documentation.
18
+
19
+ kramdown has two main classes of elements: block and span-level elements. Block-level elements are
20
+ used to create paragraphs, headers, lists and so on whereas span-level elements are used to markup
21
+ text phrases as emphasized, as a link and so on.
22
+
23
+ All examples below feature the kramdown source, the converted HTML source (shown when hovering over
24
+ the kramdown source) and the output as it appears in the browser. This looks like this:
25
+
26
+ <div class="kdexample">
27
+ <pre class="kdexample-before"><code>kramdown example code</code></pre>
28
+ <pre class="kdexample-after-source"><code>Example code converted to HTML</code></pre>
29
+ <div class="kdexample-after-live" style="clear:none">
30
+ Live browser view of example code
31
+ </div>
32
+ </div>
33
+ <div class="clear"></div>
34
+
35
+
36
+ # Block-level Elements - Main Structural Elements
37
+
38
+ ## Paragraphs
39
+
40
+ {kdlink: {oid: paragraphs, part: "paragraphs"}}
41
+
42
+ Consecutive lines of text are considered to be one paragraph. As with other block level elements you
43
+ have to add a blank line to separate it from the following block-level element:
44
+
45
+ {kdexample::}
46
+ The first paragraph.
47
+
48
+ Another paragraph
49
+ {kdexample}
50
+
51
+ Explicit line breaks in a paragraph can be made by using two spaces or two backslashes at the end of a line:
52
+
53
+ {kdexample::}
54
+ This is a paragraph
55
+ which contains a hard line break.
56
+ {kdexample}
57
+
58
+
59
+ ## Headers
60
+
61
+ {kdlink: {oid: headers, part: "headers"}}
62
+
63
+ kramdown supports Setext style headers and atx style headers. A header must always be preceded by a
64
+ blank line except at the beginning of the document:
65
+
66
+
67
+ {kdexample::}
68
+ First level header
69
+ ==================
70
+
71
+ Second level header
72
+ -------------------
73
+ {kdexample}
74
+
75
+ {kdexample::}
76
+ # H1 header
77
+
78
+ ## H2 header
79
+
80
+ ### H3 header
81
+
82
+ #### H4 header
83
+
84
+ ##### H5 header
85
+
86
+ ###### H6 header
87
+ {kdexample}
88
+
89
+ If you set the option `auto_ids` to `false` (for example, by using the `options` extension, see
90
+ [Extensions](#extensions)), then the automatic header ID generation is turned off:
91
+
92
+ {kdexample::}
93
+ {:options auto_ids="false" /}
94
+
95
+ # A header without an ID
96
+ {kdexample}
97
+
98
+
99
+ ## Blockquotes
100
+
101
+ {kdlink: {oid: blockquotes, part: "blockquotes"}}
102
+
103
+ A blockquote is started using the `>` marker followed by an optional space; all following lines that
104
+ are also started with the blockquote marker belong to the blockquote. You can use any block-level
105
+ elements inside a blockquote:
106
+
107
+ {kdexample::}
108
+ > A sample blockquote.
109
+ >
110
+ > >Nested blockquotes are
111
+ > >also possible.
112
+ >
113
+ > ## Headers work too
114
+ > This is the outer quote again.
115
+ {kdexample}
116
+
117
+ You may also be lazy with the `>` markers as long as there is no blank line:
118
+
119
+ {kdexample::}
120
+ > This is a blockquote
121
+ continued on this
122
+ and this line.
123
+
124
+ But this is a separate paragraph.
125
+ {kdexample}
126
+
127
+ ## Code Blocks
128
+
129
+ {kdlink: {oid: code-blocks, part: "code blocks"}}
130
+
131
+ kramdown supports two different code block styles. One uses lines indented with either four spaces
132
+ or one tab whereas the other uses lines with tilde characters as delimiters -- therefore the content
133
+ does not need to be indented:
134
+
135
+ {kdexample::}
136
+ This is a sample code block.
137
+
138
+ Continued here.
139
+ {kdexample}
140
+
141
+ {kdexample::}
142
+ ~~~~~~
143
+ This is also a code block.
144
+ ~~~
145
+ Ending lines must have at least as
146
+ many tildes as the starting line.
147
+ ~~~~~~~~~~~~
148
+ {kdexample}
149
+
150
+
151
+ ## Horizontal Rules
152
+
153
+ {kdlink: {oid: horizontal-rules, part: "horizontal rules"}}
154
+
155
+ It is easy to insert a horizontal rule in kramdown: just use three or more asterisks, dashes or
156
+ underscores, optionally separated by spaces or tabs, on an otherwise blank line:
157
+
158
+ {kdexample::}
159
+ * * *
160
+
161
+ \---
162
+
163
+ _ _ _ _
164
+
165
+ ---------------
166
+ {kdexample}
167
+
168
+
169
+ ## Lists
170
+
171
+ {kdlink: {oid: lists, part: "lists"}}
172
+
173
+ kramdown supports ordered and unordered lists. Ordered lists are started by using a number followed
174
+ by a period, a space and then the list item text. The content of a list item consists of block-level
175
+ elements. All lines which have the same indent as the text of the line with the list marker belong
176
+ to the list item:
177
+
178
+ {kdexample::}
179
+ 1. This is a list item
180
+ 2. And another item
181
+ 2. And the third one
182
+ with additional text
183
+ {kdexample}
184
+
185
+ As with block quotes, you may be lazy when using the list item marker:
186
+
187
+ {kdexample::}
188
+ * A list item
189
+ with additional text
190
+ {kdexample}
191
+
192
+ As the content consists of block-level elements you can do things like the following:
193
+
194
+ {kdexample::}
195
+ 1. This is a list item
196
+
197
+ > with a blockquote
198
+
199
+ # And a header
200
+
201
+ 2. Followed by another item
202
+ {kdexample}
203
+
204
+ Nested lists are also easy to create:
205
+
206
+ {kdexample::}
207
+ 1. Item one
208
+ 1. sub item one
209
+ 2. sub item two
210
+ 3. sub item three
211
+ 2. Item two
212
+ {kdexample}
213
+
214
+ Lists can occur directly after other block-level elements, however, there has to be at least one
215
+ blank line if you want to follow a paragraph with a list:
216
+
217
+ {kdexample::}
218
+ This is a paragraph.
219
+ 1. This is NOT a list.
220
+
221
+ 1. This is a list!
222
+ {kdexample}
223
+
224
+ Unordered lists are started by using an asterisk, a dash or a plus sign (they can be mixed) and a
225
+ space. Apart from that unordered lists follow the same rules as ordered lists:
226
+
227
+ {kdexample::}
228
+ * Item one
229
+ + Item two
230
+ - Item three
231
+ {kdexample}
232
+
233
+ ## Definition Lists
234
+
235
+ {kdlink: {oid: definition-lists, part: "definition lists"}}
236
+
237
+ A definition list works similar to a normal list and is used to associate definitions with terms.
238
+ Definition lists are started when a normal paragraph is followed by a line starting with a colon and
239
+ then the definition text. One term can have many definitions and multiple terms can have the same
240
+ definition. Each line of the preceding paragraph is assumed to contain one term, for example:
241
+
242
+ {kdexample::}
243
+ term
244
+ : definition
245
+ : another definition
246
+
247
+ another term
248
+ and another term
249
+ : and a definition for the term
250
+ {kdexample}
251
+
252
+ If you insert a blank line before a definition (note: there must only be one blank line between the
253
+ terms and the first definition), the definition will be wrapped in a paragraph:
254
+
255
+ {kdexample::}
256
+ term
257
+
258
+ : definition
259
+ : definition
260
+ {kdexample}
261
+
262
+ Each term can be styled using span-level elements and each definition is parsed as block-level
263
+ elements, i.e. you can use any block-level in a definition. Just use the same indent for the lines
264
+ following the definition line:
265
+
266
+ {kdexample::}
267
+ This *is* a term
268
+
269
+ : This will be a para
270
+ > a blockquote
271
+
272
+ # A header
273
+ {kdexample}
274
+
275
+
276
+ ## Tables
277
+
278
+ {kdlink: {oid: tables, part: "tables"}}
279
+
280
+ kramdown supports a syntax for creating simple tables. A line starting with a pipe character (`|`)
281
+ starts a table row. However, if the pipe characters is immediately followed by a dash (`-`), a
282
+ separator line is created. Separator lines are used to split the table header from the table body
283
+ (and optionally align the table columns) and to split the table body into multiple parts. If the
284
+ pipe character is followed by an equal sign (`=`), the tables rows below it are part of the table
285
+ footer.
286
+
287
+ {kdexample::}
288
+ | A simple | table |
289
+ | with multiple | lines|
290
+ {kdexample}
291
+
292
+ {kdexample::}
293
+ | Header1 | Header2 | Header3 |
294
+ |:--------|:-------:|--------:|
295
+ | cell1 | cell2 | cell3 |
296
+ | cell4 | cell5 | cell6 |
297
+ |----
298
+ | cell1 | cell2 | cell3 |
299
+ | cell4 | cell5 | cell6 |
300
+ |=====
301
+ | Foot1 | Foot2 | Foot3
302
+ {: rules="groups"}
303
+ {kdexample}
304
+
305
+
306
+ ## HTML elements
307
+
308
+ {kdlink: {oid: html-blocks, part: "HTML blocks"}}
309
+
310
+ kramdown allows you to use block-level HTML tags (`div`, `p`, `pre`, ...) to markup whole blocks of
311
+ text -- just start a line with a block-level HTML tag. kramdown syntax is normally not processed
312
+ inside an HTML tag but this can be changed with the `parse_block_html` option. If this options is
313
+ set to `true`, then the content of a block-level HTML tag is parsed by kramdown either as block
314
+ level or span-level text, depending on the tag:
315
+
316
+ {kdexample::}
317
+ <div style="float: right">
318
+ Something that stays right and is not wrapped in a para.
319
+ </div>
320
+
321
+ {::options parse_block_html="true" /}
322
+
323
+ <div>
324
+ This is wrapped in a para.
325
+ </div>
326
+ <p>
327
+ This can contain only *span* level elements.
328
+ </p>
329
+ {kdexample}
330
+
331
+
332
+ ## Block Attributes
333
+
334
+ {kdlink: {oid: block-ials, part: "block IALs"}}
335
+ {kdlink: {oid: attribute-list-definitions, part: "ALDs"}}
336
+
337
+ You can assign any attribute to a block-level element. Just directly follow the block with a *block
338
+ inline attribute list* (or short: block IAL). A block IAL consists of a left curly brace, followed
339
+ by a colon, the attribute definitions and a right curly brace. Here is a simple example which sets the
340
+ `title` attribute of a block quote:
341
+
342
+ {kdexample::}
343
+ > A nice blockquote
344
+ {: title="Blockquote title"}
345
+ {kdexample}
346
+
347
+ As one often wants to set one or more CSS classes on an element, there is an easy shortcut:
348
+
349
+ {kdexample::}
350
+ > A nice blockquote
351
+ {: .class1 .class2}
352
+ {kdexample}
353
+
354
+ A shortcut for setting the ID is also provided. Just prefix the ID with a hash symbol:
355
+
356
+ {kdexample::}
357
+ > A nice blockquote
358
+ {: #with-an-id}
359
+ {kdexample}
360
+
361
+ Sometimes one wants to use the same attributes for many elements. kramdown allows you to define the
362
+ attributes in one place with an *attribute list definition* (or short: ALD) and just reference this
363
+ definition in a block IAL. An ALD has the same structure as a block IAL but the colon has to be
364
+ replace with a colon, the reference name and another colon. By just using the reference name as-is
365
+ in a block IAL, one can include the attributes of the referenced ALD:
366
+
367
+ {kdexample::}
368
+ {:refdef: .c1 #id .c2 title="title"}
369
+ paragraph
370
+ {: refdef}
371
+ {kdexample}
372
+
373
+ The order in a block IAL or ALD is important because later defined attributes overwrite (with the
374
+ exception of the shortcut for CSS classes) prior defined attributes:
375
+
376
+ {kdexample::}
377
+ {:refdef: .c1 #id .c2 title="title"}
378
+ paragraph
379
+ {: refdef .c3 title="t" #para}
380
+ {kdexample}
381
+
382
+
383
+ ## Extensions
384
+
385
+ {kdlink: {oid: extensions, part: "extensions"}}
386
+
387
+ kramdown provides some less used functionality through a common syntax. This will allow the easy
388
+ addition of other extensions if need arises. Currently, there are extensions for ignoring text (i.e.
389
+ treating text as comment), for inserting arbitrary text as-is into the output and for setting
390
+ kramdown options.
391
+
392
+ Here is an example that shows how to insert comments into text:
393
+
394
+ {kdexample::}
395
+ This is a paragraph
396
+ {::comment}
397
+ This is a comment which is
398
+ completely ignored.
399
+ {:/comment}
400
+ ... paragraph continues here.
401
+
402
+ Extensions can also be used
403
+ inline {::nomarkdown}**see**{:/}!
404
+ {kdexample}
405
+
406
+ As one can see from the above example, the syntax for extensions is nearly identical to that of
407
+ ALDs. However, there is no trailing colon after the extension name and the extension end tag needs a
408
+ slash between the colon and the extension name. One can also use the short form of the end tag, i.e.
409
+ `{:/}`. Attribute definitions can be specified on the start tag by separating them with a space from
410
+ the extension name. Also, if the extension does not have a body, there needs to be a slash right
411
+ before the closing brace:
412
+
413
+ {kdexample::}
414
+ {::options auto_ids="false" /}
415
+
416
+ # Header without id
417
+ {kdexample}
418
+
419
+
420
+
421
+
422
+ # Span-Level Elements - Text Modifiers
423
+
424
+ ## Emphasis
425
+
426
+ {kdlink: {oid: emphasis, part: "emphasis"}}
427
+
428
+ Emphasis can be added to text by surrounding the text with either asterisks or underscores:
429
+
430
+ {kdexample::}
431
+ This is *emphasized*,
432
+ _this_ too!
433
+ {kdexample}
434
+
435
+ Strong emphasis can be done by doubling the delimiters:
436
+
437
+ {kdexample::}
438
+ This is **strong**,
439
+ __this__ too!
440
+ {kdexample}
441
+
442
+ The form with the asterisks can also be used to markup parts of words:
443
+
444
+ {kdexample::}
445
+ This w**ork**s as expected!
446
+ {kdexample}
447
+
448
+
449
+ ## Links and Images
450
+
451
+ {kdlink: {oid: links-and-images, part: "links and images"}}
452
+
453
+ A simple link can be created by surrounding the text with square brackets and the link URL with
454
+ parentheses:
455
+
456
+ {kdexample::}
457
+ A [link](http://kramdown.rubyforge.org)
458
+ to the kramdown homepage.
459
+ {kdexample}
460
+
461
+ You can also add title information to the link:
462
+
463
+ {kdexample::}
464
+ A [link](http://kramdown.rubyforge.org "hp")
465
+ to the homepage.
466
+ {kdexample}
467
+
468
+ There is another way to create links which does not interrupt the text flow. The URL and title are
469
+ defined using a reference name and this reference name is then used in square brackets instead of
470
+ the link URL:
471
+
472
+ {kdexample::}
473
+ A [link][kramdown hp]
474
+ to the homepage.
475
+
476
+ [kramdown hp]: http://kramdown.rubyforge.org "hp"
477
+ {kdexample}
478
+
479
+ If the link text itself is the reference name, the second set of square brackets can be omitted:
480
+
481
+ {kdexample::}
482
+ A link to the [kramdown hp].
483
+
484
+ [kramdown hp]: http://kramdown.rubyforge.org "hp"
485
+ {kdexample}
486
+
487
+ Images can be created in a similar way: just use an exclamation mark before the square brackets. The
488
+ link text will become the alternative text of the image and the link URL specifies the image source:
489
+
490
+ {kdexample::}
491
+ An image: ![gras](img/image.jpg)
492
+ {kdexample}
493
+
494
+
495
+ ## Inline Code
496
+
497
+ {kdlink: {oid: code-spans, part: "code spans"}}
498
+
499
+ Text phrases can be easily marked up as code by surrounding them with backticks:
500
+
501
+ {kdexample::}
502
+ Use `Kramdown::Document.new(text).to_html`
503
+ to convert the `text` in kramdown
504
+ syntax to HTML.
505
+ {kdexample}
506
+
507
+ If you want to use literal backticks in your code, just use two or more backticks as delimiters. The
508
+ space right after the beginning delimiter and the one right before the closing delimiter are ignore:
509
+
510
+ {kdexample::}
511
+ Use backticks to markup code,
512
+ e.g. `` `code` ``.
513
+ {kdexample}
514
+
515
+
516
+ ## Footnotes
517
+
518
+ {kdlink: {oid: footnotes, part: "footnotes"}}
519
+
520
+ Footnotes can easily be used in kramdown. Just set a footnote marker (consists of square brackets
521
+ with a caret and the footnote name inside) in the text and somewhere else the footnote definition (which
522
+ basically looks like a reference link definition):
523
+
524
+ {kdexample::}
525
+ This is a text with a
526
+ footnote[^1].
527
+
528
+ [^1]: And here is the definition.
529
+ {kdexample}
530
+
531
+ The footnote definition can contain any block-level element, all lines following a footnote
532
+ definition indented with four spaces or one tab belong to the definition:
533
+
534
+ {kdexample::}
535
+ This is a text with a
536
+ footnote[^2].
537
+
538
+ [^2]:
539
+ And here is the definition.
540
+
541
+ > With a quote!
542
+ {kdexample}
543
+
544
+ As can be seen above the footnote name is only used for the anchors and the numbering is done
545
+ automatically in document order.
546
+
547
+
548
+ ## Abbreviations
549
+
550
+ {kdlink: {oid: abbreviations, part: "abbreviations"}}
551
+
552
+ Abbreviations will work out of the box once you add an abbreviation definition. So you can just
553
+ write the text and add the definitions later on.
554
+
555
+ {kdexample::}
556
+ This is an HTML
557
+ example.
558
+
559
+ *[HTML]: Hyper Text Markup Language
560
+ {kdexample}
561
+
562
+
563
+ ## HTML Elements
564
+
565
+ {kdlink: {oid: html-spans, part: "HTML spans"}}
566
+
567
+ HTML is not only supported on the block-level but also on the span-level:
568
+
569
+ {kdexample::}
570
+ This is <span style="color: red">written in
571
+ red</span>.
572
+ {kdexample}
573
+
574
+
575
+ ## Inline Attributes
576
+
577
+ {kdlink: {oid: span-ials, part: "span IALs"}}
578
+
579
+ As with a block-level element you can assign any attribute to a span-level elements using a *span
580
+ inline attribute list* (or short: span IAL). A span IAL has the same syntax as a block IAL and must
581
+ immediately follow the span-level element:
582
+
583
+ {kdexample::}
584
+ This is *red*{: style="color: red"}.
585
+ {kdexample}