kramdown-asciidoc 1.0.0.alpha.12 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +135 -2
  3. data/Gemfile +18 -3
  4. data/LICENSE.adoc +1 -1
  5. data/README.adoc +95 -38
  6. data/bin/kramdoc +3 -1
  7. data/kramdown-asciidoc.gemspec +9 -10
  8. data/lib/kramdoc.rb +2 -0
  9. data/lib/kramdown-asciidoc.rb +10 -2
  10. data/lib/kramdown-asciidoc/api.rb +91 -19
  11. data/lib/kramdown-asciidoc/cli.rb +21 -10
  12. data/lib/kramdown-asciidoc/converter.rb +167 -100
  13. data/lib/kramdown-asciidoc/core_ext/regexp/is_match.rb +12 -2
  14. data/lib/kramdown-asciidoc/kramdown_ext/parser/base.rb +16 -0
  15. data/lib/kramdown-asciidoc/kramdown_ext/parser/html.rb +7 -1
  16. data/lib/kramdown-asciidoc/preprocessors.rb +66 -0
  17. data/lib/kramdown-asciidoc/version.rb +7 -3
  18. data/lib/kramdown-asciidoc/writer.rb +30 -25
  19. metadata +34 -820
  20. data/Rakefile +0 -3
  21. data/spec/api_spec.rb +0 -158
  22. data/spec/cli_spec.rb +0 -268
  23. data/spec/converter_spec.rb +0 -271
  24. data/spec/scenario_spec.rb +0 -25
  25. data/spec/scenarios/a/bare-interdoc-xref.adoc +0 -1
  26. data/spec/scenarios/a/bare-interdoc-xref.md +0 -1
  27. data/spec/scenarios/a/bare-url.adoc +0 -1
  28. data/spec/scenarios/a/bare-url.md +0 -1
  29. data/spec/scenarios/a/containing-inline-image.adoc +0 -5
  30. data/spec/scenarios/a/containing-inline-image.md +0 -5
  31. data/spec/scenarios/a/double-underscore-in-url.adoc +0 -1
  32. data/spec/scenarios/a/double-underscore-in-url.md +0 -1
  33. data/spec/scenarios/a/interdoc-xref.adoc +0 -1
  34. data/spec/scenarios/a/interdoc-xref.md +0 -1
  35. data/spec/scenarios/a/internal.adoc +0 -5
  36. data/spec/scenarios/a/internal.md +0 -5
  37. data/spec/scenarios/a/local.adoc +0 -1
  38. data/spec/scenarios/a/local.md +0 -1
  39. data/spec/scenarios/a/no-auto-links.adoc +0 -3
  40. data/spec/scenarios/a/no-auto-links.md +0 -3
  41. data/spec/scenarios/a/no-auto-links.opts +0 -1
  42. data/spec/scenarios/a/url-matches-text.adoc +0 -2
  43. data/spec/scenarios/a/url-matches-text.md +0 -2
  44. data/spec/scenarios/a/url-with-text.adoc +0 -1
  45. data/spec/scenarios/a/url-with-text.md +0 -1
  46. data/spec/scenarios/blockquote/attribution-separated.adoc +0 -5
  47. data/spec/scenarios/blockquote/attribution-separated.md +0 -5
  48. data/spec/scenarios/blockquote/attribution.adoc +0 -5
  49. data/spec/scenarios/blockquote/attribution.md +0 -3
  50. data/spec/scenarios/blockquote/basic.adoc +0 -3
  51. data/spec/scenarios/blockquote/basic.md +0 -1
  52. data/spec/scenarios/blockquote/deep-nested.adoc +0 -17
  53. data/spec/scenarios/blockquote/deep-nested.md +0 -6
  54. data/spec/scenarios/blockquote/list.adoc +0 -5
  55. data/spec/scenarios/blockquote/list.md +0 -3
  56. data/spec/scenarios/blockquote/multiple-lines.adoc +0 -5
  57. data/spec/scenarios/blockquote/multiple-lines.md +0 -3
  58. data/spec/scenarios/blockquote/nested.adoc +0 -7
  59. data/spec/scenarios/blockquote/nested.md +0 -3
  60. data/spec/scenarios/br/leading-tag.adoc +0 -2
  61. data/spec/scenarios/br/leading-tag.md +0 -2
  62. data/spec/scenarios/br/tag-followed-by-newline.adoc +0 -3
  63. data/spec/scenarios/br/tag-followed-by-newline.md +0 -3
  64. data/spec/scenarios/br/tag-in-table-cell.adoc +0 -4
  65. data/spec/scenarios/br/tag-in-table-cell.md +0 -1
  66. data/spec/scenarios/br/tag-preceded-by-space.adoc +0 -3
  67. data/spec/scenarios/br/tag-preceded-by-space.md +0 -1
  68. data/spec/scenarios/br/tag.adoc +0 -3
  69. data/spec/scenarios/br/tag.md +0 -1
  70. data/spec/scenarios/br/trailing-double-space.adoc +0 -3
  71. data/spec/scenarios/br/trailing-double-space.md +0 -3
  72. data/spec/scenarios/codeblock/command-prompt.adoc +0 -1
  73. data/spec/scenarios/codeblock/command-prompt.md +0 -1
  74. data/spec/scenarios/codeblock/contiguous-lines.adoc +0 -3
  75. data/spec/scenarios/codeblock/contiguous-lines.md +0 -3
  76. data/spec/scenarios/codeblock/fenced/command-prompt.adoc +0 -1
  77. data/spec/scenarios/codeblock/fenced/command-prompt.md +0 -3
  78. data/spec/scenarios/codeblock/fenced/language.adoc +0 -8
  79. data/spec/scenarios/codeblock/fenced/language.md +0 -7
  80. data/spec/scenarios/codeblock/fenced/non-contiguous-command-prompts.adoc +0 -6
  81. data/spec/scenarios/codeblock/fenced/non-contiguous-command-prompts.md +0 -5
  82. data/spec/scenarios/codeblock/fenced/without-language.adoc +0 -5
  83. data/spec/scenarios/codeblock/fenced/without-language.md +0 -5
  84. data/spec/scenarios/codeblock/non-contiguous-command-prompts.adoc +0 -6
  85. data/spec/scenarios/codeblock/non-contiguous-command-prompts.md +0 -3
  86. data/spec/scenarios/codeblock/non-contiguous-lines.adoc +0 -7
  87. data/spec/scenarios/codeblock/non-contiguous-lines.md +0 -5
  88. data/spec/scenarios/codespan/caret.adoc +0 -1
  89. data/spec/scenarios/codespan/caret.md +0 -1
  90. data/spec/scenarios/codespan/constrained-triple.adoc +0 -1
  91. data/spec/scenarios/codespan/constrained-triple.md +0 -1
  92. data/spec/scenarios/codespan/constrained.adoc +0 -1
  93. data/spec/scenarios/codespan/constrained.md +0 -1
  94. data/spec/scenarios/codespan/literal.adoc +0 -15
  95. data/spec/scenarios/codespan/literal.md +0 -15
  96. data/spec/scenarios/codespan/plus-plus.adoc +0 -1
  97. data/spec/scenarios/codespan/plus-plus.md +0 -1
  98. data/spec/scenarios/codespan/possessive.adoc +0 -3
  99. data/spec/scenarios/codespan/possessive.md +0 -3
  100. data/spec/scenarios/codespan/quoted.adoc +0 -1
  101. data/spec/scenarios/codespan/quoted.md +0 -1
  102. data/spec/scenarios/codespan/smart-quotes.adoc +0 -1
  103. data/spec/scenarios/codespan/smart-quotes.md +0 -1
  104. data/spec/scenarios/codespan/star-star.adoc +0 -1
  105. data/spec/scenarios/codespan/star-star.md +0 -1
  106. data/spec/scenarios/codespan/unconstrained.adoc +0 -7
  107. data/spec/scenarios/codespan/unconstrained.md +0 -7
  108. data/spec/scenarios/dl/compound-only.adoc +0 -16
  109. data/spec/scenarios/dl/compound-only.md +0 -13
  110. data/spec/scenarios/dl/compound.adoc +0 -11
  111. data/spec/scenarios/dl/compound.md +0 -7
  112. data/spec/scenarios/dl/empty-dd.adoc +0 -3
  113. data/spec/scenarios/dl/empty-dd.md +0 -4
  114. data/spec/scenarios/dl/nested-bookended.adoc +0 -8
  115. data/spec/scenarios/dl/nested-bookended.md +0 -6
  116. data/spec/scenarios/dl/nested-mixed.adoc +0 -11
  117. data/spec/scenarios/dl/nested-mixed.md +0 -11
  118. data/spec/scenarios/dl/nested.adoc +0 -15
  119. data/spec/scenarios/dl/nested.md +0 -23
  120. data/spec/scenarios/dl/simple.adoc +0 -9
  121. data/spec/scenarios/dl/simple.md +0 -10
  122. data/spec/scenarios/em/asterisks.adoc +0 -1
  123. data/spec/scenarios/em/asterisks.md +0 -1
  124. data/spec/scenarios/em/constrained.adoc +0 -1
  125. data/spec/scenarios/em/constrained.md +0 -1
  126. data/spec/scenarios/em/strong.adoc +0 -1
  127. data/spec/scenarios/em/strong.md +0 -1
  128. data/spec/scenarios/em/unconstrained.adoc +0 -4
  129. data/spec/scenarios/em/unconstrained.md +0 -4
  130. data/spec/scenarios/entity/numeric.adoc +0 -1
  131. data/spec/scenarios/entity/numeric.md +0 -1
  132. data/spec/scenarios/entity/reverse.adoc +0 -5
  133. data/spec/scenarios/entity/reverse.md +0 -5
  134. data/spec/scenarios/heading/auto-id-prefix.adoc +0 -11
  135. data/spec/scenarios/heading/auto-id-prefix.md +0 -7
  136. data/spec/scenarios/heading/auto-id-prefix.opts +0 -2
  137. data/spec/scenarios/heading/auto-ids.adoc +0 -11
  138. data/spec/scenarios/heading/auto-ids.md +0 -7
  139. data/spec/scenarios/heading/auto-ids.opts +0 -1
  140. data/spec/scenarios/heading/block-title.adoc +0 -11
  141. data/spec/scenarios/heading/block-title.md +0 -11
  142. data/spec/scenarios/heading/formatting.adoc +0 -1
  143. data/spec/scenarios/heading/formatting.md +0 -1
  144. data/spec/scenarios/heading/leading-anchor.adoc +0 -2
  145. data/spec/scenarios/heading/leading-anchor.md +0 -1
  146. data/spec/scenarios/heading/no-auto-ids.adoc +0 -3
  147. data/spec/scenarios/heading/no-auto-ids.md +0 -3
  148. data/spec/scenarios/heading/no-auto-ids.opts +0 -3
  149. data/spec/scenarios/heading/not-block-title.adoc +0 -8
  150. data/spec/scenarios/heading/not-block-title.md +0 -7
  151. data/spec/scenarios/heading/offset.adoc +0 -5
  152. data/spec/scenarios/heading/offset.md +0 -5
  153. data/spec/scenarios/heading/offset.opts +0 -1
  154. data/spec/scenarios/heading/out-of-sequence.adoc +0 -23
  155. data/spec/scenarios/heading/out-of-sequence.md +0 -21
  156. data/spec/scenarios/heading/outline.adoc +0 -13
  157. data/spec/scenarios/heading/outline.md +0 -13
  158. data/spec/scenarios/heading/surrounding-anchor.adoc +0 -2
  159. data/spec/scenarios/heading/surrounding-anchor.md +0 -1
  160. data/spec/scenarios/hr/around-block.adoc +0 -5
  161. data/spec/scenarios/hr/around-block.md +0 -5
  162. data/spec/scenarios/hr/between-blocks.adoc +0 -5
  163. data/spec/scenarios/hr/between-blocks.md +0 -5
  164. data/spec/scenarios/hr/dashes.adoc +0 -1
  165. data/spec/scenarios/hr/dashes.md +0 -1
  166. data/spec/scenarios/html_element/abbr.adoc +0 -1
  167. data/spec/scenarios/html_element/abbr.md +0 -1
  168. data/spec/scenarios/html_element/admonition.adoc +0 -5
  169. data/spec/scenarios/html_element/admonition.md +0 -7
  170. data/spec/scenarios/html_element/div-mixed.adoc +0 -1
  171. data/spec/scenarios/html_element/div-mixed.md +0 -4
  172. data/spec/scenarios/html_element/div-text-only.adoc +0 -1
  173. data/spec/scenarios/html_element/div-text-only.md +0 -1
  174. data/spec/scenarios/html_element/empty-p.adoc +0 -5
  175. data/spec/scenarios/html_element/empty-p.md +0 -5
  176. data/spec/scenarios/html_element/heading-with-class.adoc +0 -7
  177. data/spec/scenarios/html_element/heading-with-class.md +0 -5
  178. data/spec/scenarios/html_element/heading-with-id.adoc +0 -2
  179. data/spec/scenarios/html_element/heading-with-id.md +0 -1
  180. data/spec/scenarios/html_element/img-with-alt-and-width.adoc +0 -1
  181. data/spec/scenarios/html_element/img-with-alt-and-width.md +0 -1
  182. data/spec/scenarios/html_element/img-with-percentage-width-css.adoc +0 -1
  183. data/spec/scenarios/html_element/img-with-percentage-width-css.md +0 -1
  184. data/spec/scenarios/html_element/img-with-percentage-width.adoc +0 -1
  185. data/spec/scenarios/html_element/img-with-percentage-width.md +0 -1
  186. data/spec/scenarios/html_element/img-with-width-css.adoc +0 -1
  187. data/spec/scenarios/html_element/img-with-width-css.md +0 -1
  188. data/spec/scenarios/html_element/img-with-width.adoc +0 -1
  189. data/spec/scenarios/html_element/img-with-width.md +0 -1
  190. data/spec/scenarios/html_element/img.adoc +0 -2
  191. data/spec/scenarios/html_element/img.md +0 -1
  192. data/spec/scenarios/html_element/mark.adoc +0 -1
  193. data/spec/scenarios/html_element/mark.md +0 -1
  194. data/spec/scenarios/html_element/native.adoc +0 -1
  195. data/spec/scenarios/html_element/native.md +0 -1
  196. data/spec/scenarios/html_element/pre-code-with-language.adoc +0 -6
  197. data/spec/scenarios/html_element/pre-code-with-language.md +0 -4
  198. data/spec/scenarios/html_element/span.adoc +0 -3
  199. data/spec/scenarios/html_element/span.md +0 -3
  200. data/spec/scenarios/html_element/strike.adoc +0 -1
  201. data/spec/scenarios/html_element/strike.md +0 -1
  202. data/spec/scenarios/html_element/sub.adoc +0 -1
  203. data/spec/scenarios/html_element/sub.md +0 -1
  204. data/spec/scenarios/html_element/sup.adoc +0 -1
  205. data/spec/scenarios/html_element/sup.md +0 -1
  206. data/spec/scenarios/html_element/unrecognized-admonition.adoc +0 -5
  207. data/spec/scenarios/html_element/unrecognized-admonition.md +0 -5
  208. data/spec/scenarios/img/block-in-list.adoc +0 -5
  209. data/spec/scenarios/img/block-in-list.md +0 -5
  210. data/spec/scenarios/img/block-with-alt.adoc +0 -1
  211. data/spec/scenarios/img/block-with-alt.md +0 -1
  212. data/spec/scenarios/img/block-with-link-and-alt.adoc +0 -1
  213. data/spec/scenarios/img/block-with-link-and-alt.md +0 -1
  214. data/spec/scenarios/img/block-with-link.adoc +0 -1
  215. data/spec/scenarios/img/block-with-link.md +0 -1
  216. data/spec/scenarios/img/block.adoc +0 -1
  217. data/spec/scenarios/img/block.md +0 -1
  218. data/spec/scenarios/img/imagesdir.adoc +0 -4
  219. data/spec/scenarios/img/imagesdir.md +0 -3
  220. data/spec/scenarios/img/imagesdir.opts +0 -2
  221. data/spec/scenarios/img/implicit-imagesdir.adoc +0 -3
  222. data/spec/scenarios/img/implicit-imagesdir.md +0 -3
  223. data/spec/scenarios/img/implicit-imagesdir.opts +0 -1
  224. data/spec/scenarios/img/inline-with-alt.adoc +0 -1
  225. data/spec/scenarios/img/inline-with-alt.md +0 -1
  226. data/spec/scenarios/img/inline-with-link-and-alt.adoc +0 -1
  227. data/spec/scenarios/img/inline-with-link-and-alt.md +0 -1
  228. data/spec/scenarios/img/inline-with-link.adoc +0 -1
  229. data/spec/scenarios/img/inline-with-link.md +0 -1
  230. data/spec/scenarios/img/inline.adoc +0 -1
  231. data/spec/scenarios/img/inline.md +0 -1
  232. data/spec/scenarios/ol/compound-separated.adoc +0 -29
  233. data/spec/scenarios/ol/compound-separated.md +0 -25
  234. data/spec/scenarios/ol/compound.adoc +0 -29
  235. data/spec/scenarios/ol/compound.md +0 -20
  236. data/spec/scenarios/ol/formatted.adoc +0 -3
  237. data/spec/scenarios/ol/formatted.md +0 -3
  238. data/spec/scenarios/ol/mixed-separated.adoc +0 -6
  239. data/spec/scenarios/ol/mixed-separated.md +0 -11
  240. data/spec/scenarios/ol/mixed.adoc +0 -6
  241. data/spec/scenarios/ol/mixed.md +0 -6
  242. data/spec/scenarios/ol/nested-mixed.adoc +0 -8
  243. data/spec/scenarios/ol/nested-mixed.md +0 -8
  244. data/spec/scenarios/ol/nested-separated.adoc +0 -7
  245. data/spec/scenarios/ol/nested-separated.md +0 -13
  246. data/spec/scenarios/ol/nested.adoc +0 -7
  247. data/spec/scenarios/ol/nested.md +0 -7
  248. data/spec/scenarios/ol/simple-separated.adoc +0 -4
  249. data/spec/scenarios/ol/simple-separated.md +0 -7
  250. data/spec/scenarios/ol/simple.adoc +0 -4
  251. data/spec/scenarios/ol/simple.md +0 -4
  252. data/spec/scenarios/p/admonition/emphasis.adoc +0 -11
  253. data/spec/scenarios/p/admonition/emphasis.md +0 -11
  254. data/spec/scenarios/p/admonition/in-blockquote.adoc +0 -1
  255. data/spec/scenarios/p/admonition/in-blockquote.md +0 -1
  256. data/spec/scenarios/p/admonition/in-compound-blockquote.adoc +0 -5
  257. data/spec/scenarios/p/admonition/in-compound-blockquote.md +0 -3
  258. data/spec/scenarios/p/admonition/in-list-item.adoc +0 -6
  259. data/spec/scenarios/p/admonition/in-list-item.md +0 -6
  260. data/spec/scenarios/p/admonition/label-only.adoc +0 -1
  261. data/spec/scenarios/p/admonition/label-only.md +0 -1
  262. data/spec/scenarios/p/admonition/plain.adoc +0 -13
  263. data/spec/scenarios/p/admonition/plain.md +0 -13
  264. data/spec/scenarios/p/admonition/strong-emphasis.adoc +0 -11
  265. data/spec/scenarios/p/admonition/strong-emphasis.md +0 -11
  266. data/spec/scenarios/p/multiple-lines.adoc +0 -2
  267. data/spec/scenarios/p/multiple-lines.md +0 -2
  268. data/spec/scenarios/p/sequential.adoc +0 -3
  269. data/spec/scenarios/p/sequential.md +0 -3
  270. data/spec/scenarios/p/single-line.adoc +0 -1
  271. data/spec/scenarios/p/single-line.md +0 -1
  272. data/spec/scenarios/root/body-only.adoc +0 -1
  273. data/spec/scenarios/root/body-only.md +0 -1
  274. data/spec/scenarios/root/book-doctype.adoc +0 -10
  275. data/spec/scenarios/root/book-doctype.md +0 -9
  276. data/spec/scenarios/root/header-and-body.adoc +0 -3
  277. data/spec/scenarios/root/header-and-body.md +0 -3
  278. data/spec/scenarios/root/header-only.adoc +0 -1
  279. data/spec/scenarios/root/header-only.md +0 -1
  280. data/spec/scenarios/smart_quote/apostrophe.adoc +0 -1
  281. data/spec/scenarios/smart_quote/apostrophe.md +0 -1
  282. data/spec/scenarios/smart_quote/double-quotes.adoc +0 -1
  283. data/spec/scenarios/smart_quote/double-quotes.md +0 -1
  284. data/spec/scenarios/smart_quote/single-quotes.adoc +0 -1
  285. data/spec/scenarios/smart_quote/single-quotes.md +0 -1
  286. data/spec/scenarios/strong/constrained.adoc +0 -1
  287. data/spec/scenarios/strong/constrained.md +0 -1
  288. data/spec/scenarios/strong/menu.adoc +0 -3
  289. data/spec/scenarios/strong/menu.md +0 -1
  290. data/spec/scenarios/strong/nested-emphasis.adoc +0 -1
  291. data/spec/scenarios/strong/nested-emphasis.md +0 -1
  292. data/spec/scenarios/strong/unconstrained.adoc +0 -8
  293. data/spec/scenarios/strong/unconstrained.md +0 -8
  294. data/spec/scenarios/table/alignment.adoc +0 -19
  295. data/spec/scenarios/table/alignment.md +0 -8
  296. data/spec/scenarios/table/cell-with-image.adoc +0 -9
  297. data/spec/scenarios/table/cell-with-image.md +0 -4
  298. data/spec/scenarios/table/cell-with-pipe.adoc +0 -5
  299. data/spec/scenarios/table/cell-with-pipe.md +0 -1
  300. data/spec/scenarios/table/header.adoc +0 -9
  301. data/spec/scenarios/table/header.md +0 -4
  302. data/spec/scenarios/table/no-header.adoc +0 -8
  303. data/spec/scenarios/table/no-header.md +0 -2
  304. data/spec/scenarios/table/single-column-with-header.adoc +0 -6
  305. data/spec/scenarios/table/single-column-with-header.md +0 -4
  306. data/spec/scenarios/table/single-column-without-header.adoc +0 -4
  307. data/spec/scenarios/table/single-column-without-header.md +0 -2
  308. data/spec/scenarios/text/attribute-reference.adoc +0 -1
  309. data/spec/scenarios/text/attribute-reference.md +0 -1
  310. data/spec/scenarios/text/caret.adoc +0 -1
  311. data/spec/scenarios/text/caret.md +0 -1
  312. data/spec/scenarios/text/lte.adoc +0 -1
  313. data/spec/scenarios/text/lte.md +0 -1
  314. data/spec/scenarios/text/nbsp.adoc +0 -1
  315. data/spec/scenarios/text/nbsp.md +0 -1
  316. data/spec/scenarios/text/plus-plus.adoc +0 -6
  317. data/spec/scenarios/text/plus-plus.md +0 -5
  318. data/spec/scenarios/text/right-arrow.adoc +0 -1
  319. data/spec/scenarios/text/right-arrow.md +0 -1
  320. data/spec/scenarios/text/typographic_sym/apostrophe.adoc +0 -3
  321. data/spec/scenarios/text/typographic_sym/apostrophe.md +0 -3
  322. data/spec/scenarios/text/typographic_sym/double-quotes.adoc +0 -1
  323. data/spec/scenarios/text/typographic_sym/double-quotes.md +0 -1
  324. data/spec/scenarios/text/typographic_sym/ellipsis.adoc +0 -1
  325. data/spec/scenarios/text/typographic_sym/ellipsis.md +0 -1
  326. data/spec/scenarios/text/typographic_sym/mdash.adoc +0 -1
  327. data/spec/scenarios/text/typographic_sym/mdash.md +0 -1
  328. data/spec/scenarios/text/typographic_sym/ndash.adoc +0 -1
  329. data/spec/scenarios/text/typographic_sym/ndash.md +0 -1
  330. data/spec/scenarios/text/typographic_sym/single-quotes.adoc +0 -1
  331. data/spec/scenarios/text/typographic_sym/single-quotes.md +0 -1
  332. data/spec/scenarios/trailing_space.adoc +0 -7
  333. data/spec/scenarios/trailing_space.md +0 -7
  334. data/spec/scenarios/typographic_sym/ellipsis.adoc +0 -1
  335. data/spec/scenarios/typographic_sym/ellipsis.md +0 -1
  336. data/spec/scenarios/typographic_sym/mdash.adoc +0 -1
  337. data/spec/scenarios/typographic_sym/mdash.md +0 -1
  338. data/spec/scenarios/typographic_sym/ndash.adoc +0 -1
  339. data/spec/scenarios/typographic_sym/ndash.md +0 -1
  340. data/spec/scenarios/ul/blockquote.adoc +0 -5
  341. data/spec/scenarios/ul/blockquote.md +0 -2
  342. data/spec/scenarios/ul/compound-nested.adoc +0 -23
  343. data/spec/scenarios/ul/compound-nested.md +0 -19
  344. data/spec/scenarios/ul/compound-only.adoc +0 -5
  345. data/spec/scenarios/ul/compound-only.md +0 -3
  346. data/spec/scenarios/ul/compound-separated.adoc +0 -41
  347. data/spec/scenarios/ul/compound-separated.md +0 -32
  348. data/spec/scenarios/ul/compound.adoc +0 -41
  349. data/spec/scenarios/ul/compound.md +0 -26
  350. data/spec/scenarios/ul/formatted.adoc +0 -3
  351. data/spec/scenarios/ul/formatted.md +0 -3
  352. data/spec/scenarios/ul/inside-delimited-block.adoc +0 -9
  353. data/spec/scenarios/ul/inside-delimited-block.md +0 -7
  354. data/spec/scenarios/ul/nested-bookended.adoc +0 -7
  355. data/spec/scenarios/ul/nested-bookended.md +0 -7
  356. data/spec/scenarios/ul/nested-separated.adoc +0 -11
  357. data/spec/scenarios/ul/nested-separated.md +0 -21
  358. data/spec/scenarios/ul/nested.adoc +0 -11
  359. data/spec/scenarios/ul/nested.md +0 -11
  360. data/spec/scenarios/ul/simple-separated.adoc +0 -3
  361. data/spec/scenarios/ul/simple-separated.md +0 -5
  362. data/spec/scenarios/ul/simple.adoc +0 -3
  363. data/spec/scenarios/ul/simple.md +0 -3
  364. data/spec/scenarios/wrap/containing-line-comment.adoc +0 -3
  365. data/spec/scenarios/wrap/containing-line-comment.md +0 -3
  366. data/spec/scenarios/wrap/containing-line-comment.opts +0 -1
  367. data/spec/scenarios/wrap/none.adoc +0 -1
  368. data/spec/scenarios/wrap/none.md +0 -4
  369. data/spec/scenarios/wrap/none.opts +0 -1
  370. data/spec/scenarios/wrap/preserve.adoc +0 -5
  371. data/spec/scenarios/wrap/preserve.md +0 -5
  372. data/spec/scenarios/wrap/preserve.opts +0 -1
  373. data/spec/scenarios/wrap/ventilate-exclamation.adoc +0 -3
  374. data/spec/scenarios/wrap/ventilate-exclamation.md +0 -1
  375. data/spec/scenarios/wrap/ventilate-exclamation.opts +0 -1
  376. data/spec/scenarios/wrap/ventilate-french.adoc +0 -3
  377. data/spec/scenarios/wrap/ventilate-french.md +0 -1
  378. data/spec/scenarios/wrap/ventilate-french.opts +0 -1
  379. data/spec/scenarios/wrap/ventilate-question.adoc +0 -3
  380. data/spec/scenarios/wrap/ventilate-question.md +0 -3
  381. data/spec/scenarios/wrap/ventilate-question.opts +0 -1
  382. data/spec/scenarios/wrap/ventilate-table-cell.adoc +0 -9
  383. data/spec/scenarios/wrap/ventilate-table-cell.md +0 -3
  384. data/spec/scenarios/wrap/ventilate-table-cell.opts +0 -1
  385. data/spec/scenarios/wrap/ventilate-with-comments.adoc +0 -5
  386. data/spec/scenarios/wrap/ventilate-with-comments.md +0 -5
  387. data/spec/scenarios/wrap/ventilate-with-comments.opts +0 -1
  388. data/spec/scenarios/wrap/ventilate.adoc +0 -2
  389. data/spec/scenarios/wrap/ventilate.md +0 -6
  390. data/spec/scenarios/wrap/ventilate.opts +0 -1
  391. data/spec/scenarios/xml_comment/above-block.adoc +0 -7
  392. data/spec/scenarios/xml_comment/above-block.md +0 -5
  393. data/spec/scenarios/xml_comment/above-header.adoc +0 -13
  394. data/spec/scenarios/xml_comment/above-header.md +0 -16
  395. data/spec/scenarios/xml_comment/at-start-of-line.adoc +0 -9
  396. data/spec/scenarios/xml_comment/at-start-of-line.md +0 -4
  397. data/spec/scenarios/xml_comment/block.adoc +0 -7
  398. data/spec/scenarios/xml_comment/block.md +0 -6
  399. data/spec/scenarios/xml_comment/line-adjacent-to-text.adoc +0 -2
  400. data/spec/scenarios/xml_comment/line-adjacent-to-text.md +0 -1
  401. data/spec/scenarios/xml_comment/line-empty.adoc +0 -7
  402. data/spec/scenarios/xml_comment/line-empty.md +0 -9
  403. data/spec/scenarios/xml_comment/line-offset-by-space.adoc +0 -1
  404. data/spec/scenarios/xml_comment/line-offset-by-space.md +0 -1
  405. data/spec/scenarios/xml_comment/line.adoc +0 -1
  406. data/spec/scenarios/xml_comment/line.md +0 -1
  407. data/spec/scenarios/xml_comment/list-separator.adoc +0 -7
  408. data/spec/scenarios/xml_comment/list-separator.md +0 -7
  409. data/spec/scenarios/xml_comment/mixed.adoc +0 -7
  410. data/spec/scenarios/xml_comment/mixed.md +0 -6
  411. data/spec/scenarios/xml_comment/multiline-span.adoc +0 -8
  412. data/spec/scenarios/xml_comment/multiline-span.md +0 -7
  413. data/spec/scenarios/xml_comment/p-separator.adoc +0 -5
  414. data/spec/scenarios/xml_comment/p-separator.md +0 -5
  415. data/spec/scenarios/xml_comment/styled.adoc +0 -6
  416. data/spec/scenarios/xml_comment/styled.md +0 -6
  417. data/spec/scenarios/xml_comment/surrounded-by-spaces.adoc +0 -3
  418. data/spec/scenarios/xml_comment/surrounded-by-spaces.md +0 -1
  419. data/spec/spec_helper.rb +0 -41
  420. data/spec/writer_spec.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 64f9079115320afb426fbb449cd0b6163b49fbdeb7ae2dc07407eb37524c787a
4
- data.tar.gz: e2b4a086c0ec8248970d4d8f121b9642b8a9665510b69fe658f9311a7f96fa2f
3
+ metadata.gz: be0108c05d441dbc4125ed5fa6f51d152ae238d769cf5add12a0c35000c237e4
4
+ data.tar.gz: 77fec67f63c28cb7611c45aaca839292cb19686e8d9e02cd87ed31a129fd939a
5
5
  SHA512:
6
- metadata.gz: 2a537db76f1c5406c9a991e442fa366a121907c3b3aeb813434da304f2ec37d0773c1a91b72224ff2ab28f7ad8bc8f9884c842dce0d4228f31a44f4aca889a9e
7
- data.tar.gz: fd86b40db1f4f2b22d99ae6295a8a78173f0e8039045224306b143f1d6fd96e00e384c6d9fea4873ccad4616771fa29a96b8cb01005e129315d19c729b7a8cb6
6
+ metadata.gz: 309476de155735f63f125bf1c91349f2d261b02c4e69b0ca5e154381893ec6d340429f348d14dd42e08ec4039db7d531a5de36e13089ee2e4ff9609696e161a7
7
+ data.tar.gz: e4e265aae1a393d0f1b2038bce02aae9ffaa24d4b8e219458bf557ff219c3629c27d9788a9b1a69115d1e1522b60ec28d3771884cc68c2cfc4dbfa52f15f35b0
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,100 @@
5
5
  This document provides a high-level view of the changes to {project-name} by release.
6
6
  For a detailed view of what has changed, refer to the {uri-repo}/commits/master[commit history] on GitHub.
7
7
 
8
+ == 2.0.0 (2021-07-11) - @mojavelinux
9
+
10
+ === Added
11
+
12
+ * Add support for converting block LaTeX math to stem block
13
+ * Add support for converting span LaTeX math to inline stem macro
14
+ * Add basic support for footnotes (#74)
15
+
16
+ === Fixed
17
+
18
+ * Use File.read instead of IO.read to suppress magic subprocess behavior
19
+ * Enable compatibility with Ruby 3 by declaring rexml as a runtime dependency (#84)
20
+ * Don't crash when converting list item that only contains spaces (#83)
21
+
22
+ === Changed
23
+
24
+ * Upgrade kramdown to 2.3.x and declare kramdown-parser-gfm as runtime dependency (#85)
25
+ * Don't add source style to listing block when language is specified
26
+ * Switch CI to GitHub Actions
27
+ * Run test suite in CI environment on Windows and macOS
28
+ * Apply style rules to source code
29
+
30
+ === Details
31
+
32
+ {uri-repo}/releases/tag/v2.0.0[git tag] | {uri-repo}/compare/v1.0.1\...v2.0.0[full diff]
33
+
34
+ == 1.0.1 (2018-11-28) - @mojavelinux
35
+
36
+ === Fixed
37
+
38
+ * Fixed bin script on Ruby 2.3 (#70)
39
+
40
+ === Details
41
+
42
+ {uri-repo}/releases/tag/v1.0.1[git tag] | {uri-repo}/compare/v1.0.0\...v1.0.1[full diff]
43
+
44
+ == 1.0.0 (2018-11-07) - @mojavelinux
45
+
46
+ === Changed
47
+
48
+ * change CLI to use default options from API
49
+
50
+ === Fixed
51
+
52
+ * automatically require version file so -v CLI flag reports correct version
53
+
54
+ === Details
55
+
56
+ {uri-repo}/releases/tag/v1.0.0[git tag] | {uri-repo}/compare/v1.0.0.rc.1\...v1.0.0[full diff]
57
+
58
+ == 1.0.0.rc.1 (2018-11-06) - @mojavelinux
59
+
60
+ === Added
61
+
62
+ * ventilate prose on semi-colon following non-space character
63
+ * add :preprocessors option to convert API; apply default preprocessors if not set; apply none if falsy (#23)
64
+ * add :postprocessors option to convert API; takes precedence over :postprocess option (#67)
65
+ * accept IO object as input to convert method (#49)
66
+ * accept File object as input to convert_file method (#49)
67
+ * add API docs to public API methods
68
+
69
+ === Changed
70
+
71
+ * remove whitespace in front of leading XML comment (so a block comment isn't mistaken for an inline comment)
72
+ * drop empty XML comment unless it comes after a list
73
+
74
+ === Details
75
+
76
+ {uri-repo}/releases/tag/v1.0.0.rc.1[git tag] | {uri-repo}/compare/v1.0.0.alpha.13\...v1.0.0.rc.1[full diff]
77
+
78
+ == 1.0.0.alpha.13 (2018-08-21) - @mojavelinux
79
+
80
+ === Added
81
+
82
+ * drop ID on section title if matches auto-generated value when :lazy_ids API option / --lazy-ids CLI option is set (#16)
83
+ * auto-generate IDs for section titles when :auto_ids option is set and :input is not GFM
84
+ * add :postprocess callback option to `convert` and `convert_file` API methods (#53)
85
+
86
+ === Changed
87
+
88
+ * automatically set idprefix, if necessary, based on value of :auto_id_prefix option when :auto_ids options is set (#16)
89
+ * don't modify value of :attributes option passed to `convert` and `convert_file` API methods
90
+ * define ID containing a dot using longhand attribute assignment (#59)
91
+ * extract raw text consistently regardless of input flavor (#56)
92
+ * sort attributes in document header (#55)
93
+
94
+ === Fixed
95
+
96
+ * enclose codeblock content in literal block delimiters if content starts with a list marker (#57)
97
+
98
+ === Details
99
+
100
+ {uri-repo}/releases/tag/v1.0.0.alpha.13[git tag] | {uri-repo}/compare/v1.0.0.alpha.12\...v1.0.0.alpha.13[full diff]
101
+
8
102
  == 1.0.0.alpha.12 (2018-08-11) - @mojavelinux
9
103
 
10
104
  === Added
@@ -23,6 +117,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
23
117
  * break on all terminal punctuation (period, question mark, and exclamation mark) when ventilating prose (#51)
24
118
  * consolidated logic in CLI by further delegating to API
25
119
 
120
+ === Details
121
+
122
+ {uri-repo}/releases/tag/v1.0.0.alpha.12[git tag] | {uri-repo}/compare/v1.0.0.alpha.11\...v1.0.0.alpha.12[full diff]
123
+
26
124
  == 1.0.0.alpha.11 (2018-08-02) - @mojavelinux
27
125
 
28
126
  === Added
@@ -42,6 +140,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
42
140
  * use unconstrained codespan if bounded on either side by a smart quote
43
141
  * ignore auto-generated ID if heading has an explicit inline anchor
44
142
 
143
+ === Details
144
+
145
+ {uri-repo}/releases/tag/v1.0.0.alpha.11[git tag] | {uri-repo}/compare/v1.0.0.alpha.10\...v1.0.0.alpha.11[full diff]
146
+
45
147
  == 1.0.0.alpha.10 (2018-07-16) - @mojavelinux
46
148
 
47
149
  === Added
@@ -60,6 +162,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
60
162
 
61
163
  * insert blank line above list continuation to attach to parent list item (#27)
62
164
 
165
+ === Details
166
+
167
+ {uri-repo}/releases/tag/v1.0.0.alpha.10[git tag] | {uri-repo}/compare/v1.0.0.alpha.9\...v1.0.0.alpha.10[full diff]
168
+
63
169
  == 1.0.0.alpha.9 (2018-07-10) - @mojavelinux
64
170
 
65
171
  === Changed
@@ -69,6 +175,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
69
175
  * don't add newline after period at start of line when producing ventilated prose
70
176
  * use :imagesdir API option or --imagesdir CLI option to set implicit imagesdir instead of attribute
71
177
 
178
+ === Details
179
+
180
+ {uri-repo}/releases/tag/v1.0.0.alpha.9[git tag] | {uri-repo}/compare/v1.0.0.alpha.8\...v1.0.0.alpha.9[full diff]
181
+
72
182
  == 1.0.0.alpha.8 (2018-07-03) - @mojavelinux
73
183
 
74
184
  === Added
@@ -80,6 +190,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
80
190
  * don't escape double hyphen in codespan unless surrounded by spaces or word chars
81
191
  * treat leading specialchar (<, >, or &) as a word character (since it gets converted to a char reference)
82
192
 
193
+ === Details
194
+
195
+ {uri-repo}/releases/tag/v1.0.0.alpha.8[git tag] | {uri-repo}/compare/v1.0.0.alpha.7\...v1.0.0.alpha.8[full diff]
196
+
83
197
  == 1.0.0.alpha.7 (2018-07-02) - @mojavelinux
84
198
 
85
199
  === Added
@@ -100,6 +214,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
100
214
  * replace .md extension with .adoc in text of interdoc xref
101
215
  * replace a non-breaking space with a single space instead of \{nbsp}
102
216
 
217
+ === Details
218
+
219
+ {uri-repo}/releases/tag/v1.0.0.alpha.7[git tag] | {uri-repo}/compare/v1.0.0.alpha.6\...v1.0.0.alpha.7[full diff]
220
+
103
221
  == 1.0.0.alpha.6 (2018-06-26) - @mojavelinux
104
222
 
105
223
  === Added
@@ -116,6 +234,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
116
234
  * use writer to track list nesting level
117
235
  * fix warnings
118
236
 
237
+ === Details
238
+
239
+ {uri-repo}/releases/tag/v1.0.0.alpha.6[git tag] | {uri-repo}/compare/v1.0.0.alpha.5\...v1.0.0.alpha.6[full diff]
240
+
119
241
  == 1.0.0.alpha.5 (2018-06-19) - @mojavelinux
120
242
 
121
243
  === Added
@@ -131,6 +253,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
131
253
  * use separate list level for dl
132
254
  * fold description list item to one line if primary text is a single line
133
255
 
256
+ === Details
257
+
258
+ {uri-repo}/releases/tag/v1.0.0.alpha.5[git tag] | {uri-repo}/compare/v1.0.0.alpha.4\...v1.0.0.alpha.5[full diff]
259
+
134
260
  == 1.0.0.alpha.4 (2018-06-12) - @mojavelinux
135
261
 
136
262
  === Added
@@ -156,6 +282,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
156
282
  * upgrade kramdown to 1.17.0
157
283
  * use correct casing for kramdown in README and library metadata
158
284
 
285
+ === Details
286
+
287
+ {uri-repo}/releases/tag/v1.0.0.alpha.4[git tag] | {uri-repo}/compare/v1.0.0.alpha.3\...v1.0.0.alpha.4[full diff]
288
+
159
289
  == 1.0.0.alpha.3 (2018-05-31) - @mojavelinux
160
290
 
161
291
  === Added
@@ -169,6 +299,10 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
169
299
 
170
300
  * replace ndash symbol with \-- instead of \&#8211;
171
301
 
302
+ === Details
303
+
304
+ {uri-repo}/releases/tag/v1.0.0.alpha.3[git tag] | {uri-repo}/compare/v1.0.0.alpha.2\...v1.0.0.alpha.3[full diff]
305
+
172
306
  == 1.0.0.alpha.2 (2018-05-24) - @mojavelinux
173
307
 
174
308
  === Added
@@ -195,8 +329,7 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
195
329
 
196
330
  === Details
197
331
 
198
- {uri-repo}/releases/tag/v1.0.0.alpha.2[git tag] |
199
- {uri-repo}/compare/v1.0.0.alpha.1...v1.0.0.alpha.2[full diff]
332
+ {uri-repo}/releases/tag/v1.0.0.alpha.2[git tag] | {uri-repo}/compare/v1.0.0.alpha.1\...v1.0.0.alpha.2[full diff]
200
333
 
201
334
  == 1.0.0.alpha.1 (2018-05-22) - @mojavelinux
202
335
 
data/Gemfile CHANGED
@@ -1,8 +1,23 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
7
+ without = (Bundler.settings['WITHOUT'] || '').split ':'
8
+
9
+ group :docs do
10
+ gem 'asciidoctor', require: false
11
+ gem 'yard', require: false
12
+ end unless without.include? 'docs'
13
+
14
+ group :lint do
15
+ gem 'rubocop', '~> 1.18.0', require: false
16
+ gem 'rubocop-rake', '~> 0.6.0', require: false
17
+ gem 'rubocop-rspec', '~> 2.4.0', require: false
18
+ end unless without.include? 'lint'
19
+
5
20
  group :coverage do
6
- gem 'deep-cover', git: 'https://github.com/mojavelinux/deep-cover', branch: 'no-cli', require: false
7
- gem 'sass', require: false unless ENV['CI']
8
- end
21
+ gem 'deep-cover-core', '~> 1.1.0', require: false
22
+ gem 'simplecov', '~> 0.21.0', require: false
23
+ end unless without.include? 'coverage'
data/LICENSE.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  .The MIT License
2
2
  ....
3
- Copyright (C) 2016 OpenDevise Inc. (on behalf of the Asciidoctor Project)
3
+ Copyright (C) 2016-2019 OpenDevise Inc. (on behalf of the Asciidoctor Project)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = {project-name} (Markdown to AsciiDoc)
2
2
  Dan Allen <https://github.com/mojavelinux>
3
- v1.0.0.alpha.12, 2018-08-11
3
+ v2.0.0, 2021-07-11
4
4
  // Aliases:
5
5
  :project-name: Kramdown AsciiDoc
6
6
  :project-handle: kramdown-asciidoc
@@ -19,47 +19,43 @@ ifdef::env-github[]
19
19
  :tip-caption: :bulb:
20
20
  endif::[]
21
21
  // URIs:
22
- :uri-repo: https://github.com/asciidoctor/kramdown-asciidoc
23
- :uri-asciidoc: https://asciidoctor.org/docs/what-is-asciidoc/#what-is-asciidoc
24
- :uri-asciidoctor: https://asciidoctor.org
25
- :uri-kramdown: https://kramdown.gettalong.org
26
- :uri-rvm: https://rvm.io
27
- :uri-rvm-install: https://rvm.io/rvm/install
28
- :uri-ci-appveyor: https://ci.appveyor.com/project/asciidoctor/kramdown-asciidoc
29
- :img-ci-appveyor: https://ci.appveyor.com/api/projects/status/2pwvdbcoeux1ifb5/branch/master?svg=true
30
- :uri-ci-travis: https://travis-ci.org/asciidoctor/kramdown-asciidoc
31
- :uri-ci-travis-img: https://img.shields.io/travis/asciidoctor/kramdown-asciidoc/master.svg
32
- :uri-gem: https://rubygems.org/gems/kramdown-asciidoc
33
- :uri-gem-img: https://img.shields.io/gem/v/kramdown-asciidoc.svg?label=gem
22
+ :url-repo: https://github.com/asciidoctor/kramdown-asciidoc
23
+ :url-asciidoc: https://asciidoctor.org/docs/what-is-asciidoc/#what-is-asciidoc
24
+ :url-asciidoctor: https://asciidoctor.org
25
+ :url-kramdown: https://kramdown.gettalong.org
26
+ :url-rvm: https://rvm.io
27
+ :url-rvm-install: https://rvm.io/rvm/install
28
+ :url-api-docs: https://www.rubydoc.info/github/asciidoctor/kramdown-asciidoc/master
29
+ :url-gem: https://rubygems.org/gems/kramdown-asciidoc
30
+ :img-url-gem: https://img.shields.io/gem/v/kramdown-asciidoc.svg?label=gem
34
31
 
35
32
  ifdef::status[]
36
- image:{uri-gem-img}[Gem Version,link={uri-gem}]
37
- image:{uri-ci-travis-img}[Build Status (Travis CI),link={uri-ci-travis}]
38
- image:{img-ci-appveyor}[Build Status (AppVeyor),link={uri-ci-appveyor}]
33
+ image:{img-url-gem}[Gem Version,link={url-gem}]
34
+ image:{url-repo}/workflows/CI/badge.svg[Build Status (GitHub Actions),link={url-repo}/actions?query=workflow%3ACI+branch%3Amain]
39
35
  endif::[]
40
36
 
41
- {uri-repo}[{project-name}] (gem: *{project-handle}*) is a {uri-kramdown}[kramdown] extension for converting Markdown documents to {uri-asciidoc}[AsciiDoc].
42
- Notably, the converter generates modern AsciiDoc syntax suitable for use with {uri-asciidoctor}[Asciidoctor].
37
+ {url-repo}[{project-name}] (gem: *{project-handle}*, command: `kramdoc`) is a {url-kramdown}[kramdown] extension for converting Markdown documents to {url-asciidoc}[AsciiDoc].
38
+ Notably, the converter generates modern AsciiDoc syntax suitable for use with {url-asciidoctor}[Asciidoctor].
43
39
 
44
40
  == Prerequisites
45
41
 
46
- To install and run {project-name}, you need Ruby 2.4 or better installed and a few RubyGems (aka gems).
47
- We'll explain how to install the gems in the next section.
42
+ To install and run {project-name}, you need Ruby 2.3 or better installed and a few RubyGems (aka gems).
43
+ The instructions for installing the gems is covered in the next section.
48
44
 
49
45
  To check whether you have Ruby installed, and which version, run the following command:
50
46
 
51
47
  $ ruby -v
52
48
 
53
- If Ruby is not installed, you can install it using {uri-rvm}[RVM] (or, if you prefer, the package manager for your system).
49
+ If Ruby is not installed, you can install it using {url-rvm}[RVM] (or, if you prefer, the package manager for your system).
54
50
  We generally recommend using RVM because it allows you to install gems without requiring elevated privileges or messing with system libraries.
55
51
 
56
52
  == Installation
57
53
 
58
- {project-name} is published to RubyGems.org as a pre-release gem named *{project-handle}*.
54
+ {project-name} is published to RubyGems.org as a gem named *{project-handle}*.
59
55
 
60
- You can install the pre-release version using the following command:
56
+ You can install the latest version of the gem using the following command:
61
57
 
62
- $ gem install kramdown-asciidoc --pre
58
+ $ gem install kramdown-asciidoc
63
59
 
64
60
  Installing this gem makes the `kramdoc` command available on your $PATH.
65
61
 
@@ -90,9 +86,9 @@ To see all the options the `kramdoc` command accepts, pass the `-h` option to th
90
86
 
91
87
  For example, you can inject attributes (key/value pairs) into the header of the AsciiDoc output document using the `-a` option.
92
88
 
93
- $ kramdoc -a product-name="ACME Cloud" -a hide-uri-scheme sample.md
89
+ $ kramdoc -a product-name="ACME Cloud" -a hide-url-scheme sample.md
94
90
 
95
- Another use for attributes is setting the shared images directory, which is coverd in the next section.
91
+ Another use for attributes is setting the shared images directory, which is covered in the next section.
96
92
 
97
93
  == Configure shared images directory
98
94
 
@@ -136,17 +132,42 @@ image::octocat.png[Octocat]
136
132
 
137
133
  In this scenario, you may need to pass the `imagesdir` attribute to the AsciiDoc processor when converting the output document so the image is resolved, depending on where the image is stored.
138
134
 
135
+ == Auto-generate IDs
136
+
137
+ You can configure kramdoc to automatically generate explicit IDs for each section title (aka heading) that doesn't already have an ID assigned to it (in the Markdown source).
138
+ To do so, simply enable the `--auto-ids` flag:
139
+
140
+ $ kramdoc --auto-ids sample.md
141
+
142
+ By default, kramdoc does not add a prefix to the generated ID and uses `-` as the separator / replacement character.
143
+ You can change these values using the `--auto-id-prefix` and `--auto-id-separator` options, respectively:
144
+
145
+ $ kramdoc --auto-ids --auto-id-prefix=_ --auto-id-separator=_ sample.md
146
+
147
+ Since the AsciiDoc processor generates an ID for any section title that doesn't have one by default, you may decide you want to drop any ID which matches its auto-generated value.
148
+ You can enable this behavior by adding the `--lazy-ids` flag:
149
+
150
+ $ kramdoc --lazy-ids sample.md
151
+
152
+ The catch is that kramdown/kramdoc and AsciiDoc don't use the same prefix and separator when generating IDs.
153
+ So it's necessary to sync them.
154
+ The simplest way is to set the `--auto-id-prefix` and `--auto-id-separator` values to match those used by AsciiDoc.
155
+
156
+ $ kramdoc --lazy-ids --auto-id-prefix=_ --auto-id-separator=_ sample.md
157
+
158
+ If these values do not match the defaults in AsciiDoc, the `idprefix` and/or `idseparator` attributes will be assigned explicitly in the generated document.
159
+
139
160
  == API
140
161
 
141
- In additional to the command-line interface, {project-name} also provides a porcelain API.
162
+ In additional to the command-line interface, {project-name} also provides a porcelain API (see {url-api-docs}[API docs]).
142
163
  We use the term "`porcelain`" because the API hides the details of registering the converter, preprocessing the Markdown document, parsing the document with kramdown, and calling the converter method to transform the parse tree to AsciiDoc.
143
164
 
144
- The API consists of two static methods:
165
+ The API consists of two static methods in the Kramdoc module:
145
166
 
146
- * `Kramdoc.convert(source, opts)` - convert a Markdown string to AsciiDoc
147
- * `Kramdoc.convert_file(file, opts)` - convert a Markdown file to AsciiDoc
167
+ * `Kramdoc.convert(source, opts)` - convert a Markdown string or IO object to AsciiDoc
168
+ * `Kramdoc.convert_file(file, opts)` - convert a Markdown file object or path to AsciiDoc
148
169
 
149
- NOTE: `Kramdoc` is shorthand for `Kramdown::AsciiDoc` to align with the name of the CLI.
170
+ NOTE: `Kramdoc` is a shorthand for `Kramdown::AsciiDoc` to align with the name of the CLI.
150
171
 
151
172
  Both API methods accept the source as the first argument and an options hash as the second.
152
173
 
@@ -194,6 +215,8 @@ Kramdoc.convert markdown, to: 'result.adoc'
194
215
 
195
216
  The input string is automatically converted to UTF-8.
196
217
 
218
+ For more information about the API, refer to the {url-api-docs}[API documentation].
219
+
197
220
  == Development
198
221
 
199
222
  To help develop {project-name}, or to simply test-drive the development version, you need to retrieve the source from GitHub.
@@ -201,10 +224,10 @@ Follow the instructions below to learn how to clone the source and run the appli
201
224
 
202
225
  === Retrieve the source code
203
226
 
204
- Simply copy the {uri-repo}[GitHub repository URL] and pass it to the `git clone` command:
227
+ Simply copy the {url-repo}[GitHub repository URL] and pass it to the `git clone` command:
205
228
 
206
229
  [subs=attributes+]
207
- $ git clone {uri-repo}
230
+ $ git clone {url-repo}
208
231
 
209
232
  Next, switch to the project directory:
210
233
 
@@ -213,9 +236,9 @@ Next, switch to the project directory:
213
236
 
214
237
  === Prepare RVM (optional)
215
238
 
216
- We recommend using {uri-rvm}[RVM] when developing applications with Ruby.
239
+ We recommend using {url-rvm}[RVM] when developing applications with Ruby.
217
240
  We like RVM because it keeps the dependencies required by the project isolated from the rest of your system.
218
- Follow the {uri-rvm-install}[installation instructions] on the RVM site to setup RVM and install Ruby.
241
+ Follow the {url-rvm-install}[installation instructions] on the RVM site to setup RVM and install Ruby.
219
242
 
220
243
  Once you have RVM setup, switch to the RVM-managed version of Ruby recommended by the project using this command:
221
244
 
@@ -242,7 +265,7 @@ Then, use the `bundle` command to install the project dependencies under the pro
242
265
 
243
266
  NOTE: You must invoke `bundle` from the project's root directory so it can locate the [.path]_Gemfile_.
244
267
 
245
- === Run the Tests
268
+ === Run the tests
246
269
 
247
270
  The test suite is located in the [.path]_spec_ directory.
248
271
  The tests are all based on RSpec.
@@ -264,7 +287,7 @@ To run all the scenarios, point RSpec at the spec file:
264
287
 
265
288
  $ bundle exec rspec spec/scenario_spec.rb
266
289
 
267
- ==== Run Individual Tests
290
+ ==== Run individual tests
268
291
 
269
292
  If you only want to run a single test, or a group of tests, you can do so by tagging the test cases, then filtering the test run using that tag.
270
293
 
@@ -291,6 +314,40 @@ Run RSpec with the example filter:
291
314
 
292
315
  RSpec will only run the specifications that have a description containing the text `wrap`.
293
316
 
317
+ === Generate code coverage
318
+
319
+ To generate a code coverage report when running tests using simplecov, set the `COVERAGE` environment variable as follows when running the tests:
320
+
321
+ $ COVERAGE=true bundle exec rake
322
+
323
+ You'll see a total coverage score as well as a link to the HTML report in the output.
324
+ The HTML report helps you understand which lines and branches were missed, if any.
325
+
326
+ Despite being fast, the downside of using simplecov is that it misses branches.
327
+ You can use deep-cover to generate a more thorough report.
328
+ To do so, set the `COVERAGE` environment variable as follows when running the tests:
329
+
330
+ $ COVERAGE=deep bundle exec rake
331
+
332
+ You'll see a total coverage score, a detailed coverage report, and a link to HTML report in the output.
333
+ The HTML report helps you understand which lines and branches were missed, if any.
334
+
335
+ As an alternative to deep cover's native HTML reporter, you can also use istanbul / nyc.
336
+ First, you'll need to have the `nyc` command available on your system:
337
+
338
+ $ npm install -g nyc
339
+
340
+ or
341
+
342
+ $ yarn global add nyc
343
+
344
+ Next, in addition to the `COVERAGE` environment variable, also set the `DEEP_COVER_REPORTER` environment variable as follows when running the tests:
345
+
346
+ $ COVERAGE=deep DEEP_COVER_REPORTER=istanbul bundle exec rake
347
+
348
+ You'll see a total coverage score, a detailed coverage report, and a link to HTML report in the output.
349
+ The HTML report helps you understand which lines and branches were missed, if any.
350
+
294
351
  === Usage
295
352
 
296
353
  When running the `kramdoc` command from source, you must prefix the command with `bundle exec`:
@@ -310,7 +367,7 @@ To avoid having to do this, or make the `kramdoc` command available from anywher
310
367
 
311
368
  == Copyright
312
369
 
313
- Copyright (C) 2016-2018 OpenDevise Inc. (on behalf of the Asciidoctor Project).
370
+ Copyright (C) 2016-2019 OpenDevise Inc. (on behalf of the Asciidoctor Project).
314
371
  Free use of this software is granted under the terms of the MIT License.
315
372
 
316
373
  See the link:LICENSE.adoc[LICENSE] file for details.