Antora Migration and Docs-as-Code Guide
1. Purpose
This guide defines how our writing team migrates legacy Word and RoboHelp documentation into AsciiDoc, structures multi-repository components in Antora, and reviews changes through Git.
2. Modular Repository Model
In Antora, each product or product variant lives in its own Git repository and maps to one Antora component with its own modules, pages, images, and partials.
Separating content by repository gives us:
-
Independent versioning per product line
-
Parallel authoring without merge conflicts across teams
-
Clear repository ownership for SMEs and writers
-
Consistent folder layout across every docs repo
2.1. Product Repository Split
We maintain one repository per product line:
-
hrw-sys-docs(Core HR & Payroll) -
hrw-ess-docs(Employee Self-Service Portal)
Every repository uses the same module layout:
hrw-sys-docs/
├─ antora.yml
└─ modules/
└─ ROOT/
├─ nav.adoc
├─ pages/
├─ assets/
│ └─ images/
└─ partials/
3. Migration Workflow
| Step | Task |
|---|---|
1 |
Export legacy DOCX or RoboHelp HTML and convert to Markdown with Pandoc. |
2 |
Clean Markdown headings, lists, tables, and stray line breaks. |
3 |
Convert cleaned Markdown to AsciiDoc using |
4 |
Place |
5 |
Wire pages into |
6 |
Raise a Merge Request for peer and SME review before merging to |
4. Required Tools
| Tool | Requirement |
|---|---|
Node.js |
20 or later |
Python |
3.x (with |
Ruby |
3.x (for |
Git |
Latest stable release |
Install the CLI dependencies globally (or inside your project):
npm install -g @antora/cli @antora/site-generator http-server
pip install panflute
gem install kramdown-asciidoc
5. Migrate a Word Document
5.1. 1. Convert DOCX to Markdown
Word exports often embed hardcoded pixel width and height attributes on every image, which breaks responsive CSS later. Strip them during conversion with a short panflute filter (remove_img_size.py):
import panflute as pf
def change_md_link(elem, doc):
if isinstance(elem, pf.Image):
elem.attributes.pop('width', None)
elem.attributes.pop('height', None)
return elem
if __name__ == "__main__":
pf.run_filter(change_md_link)
Run Pandoc with the filter:
pandoc --extract-media=./ input.docx -F remove_img_size.py -o output.md
6. Migrate RoboHelp HTML
-
Export the RoboHelp project as clean HTML topics.
-
Convert each HTML file to Markdown with Pandoc (
pandoc topic.html -t gfm -o topic.md). -
Run the same cleanup and
kramdocconversion steps above.
7. Build and Verify Locally
Before pushing a branch, run the local Antora playbook and check the rendered site in a browser:
npx antora antora-playbook.local.yml
npx http-server build/site -p 4173 -c-1
Open http://localhost:4173 and verify:
-
No broken
xref:links or missing images -
Clean table wrapping and code block formatting
-
Accurate left-hand sidebar entries in
nav.adoc
8. Git Branching and Review
Never commit directly to main. Create a feature branch for every change:
git checkout -b docs/update-topic-name
git add .
git commit -m "docs: add setup steps for payment terminal"
git push origin docs/update-topic-name
Open a Merge Request on GitLab and assign a developer or QA lead for technical review.