crystal-reverse-adoc
= crystal-reverse-adoc
Converts HTML to AsciiDoc. Crystal port of the https://github.com/xijo/reverse_adoc[reverse_adoc] Ruby gem (v2.0.0).
== Installation
Add the dependency to your shard.yml:
[source,yaml]
dependencies: crystal-reverse-adoc: github: aloli-crystal/crystal-reverse-adoc
Run shards install.
== Usage
=== As a library
[source,crystal]
require "reverse_adoc"
html = "Title
A paragraph with bold text.
" adoc = ReverseAdoc.convert(html) puts adoc=== Word .docx support
[source,crystal]
require "reverse_adoc"
adoc = ReverseAdoc.convert_docx("document.docx") puts adoc
=== CLI
[source,shell]
crystal-reverse-adoc input.html crystal-reverse-adoc input.html -o output.adoc crystal-reverse-adoc document.docx crystal-reverse-adoc -v crystal-reverse-adoc -h
== Supported elements
[cols="1,1"] |=== | HTML | AsciiDoc
| <h1> to <h6> | = Title to ====== Title | <p> | Paragraph | <strong>, <b> | *bold* | <em>, <i> | _italic_ | <code> | \code`|
| Source block with language detection ||link:url[text]orhttps://url[text]` | <img> | image::src[alt] | <ul>/<li> | * item | <ol>/<li> | . item | <dl>/<dt>/<dd> | term:: definition | <table> | AsciiDoc table | <blockquote> | Quote block | <hr> | ''' | <br> | Hard line break | <sup> | ^text^ | <sub> | ~text~ | <del>, <s> | [.line-through]#text# | Admonition divs | NOTE:, TIP:, etc. |===
== Development
[source,shell]
crystal spec crystal tool format src/ spec/
== License
MIT
Repository
crystal-reverse-adoc
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- about 7 hours ago
- April 14, 2026
License
MIT License
Links
Synced at
Tue, 14 Apr 2026 21:13:10 GMT
Languages