The ceradoc command-line interface provides document conversion and processing capabilities.
Global Options
These options apply to all commands:
--verbose, -v | Enable verbose output |
--quiet, -q | Suppress non-essential output |
--config FILE | Path to configuration file (default: |
--help, -h | Show help message |
--version | Show version information |
Commands
convert
Convert documents between formats.
ceradoc convert INPUT [OPTIONS]
INPUT | Input file path (required) |
--output, -o FILE | Output file path (default: stdout) |
--from, -f FORMAT | Source format (auto-detected from extension) |
--to, -t FORMAT | Target format (required unless output extension specified) |
--theme THEME | HTML theme (classic, modern, minimal) |
--validate | Validate document before conversion |
--strip-comments | Remove comments from output |
--preserve-ids | Preserve element IDs during conversion |
--base-dir DIR | Base directory for include resolution |
asciidoc, adoc | AsciiDoc format |
markdown, md | CommonMark Markdown |
html | HTML5 |
docx | Microsoft Word DOCX (requires ceradoc-docx gem) |
# Convert Markdown to HTML (output to stdout) ceradoc convert document.md # Convert to specific output file ceradoc convert document.md -o output.html # Convert AsciiDoc to Markdown ceradoc convert input.adoc --to markdown -o output.md # Convert DOCX to AsciiDoc (requires ceradoc-docx gem) ceradoc convert document.docx -o output.adoc # Convert DOCX to Markdown ceradoc convert document.docx -o output.md # Auto-detect output format from extension ceradoc convert input.md -o output.adoc # Convert with modern HTML theme ceradoc convert input.adoc -o output.html --theme modern # Convert with validation ceradoc convert important.adoc -o output.html --validate # Verbose output ceradoc convert document.md -o output.html --verbose
0 | Success |
1 | General error (file not found, parse error, etc.) |
2 | Validation error |
3 | Unsupported format |
parse
Parse a document and output the document structure.
ceradoc parse INPUT [OPTIONS]
INPUT | Input file path (required) |
--format, -f FORMAT | Source format (auto-detected) |
--output, -o FILE | Output file for structure dump |
--json | Output as JSON |
--yaml | Output as YAML |
--show-model | Show CoreModel structure |
--show-ast | Show parse tree (AST) |
# Parse and show document structure ceradoc parse document.adoc # Parse and output as JSON ceradoc parse document.md --json -o structure.json # Show CoreModel representation ceradoc parse input.adoc --show-model # Show raw AST ceradoc parse input.md --show-ast
formats
List supported formats and their capabilities.
ceradoc formats [OPTIONS]
--json | Output as JSON |
--detailed | Show detailed feature support |
# List supported formats ceradoc formats # Detailed feature matrix ceradoc formats --detailed # JSON output for scripting ceradoc formats --json
Supported Formats:
asciidoc (.adoc, .asciidoc)
- Parse: ✓
- Serialize: ✓
- Features: tables, lists, blocks, continuation
markdown (.md, .markdown)
- Parse: ✓
- Serialize: ✓
- Features: tables, lists, code blocks
html (.html, .htm)
- Parse: ✓
- Serialize: ✓
- Features: semantic HTML, tablesvalidate
Validate a document against its format specification.
ceradoc validate INPUT [OPTIONS]
INPUT | Input file path (required) |
--format, -f FORMAT | Source format (auto-detected) |
--schema FILE | Custom validation schema |
--strict | Enable strict validation |
--warnings | Treat warnings as errors |
# Validate a document ceradoc validate document.adoc # Validate with strict mode ceradoc validate important.adoc --strict # Validate with custom schema ceradoc validate custom.xml --schema schemas/custom.yml
0 | Valid |
1 | Invalid (errors found) |
2 | Schema error |
version
Show version information.
ceradoc version [OPTIONS]
--short | Show version number only |
--all | Show all component versions |
# Full version info ceradoc version # => ceradoc 1.0.0 # => ceradoc-adoc 1.0.0 # => ceradoc-html 1.0.0 # => ceradoc-markdown 1.0.0 # Short version ceradoc version --short # => 1.0.0
Configuration File
Create .ceradoc.yml in your project directory:
# Default format settings
defaults:
input_format: asciidoc
output_format: html
# HTML output settings
html:
theme: modern
embed_css: true
syntax_highlight: true
# Validation settings
validation:
strict: true
warnings_as_errors: false
# Include path resolution
includes:
base_dir: .
allow_url_includes: falseEnvironment Variables
CERADOC_CONFIG | Path to configuration file |
CERADOC_THEME | Default HTML theme |
CERADOC_VERBOSE | Enable verbose mode (1 or 0) |
CERADOC_FORMAT | Default output format |
export CERADOC_THEME=modern
export CERADOC_VERBOSE=1
ceradoc convert document.adoc -o output.htmlCI/CD Integration
GitHub Actions
name: Convert Docs
on: [push]
jobs:
convert:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- run: gem install ceradoc
- run: |
for f in docs/*.adoc; do
ceradoc convert "$f" -o "build/${f%.adoc}.html"
done
- uses: actions/upload-artifact@v4
with:
name: html-docs
path: build/Troubleshooting
Common Errors
Error: File not found: document.adoc
Check file path and current directory.
Error: Unsupported format: .xyz
Use ceradoc formats to see supported formats.
Parse error at line 42, column 15:
|=== invalid table
^Check syntax in the input file.
Validation error: Missing required attribute 'title'
Fix the document or use --no-validate to skip validation.