reverse-adoc

Crystal port — part of the aloli-crystal document processing ecosystem

= 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: reverse-adoc: github: aloli-crystal/reverse-adoc version: "~> 2.0.0.5"

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]

reverse-adoc input.html reverse-adoc input.html -o output.adoc reverse-adoc document.docx reverse-adoc -v 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

reverse-adoc

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • about 3 hours ago
  • April 14, 2026
License

MIT License

Links
Synced at

Wed, 29 Jul 2026 07:39:04 GMT

Languages