Add a converter API
mojavelinux opened this issue · comments
Dan Allen commented
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.
Dan Allen commented
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.