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 kramdoc.

4

Place .adoc topics in modules/ROOT/pages/ and screenshots in modules/ROOT/assets/images/.

5

Wire pages into modules/ROOT/nav.adoc and verify the build locally.

6

Raise a Merge Request for peer and SME review before merging to main.

4. Required Tools

Tool Requirement

Node.js

20 or later

Python

3.x (with panflute for Pandoc image cleanup)

Ruby

3.x (for kramdoc)

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

5.2. 2. Clean the Markdown

Before converting to AsciiDoc:

  • Fix broken heading hierarchy (never skip from to ##).

  • Replace nested Word tables or merged cells with plain tables or lists.

  • Remove trailing whitespace and manual hard line breaks.

5.3. 3. Convert Markdown to AsciiDoc

kramdoc output.md

5.4. 4. Place Files in Antora

Asset Type Target Folder

Screenshots and diagrams

modules/ROOT/assets/images/

Topic .adoc files

modules/ROOT/pages/

Reusable snippets

modules/ROOT/partials/

6. Migrate RoboHelp HTML

  1. Export the RoboHelp project as clean HTML topics.

  2. Convert each HTML file to Markdown with Pandoc (pandoc topic.html -t gfm -o topic.md).

  3. Run the same cleanup and kramdoc conversion 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.

9. Authoring Quick Reference

9.1. Headings

= Page Title
== Section Heading
=== Subsection Heading

9.2. Admonitions

[NOTE]
====
Keep notes short and action-oriented.
====

9.3. Reusable Partials

include::partial$common-note.adoc[]

9.4. Images Inside Numbered Steps

Use a list continuation (+) on its own line so the screenshot aligns under the step:

. Open *Settings > Hardware*.
+
image::hardware-settings.png[Hardware settings screen]