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.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +135 -2
- data/Gemfile +18 -3
- data/LICENSE.adoc +1 -1
- data/README.adoc +95 -38
- data/bin/kramdoc +3 -1
- data/kramdown-asciidoc.gemspec +9 -10
- data/lib/kramdoc.rb +2 -0
- data/lib/kramdown-asciidoc.rb +10 -2
- data/lib/kramdown-asciidoc/api.rb +91 -19
- data/lib/kramdown-asciidoc/cli.rb +21 -10
- data/lib/kramdown-asciidoc/converter.rb +167 -100
- data/lib/kramdown-asciidoc/core_ext/regexp/is_match.rb +12 -2
- data/lib/kramdown-asciidoc/kramdown_ext/parser/base.rb +16 -0
- data/lib/kramdown-asciidoc/kramdown_ext/parser/html.rb +7 -1
- data/lib/kramdown-asciidoc/preprocessors.rb +66 -0
- data/lib/kramdown-asciidoc/version.rb +7 -3
- data/lib/kramdown-asciidoc/writer.rb +30 -25
- metadata +34 -820
- data/Rakefile +0 -3
- data/spec/api_spec.rb +0 -158
- data/spec/cli_spec.rb +0 -268
- data/spec/converter_spec.rb +0 -271
- data/spec/scenario_spec.rb +0 -25
- data/spec/scenarios/a/bare-interdoc-xref.adoc +0 -1
- data/spec/scenarios/a/bare-interdoc-xref.md +0 -1
- data/spec/scenarios/a/bare-url.adoc +0 -1
- data/spec/scenarios/a/bare-url.md +0 -1
- data/spec/scenarios/a/containing-inline-image.adoc +0 -5
- data/spec/scenarios/a/containing-inline-image.md +0 -5
- data/spec/scenarios/a/double-underscore-in-url.adoc +0 -1
- data/spec/scenarios/a/double-underscore-in-url.md +0 -1
- data/spec/scenarios/a/interdoc-xref.adoc +0 -1
- data/spec/scenarios/a/interdoc-xref.md +0 -1
- data/spec/scenarios/a/internal.adoc +0 -5
- data/spec/scenarios/a/internal.md +0 -5
- data/spec/scenarios/a/local.adoc +0 -1
- data/spec/scenarios/a/local.md +0 -1
- data/spec/scenarios/a/no-auto-links.adoc +0 -3
- data/spec/scenarios/a/no-auto-links.md +0 -3
- data/spec/scenarios/a/no-auto-links.opts +0 -1
- data/spec/scenarios/a/url-matches-text.adoc +0 -2
- data/spec/scenarios/a/url-matches-text.md +0 -2
- data/spec/scenarios/a/url-with-text.adoc +0 -1
- data/spec/scenarios/a/url-with-text.md +0 -1
- data/spec/scenarios/blockquote/attribution-separated.adoc +0 -5
- data/spec/scenarios/blockquote/attribution-separated.md +0 -5
- data/spec/scenarios/blockquote/attribution.adoc +0 -5
- data/spec/scenarios/blockquote/attribution.md +0 -3
- data/spec/scenarios/blockquote/basic.adoc +0 -3
- data/spec/scenarios/blockquote/basic.md +0 -1
- data/spec/scenarios/blockquote/deep-nested.adoc +0 -17
- data/spec/scenarios/blockquote/deep-nested.md +0 -6
- data/spec/scenarios/blockquote/list.adoc +0 -5
- data/spec/scenarios/blockquote/list.md +0 -3
- data/spec/scenarios/blockquote/multiple-lines.adoc +0 -5
- data/spec/scenarios/blockquote/multiple-lines.md +0 -3
- data/spec/scenarios/blockquote/nested.adoc +0 -7
- data/spec/scenarios/blockquote/nested.md +0 -3
- data/spec/scenarios/br/leading-tag.adoc +0 -2
- data/spec/scenarios/br/leading-tag.md +0 -2
- data/spec/scenarios/br/tag-followed-by-newline.adoc +0 -3
- data/spec/scenarios/br/tag-followed-by-newline.md +0 -3
- data/spec/scenarios/br/tag-in-table-cell.adoc +0 -4
- data/spec/scenarios/br/tag-in-table-cell.md +0 -1
- data/spec/scenarios/br/tag-preceded-by-space.adoc +0 -3
- data/spec/scenarios/br/tag-preceded-by-space.md +0 -1
- data/spec/scenarios/br/tag.adoc +0 -3
- data/spec/scenarios/br/tag.md +0 -1
- data/spec/scenarios/br/trailing-double-space.adoc +0 -3
- data/spec/scenarios/br/trailing-double-space.md +0 -3
- data/spec/scenarios/codeblock/command-prompt.adoc +0 -1
- data/spec/scenarios/codeblock/command-prompt.md +0 -1
- data/spec/scenarios/codeblock/contiguous-lines.adoc +0 -3
- data/spec/scenarios/codeblock/contiguous-lines.md +0 -3
- data/spec/scenarios/codeblock/fenced/command-prompt.adoc +0 -1
- data/spec/scenarios/codeblock/fenced/command-prompt.md +0 -3
- data/spec/scenarios/codeblock/fenced/language.adoc +0 -8
- data/spec/scenarios/codeblock/fenced/language.md +0 -7
- data/spec/scenarios/codeblock/fenced/non-contiguous-command-prompts.adoc +0 -6
- data/spec/scenarios/codeblock/fenced/non-contiguous-command-prompts.md +0 -5
- data/spec/scenarios/codeblock/fenced/without-language.adoc +0 -5
- data/spec/scenarios/codeblock/fenced/without-language.md +0 -5
- data/spec/scenarios/codeblock/non-contiguous-command-prompts.adoc +0 -6
- data/spec/scenarios/codeblock/non-contiguous-command-prompts.md +0 -3
- data/spec/scenarios/codeblock/non-contiguous-lines.adoc +0 -7
- data/spec/scenarios/codeblock/non-contiguous-lines.md +0 -5
- data/spec/scenarios/codespan/caret.adoc +0 -1
- data/spec/scenarios/codespan/caret.md +0 -1
- data/spec/scenarios/codespan/constrained-triple.adoc +0 -1
- data/spec/scenarios/codespan/constrained-triple.md +0 -1
- data/spec/scenarios/codespan/constrained.adoc +0 -1
- data/spec/scenarios/codespan/constrained.md +0 -1
- data/spec/scenarios/codespan/literal.adoc +0 -15
- data/spec/scenarios/codespan/literal.md +0 -15
- data/spec/scenarios/codespan/plus-plus.adoc +0 -1
- data/spec/scenarios/codespan/plus-plus.md +0 -1
- data/spec/scenarios/codespan/possessive.adoc +0 -3
- data/spec/scenarios/codespan/possessive.md +0 -3
- data/spec/scenarios/codespan/quoted.adoc +0 -1
- data/spec/scenarios/codespan/quoted.md +0 -1
- data/spec/scenarios/codespan/smart-quotes.adoc +0 -1
- data/spec/scenarios/codespan/smart-quotes.md +0 -1
- data/spec/scenarios/codespan/star-star.adoc +0 -1
- data/spec/scenarios/codespan/star-star.md +0 -1
- data/spec/scenarios/codespan/unconstrained.adoc +0 -7
- data/spec/scenarios/codespan/unconstrained.md +0 -7
- data/spec/scenarios/dl/compound-only.adoc +0 -16
- data/spec/scenarios/dl/compound-only.md +0 -13
- data/spec/scenarios/dl/compound.adoc +0 -11
- data/spec/scenarios/dl/compound.md +0 -7
- data/spec/scenarios/dl/empty-dd.adoc +0 -3
- data/spec/scenarios/dl/empty-dd.md +0 -4
- data/spec/scenarios/dl/nested-bookended.adoc +0 -8
- data/spec/scenarios/dl/nested-bookended.md +0 -6
- data/spec/scenarios/dl/nested-mixed.adoc +0 -11
- data/spec/scenarios/dl/nested-mixed.md +0 -11
- data/spec/scenarios/dl/nested.adoc +0 -15
- data/spec/scenarios/dl/nested.md +0 -23
- data/spec/scenarios/dl/simple.adoc +0 -9
- data/spec/scenarios/dl/simple.md +0 -10
- data/spec/scenarios/em/asterisks.adoc +0 -1
- data/spec/scenarios/em/asterisks.md +0 -1
- data/spec/scenarios/em/constrained.adoc +0 -1
- data/spec/scenarios/em/constrained.md +0 -1
- data/spec/scenarios/em/strong.adoc +0 -1
- data/spec/scenarios/em/strong.md +0 -1
- data/spec/scenarios/em/unconstrained.adoc +0 -4
- data/spec/scenarios/em/unconstrained.md +0 -4
- data/spec/scenarios/entity/numeric.adoc +0 -1
- data/spec/scenarios/entity/numeric.md +0 -1
- data/spec/scenarios/entity/reverse.adoc +0 -5
- data/spec/scenarios/entity/reverse.md +0 -5
- data/spec/scenarios/heading/auto-id-prefix.adoc +0 -11
- data/spec/scenarios/heading/auto-id-prefix.md +0 -7
- data/spec/scenarios/heading/auto-id-prefix.opts +0 -2
- data/spec/scenarios/heading/auto-ids.adoc +0 -11
- data/spec/scenarios/heading/auto-ids.md +0 -7
- data/spec/scenarios/heading/auto-ids.opts +0 -1
- data/spec/scenarios/heading/block-title.adoc +0 -11
- data/spec/scenarios/heading/block-title.md +0 -11
- data/spec/scenarios/heading/formatting.adoc +0 -1
- data/spec/scenarios/heading/formatting.md +0 -1
- data/spec/scenarios/heading/leading-anchor.adoc +0 -2
- data/spec/scenarios/heading/leading-anchor.md +0 -1
- data/spec/scenarios/heading/no-auto-ids.adoc +0 -3
- data/spec/scenarios/heading/no-auto-ids.md +0 -3
- data/spec/scenarios/heading/no-auto-ids.opts +0 -3
- data/spec/scenarios/heading/not-block-title.adoc +0 -8
- data/spec/scenarios/heading/not-block-title.md +0 -7
- data/spec/scenarios/heading/offset.adoc +0 -5
- data/spec/scenarios/heading/offset.md +0 -5
- data/spec/scenarios/heading/offset.opts +0 -1
- data/spec/scenarios/heading/out-of-sequence.adoc +0 -23
- data/spec/scenarios/heading/out-of-sequence.md +0 -21
- data/spec/scenarios/heading/outline.adoc +0 -13
- data/spec/scenarios/heading/outline.md +0 -13
- data/spec/scenarios/heading/surrounding-anchor.adoc +0 -2
- data/spec/scenarios/heading/surrounding-anchor.md +0 -1
- data/spec/scenarios/hr/around-block.adoc +0 -5
- data/spec/scenarios/hr/around-block.md +0 -5
- data/spec/scenarios/hr/between-blocks.adoc +0 -5
- data/spec/scenarios/hr/between-blocks.md +0 -5
- data/spec/scenarios/hr/dashes.adoc +0 -1
- data/spec/scenarios/hr/dashes.md +0 -1
- data/spec/scenarios/html_element/abbr.adoc +0 -1
- data/spec/scenarios/html_element/abbr.md +0 -1
- data/spec/scenarios/html_element/admonition.adoc +0 -5
- data/spec/scenarios/html_element/admonition.md +0 -7
- data/spec/scenarios/html_element/div-mixed.adoc +0 -1
- data/spec/scenarios/html_element/div-mixed.md +0 -4
- data/spec/scenarios/html_element/div-text-only.adoc +0 -1
- data/spec/scenarios/html_element/div-text-only.md +0 -1
- data/spec/scenarios/html_element/empty-p.adoc +0 -5
- data/spec/scenarios/html_element/empty-p.md +0 -5
- data/spec/scenarios/html_element/heading-with-class.adoc +0 -7
- data/spec/scenarios/html_element/heading-with-class.md +0 -5
- data/spec/scenarios/html_element/heading-with-id.adoc +0 -2
- data/spec/scenarios/html_element/heading-with-id.md +0 -1
- data/spec/scenarios/html_element/img-with-alt-and-width.adoc +0 -1
- data/spec/scenarios/html_element/img-with-alt-and-width.md +0 -1
- data/spec/scenarios/html_element/img-with-percentage-width-css.adoc +0 -1
- data/spec/scenarios/html_element/img-with-percentage-width-css.md +0 -1
- data/spec/scenarios/html_element/img-with-percentage-width.adoc +0 -1
- data/spec/scenarios/html_element/img-with-percentage-width.md +0 -1
- data/spec/scenarios/html_element/img-with-width-css.adoc +0 -1
- data/spec/scenarios/html_element/img-with-width-css.md +0 -1
- data/spec/scenarios/html_element/img-with-width.adoc +0 -1
- data/spec/scenarios/html_element/img-with-width.md +0 -1
- data/spec/scenarios/html_element/img.adoc +0 -2
- data/spec/scenarios/html_element/img.md +0 -1
- data/spec/scenarios/html_element/mark.adoc +0 -1
- data/spec/scenarios/html_element/mark.md +0 -1
- data/spec/scenarios/html_element/native.adoc +0 -1
- data/spec/scenarios/html_element/native.md +0 -1
- data/spec/scenarios/html_element/pre-code-with-language.adoc +0 -6
- data/spec/scenarios/html_element/pre-code-with-language.md +0 -4
- data/spec/scenarios/html_element/span.adoc +0 -3
- data/spec/scenarios/html_element/span.md +0 -3
- data/spec/scenarios/html_element/strike.adoc +0 -1
- data/spec/scenarios/html_element/strike.md +0 -1
- data/spec/scenarios/html_element/sub.adoc +0 -1
- data/spec/scenarios/html_element/sub.md +0 -1
- data/spec/scenarios/html_element/sup.adoc +0 -1
- data/spec/scenarios/html_element/sup.md +0 -1
- data/spec/scenarios/html_element/unrecognized-admonition.adoc +0 -5
- data/spec/scenarios/html_element/unrecognized-admonition.md +0 -5
- data/spec/scenarios/img/block-in-list.adoc +0 -5
- data/spec/scenarios/img/block-in-list.md +0 -5
- data/spec/scenarios/img/block-with-alt.adoc +0 -1
- data/spec/scenarios/img/block-with-alt.md +0 -1
- data/spec/scenarios/img/block-with-link-and-alt.adoc +0 -1
- data/spec/scenarios/img/block-with-link-and-alt.md +0 -1
- data/spec/scenarios/img/block-with-link.adoc +0 -1
- data/spec/scenarios/img/block-with-link.md +0 -1
- data/spec/scenarios/img/block.adoc +0 -1
- data/spec/scenarios/img/block.md +0 -1
- data/spec/scenarios/img/imagesdir.adoc +0 -4
- data/spec/scenarios/img/imagesdir.md +0 -3
- data/spec/scenarios/img/imagesdir.opts +0 -2
- data/spec/scenarios/img/implicit-imagesdir.adoc +0 -3
- data/spec/scenarios/img/implicit-imagesdir.md +0 -3
- data/spec/scenarios/img/implicit-imagesdir.opts +0 -1
- data/spec/scenarios/img/inline-with-alt.adoc +0 -1
- data/spec/scenarios/img/inline-with-alt.md +0 -1
- data/spec/scenarios/img/inline-with-link-and-alt.adoc +0 -1
- data/spec/scenarios/img/inline-with-link-and-alt.md +0 -1
- data/spec/scenarios/img/inline-with-link.adoc +0 -1
- data/spec/scenarios/img/inline-with-link.md +0 -1
- data/spec/scenarios/img/inline.adoc +0 -1
- data/spec/scenarios/img/inline.md +0 -1
- data/spec/scenarios/ol/compound-separated.adoc +0 -29
- data/spec/scenarios/ol/compound-separated.md +0 -25
- data/spec/scenarios/ol/compound.adoc +0 -29
- data/spec/scenarios/ol/compound.md +0 -20
- data/spec/scenarios/ol/formatted.adoc +0 -3
- data/spec/scenarios/ol/formatted.md +0 -3
- data/spec/scenarios/ol/mixed-separated.adoc +0 -6
- data/spec/scenarios/ol/mixed-separated.md +0 -11
- data/spec/scenarios/ol/mixed.adoc +0 -6
- data/spec/scenarios/ol/mixed.md +0 -6
- data/spec/scenarios/ol/nested-mixed.adoc +0 -8
- data/spec/scenarios/ol/nested-mixed.md +0 -8
- data/spec/scenarios/ol/nested-separated.adoc +0 -7
- data/spec/scenarios/ol/nested-separated.md +0 -13
- data/spec/scenarios/ol/nested.adoc +0 -7
- data/spec/scenarios/ol/nested.md +0 -7
- data/spec/scenarios/ol/simple-separated.adoc +0 -4
- data/spec/scenarios/ol/simple-separated.md +0 -7
- data/spec/scenarios/ol/simple.adoc +0 -4
- data/spec/scenarios/ol/simple.md +0 -4
- data/spec/scenarios/p/admonition/emphasis.adoc +0 -11
- data/spec/scenarios/p/admonition/emphasis.md +0 -11
- data/spec/scenarios/p/admonition/in-blockquote.adoc +0 -1
- data/spec/scenarios/p/admonition/in-blockquote.md +0 -1
- data/spec/scenarios/p/admonition/in-compound-blockquote.adoc +0 -5
- data/spec/scenarios/p/admonition/in-compound-blockquote.md +0 -3
- data/spec/scenarios/p/admonition/in-list-item.adoc +0 -6
- data/spec/scenarios/p/admonition/in-list-item.md +0 -6
- data/spec/scenarios/p/admonition/label-only.adoc +0 -1
- data/spec/scenarios/p/admonition/label-only.md +0 -1
- data/spec/scenarios/p/admonition/plain.adoc +0 -13
- data/spec/scenarios/p/admonition/plain.md +0 -13
- data/spec/scenarios/p/admonition/strong-emphasis.adoc +0 -11
- data/spec/scenarios/p/admonition/strong-emphasis.md +0 -11
- data/spec/scenarios/p/multiple-lines.adoc +0 -2
- data/spec/scenarios/p/multiple-lines.md +0 -2
- data/spec/scenarios/p/sequential.adoc +0 -3
- data/spec/scenarios/p/sequential.md +0 -3
- data/spec/scenarios/p/single-line.adoc +0 -1
- data/spec/scenarios/p/single-line.md +0 -1
- data/spec/scenarios/root/body-only.adoc +0 -1
- data/spec/scenarios/root/body-only.md +0 -1
- data/spec/scenarios/root/book-doctype.adoc +0 -10
- data/spec/scenarios/root/book-doctype.md +0 -9
- data/spec/scenarios/root/header-and-body.adoc +0 -3
- data/spec/scenarios/root/header-and-body.md +0 -3
- data/spec/scenarios/root/header-only.adoc +0 -1
- data/spec/scenarios/root/header-only.md +0 -1
- data/spec/scenarios/smart_quote/apostrophe.adoc +0 -1
- data/spec/scenarios/smart_quote/apostrophe.md +0 -1
- data/spec/scenarios/smart_quote/double-quotes.adoc +0 -1
- data/spec/scenarios/smart_quote/double-quotes.md +0 -1
- data/spec/scenarios/smart_quote/single-quotes.adoc +0 -1
- data/spec/scenarios/smart_quote/single-quotes.md +0 -1
- data/spec/scenarios/strong/constrained.adoc +0 -1
- data/spec/scenarios/strong/constrained.md +0 -1
- data/spec/scenarios/strong/menu.adoc +0 -3
- data/spec/scenarios/strong/menu.md +0 -1
- data/spec/scenarios/strong/nested-emphasis.adoc +0 -1
- data/spec/scenarios/strong/nested-emphasis.md +0 -1
- data/spec/scenarios/strong/unconstrained.adoc +0 -8
- data/spec/scenarios/strong/unconstrained.md +0 -8
- data/spec/scenarios/table/alignment.adoc +0 -19
- data/spec/scenarios/table/alignment.md +0 -8
- data/spec/scenarios/table/cell-with-image.adoc +0 -9
- data/spec/scenarios/table/cell-with-image.md +0 -4
- data/spec/scenarios/table/cell-with-pipe.adoc +0 -5
- data/spec/scenarios/table/cell-with-pipe.md +0 -1
- data/spec/scenarios/table/header.adoc +0 -9
- data/spec/scenarios/table/header.md +0 -4
- data/spec/scenarios/table/no-header.adoc +0 -8
- data/spec/scenarios/table/no-header.md +0 -2
- data/spec/scenarios/table/single-column-with-header.adoc +0 -6
- data/spec/scenarios/table/single-column-with-header.md +0 -4
- data/spec/scenarios/table/single-column-without-header.adoc +0 -4
- data/spec/scenarios/table/single-column-without-header.md +0 -2
- data/spec/scenarios/text/attribute-reference.adoc +0 -1
- data/spec/scenarios/text/attribute-reference.md +0 -1
- data/spec/scenarios/text/caret.adoc +0 -1
- data/spec/scenarios/text/caret.md +0 -1
- data/spec/scenarios/text/lte.adoc +0 -1
- data/spec/scenarios/text/lte.md +0 -1
- data/spec/scenarios/text/nbsp.adoc +0 -1
- data/spec/scenarios/text/nbsp.md +0 -1
- data/spec/scenarios/text/plus-plus.adoc +0 -6
- data/spec/scenarios/text/plus-plus.md +0 -5
- data/spec/scenarios/text/right-arrow.adoc +0 -1
- data/spec/scenarios/text/right-arrow.md +0 -1
- data/spec/scenarios/text/typographic_sym/apostrophe.adoc +0 -3
- data/spec/scenarios/text/typographic_sym/apostrophe.md +0 -3
- data/spec/scenarios/text/typographic_sym/double-quotes.adoc +0 -1
- data/spec/scenarios/text/typographic_sym/double-quotes.md +0 -1
- data/spec/scenarios/text/typographic_sym/ellipsis.adoc +0 -1
- data/spec/scenarios/text/typographic_sym/ellipsis.md +0 -1
- data/spec/scenarios/text/typographic_sym/mdash.adoc +0 -1
- data/spec/scenarios/text/typographic_sym/mdash.md +0 -1
- data/spec/scenarios/text/typographic_sym/ndash.adoc +0 -1
- data/spec/scenarios/text/typographic_sym/ndash.md +0 -1
- data/spec/scenarios/text/typographic_sym/single-quotes.adoc +0 -1
- data/spec/scenarios/text/typographic_sym/single-quotes.md +0 -1
- data/spec/scenarios/trailing_space.adoc +0 -7
- data/spec/scenarios/trailing_space.md +0 -7
- data/spec/scenarios/typographic_sym/ellipsis.adoc +0 -1
- data/spec/scenarios/typographic_sym/ellipsis.md +0 -1
- data/spec/scenarios/typographic_sym/mdash.adoc +0 -1
- data/spec/scenarios/typographic_sym/mdash.md +0 -1
- data/spec/scenarios/typographic_sym/ndash.adoc +0 -1
- data/spec/scenarios/typographic_sym/ndash.md +0 -1
- data/spec/scenarios/ul/blockquote.adoc +0 -5
- data/spec/scenarios/ul/blockquote.md +0 -2
- data/spec/scenarios/ul/compound-nested.adoc +0 -23
- data/spec/scenarios/ul/compound-nested.md +0 -19
- data/spec/scenarios/ul/compound-only.adoc +0 -5
- data/spec/scenarios/ul/compound-only.md +0 -3
- data/spec/scenarios/ul/compound-separated.adoc +0 -41
- data/spec/scenarios/ul/compound-separated.md +0 -32
- data/spec/scenarios/ul/compound.adoc +0 -41
- data/spec/scenarios/ul/compound.md +0 -26
- data/spec/scenarios/ul/formatted.adoc +0 -3
- data/spec/scenarios/ul/formatted.md +0 -3
- data/spec/scenarios/ul/inside-delimited-block.adoc +0 -9
- data/spec/scenarios/ul/inside-delimited-block.md +0 -7
- data/spec/scenarios/ul/nested-bookended.adoc +0 -7
- data/spec/scenarios/ul/nested-bookended.md +0 -7
- data/spec/scenarios/ul/nested-separated.adoc +0 -11
- data/spec/scenarios/ul/nested-separated.md +0 -21
- data/spec/scenarios/ul/nested.adoc +0 -11
- data/spec/scenarios/ul/nested.md +0 -11
- data/spec/scenarios/ul/simple-separated.adoc +0 -3
- data/spec/scenarios/ul/simple-separated.md +0 -5
- data/spec/scenarios/ul/simple.adoc +0 -3
- data/spec/scenarios/ul/simple.md +0 -3
- data/spec/scenarios/wrap/containing-line-comment.adoc +0 -3
- data/spec/scenarios/wrap/containing-line-comment.md +0 -3
- data/spec/scenarios/wrap/containing-line-comment.opts +0 -1
- data/spec/scenarios/wrap/none.adoc +0 -1
- data/spec/scenarios/wrap/none.md +0 -4
- data/spec/scenarios/wrap/none.opts +0 -1
- data/spec/scenarios/wrap/preserve.adoc +0 -5
- data/spec/scenarios/wrap/preserve.md +0 -5
- data/spec/scenarios/wrap/preserve.opts +0 -1
- data/spec/scenarios/wrap/ventilate-exclamation.adoc +0 -3
- data/spec/scenarios/wrap/ventilate-exclamation.md +0 -1
- data/spec/scenarios/wrap/ventilate-exclamation.opts +0 -1
- data/spec/scenarios/wrap/ventilate-french.adoc +0 -3
- data/spec/scenarios/wrap/ventilate-french.md +0 -1
- data/spec/scenarios/wrap/ventilate-french.opts +0 -1
- data/spec/scenarios/wrap/ventilate-question.adoc +0 -3
- data/spec/scenarios/wrap/ventilate-question.md +0 -3
- data/spec/scenarios/wrap/ventilate-question.opts +0 -1
- data/spec/scenarios/wrap/ventilate-table-cell.adoc +0 -9
- data/spec/scenarios/wrap/ventilate-table-cell.md +0 -3
- data/spec/scenarios/wrap/ventilate-table-cell.opts +0 -1
- data/spec/scenarios/wrap/ventilate-with-comments.adoc +0 -5
- data/spec/scenarios/wrap/ventilate-with-comments.md +0 -5
- data/spec/scenarios/wrap/ventilate-with-comments.opts +0 -1
- data/spec/scenarios/wrap/ventilate.adoc +0 -2
- data/spec/scenarios/wrap/ventilate.md +0 -6
- data/spec/scenarios/wrap/ventilate.opts +0 -1
- data/spec/scenarios/xml_comment/above-block.adoc +0 -7
- data/spec/scenarios/xml_comment/above-block.md +0 -5
- data/spec/scenarios/xml_comment/above-header.adoc +0 -13
- data/spec/scenarios/xml_comment/above-header.md +0 -16
- data/spec/scenarios/xml_comment/at-start-of-line.adoc +0 -9
- data/spec/scenarios/xml_comment/at-start-of-line.md +0 -4
- data/spec/scenarios/xml_comment/block.adoc +0 -7
- data/spec/scenarios/xml_comment/block.md +0 -6
- data/spec/scenarios/xml_comment/line-adjacent-to-text.adoc +0 -2
- data/spec/scenarios/xml_comment/line-adjacent-to-text.md +0 -1
- data/spec/scenarios/xml_comment/line-empty.adoc +0 -7
- data/spec/scenarios/xml_comment/line-empty.md +0 -9
- data/spec/scenarios/xml_comment/line-offset-by-space.adoc +0 -1
- data/spec/scenarios/xml_comment/line-offset-by-space.md +0 -1
- data/spec/scenarios/xml_comment/line.adoc +0 -1
- data/spec/scenarios/xml_comment/line.md +0 -1
- data/spec/scenarios/xml_comment/list-separator.adoc +0 -7
- data/spec/scenarios/xml_comment/list-separator.md +0 -7
- data/spec/scenarios/xml_comment/mixed.adoc +0 -7
- data/spec/scenarios/xml_comment/mixed.md +0 -6
- data/spec/scenarios/xml_comment/multiline-span.adoc +0 -8
- data/spec/scenarios/xml_comment/multiline-span.md +0 -7
- data/spec/scenarios/xml_comment/p-separator.adoc +0 -5
- data/spec/scenarios/xml_comment/p-separator.md +0 -5
- data/spec/scenarios/xml_comment/styled.adoc +0 -6
- data/spec/scenarios/xml_comment/styled.md +0 -6
- data/spec/scenarios/xml_comment/surrounded-by-spaces.adoc +0 -3
- data/spec/scenarios/xml_comment/surrounded-by-spaces.md +0 -1
- data/spec/spec_helper.rb +0 -41
- data/spec/writer_spec.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be0108c05d441dbc4125ed5fa6f51d152ae238d769cf5add12a0c35000c237e4
|
4
|
+
data.tar.gz: 77fec67f63c28cb7611c45aaca839292cb19686e8d9e02cd87ed31a129fd939a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 \–
|
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',
|
7
|
-
gem '
|
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
|
-
|
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
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
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:{
|
37
|
-
image:{
|
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
|
-
{
|
42
|
-
Notably, the converter generates modern AsciiDoc syntax suitable for use with {
|
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.
|
47
|
-
|
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 {
|
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
|
54
|
+
{project-name} is published to RubyGems.org as a gem named *{project-handle}*.
|
59
55
|
|
60
|
-
You can install the
|
56
|
+
You can install the latest version of the gem using the following command:
|
61
57
|
|
62
|
-
$ gem install kramdown-asciidoc
|
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-
|
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
|
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 {
|
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 {
|
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 {
|
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 {
|
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
|
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
|
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-
|
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.
|