asciidoctor / kramdown-asciidoc

A kramdown extension for converting Markdown documents to AsciiDoc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a converter API

mojavelinux opened this issue · comments

Add a top-level converter API that encapsulates instantiating the Kramdown document and invoking the to_asciidoc method on it. To match the CLI name, the API should be named Kramdoc.

  • Kramdoc.convert_file file
  • Kramdoc.convert string

Update the CLI to use this API instead of interfacing with Kramdown directly.

I added support for a :to option on the Kramdoc.convert method so that it can be used to write a file even when the source is a string.

I also aliased Kramdoc to Kramdown::AsciiDoc for completeness.