Getting started

Ceradoc turns documents into a canonical CoreModel and back. This guide walks through installing the gems and running your first conversion.

Install

The hub gem is pulled in automatically by the fronts and renderers. To work with AsciiDoc:

$ gem install ceradoc-adoc

To also render HTML and DOCX:

$ gem install ceradoc-html ceradoc-docx

Parse a document into the CoreModel

The ceradoc CLI parses a source document into the canonical CoreModel:

$ ceradoc parse document.adoc --to core

This produces the harmonized CoreModel representation of the document — sections, blocks, tables, lists, inline content, metadata — independent of the source format.

Render to another format

Once a document is in the CoreModel, any registered renderer can consume it:

$ ceradoc render document.adoc --to html

Using the library from Ruby

End-to-end conversion routes through the hub:

require "ceradoc"

core = Ceradoc.parse(text, format: :asciidoc)  # source -> CoreModel
html = Ceradoc.serialize(core, to: :html)      # CoreModel -> target

What next?

  • Hub-and-spoke architecture — how parse → CoreModel → render works, and what bidirectional ToCoreModel/FromCoreModel transformers do.
  • About Ceradoc — the name, the rename history, and the gem suite.