You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a preview subcommand that renders a page locally, approximating how it would look in Confluence, so authors can check layout and macros without publishing.
Today the only ways to see the result are to update/create and open the live page, or read the raw storage — neither shows a rendered approximation. --dry-run (#11) reports what actions would happen; preview would show what the page looks like.
What it would do
Convert the markdown to Confluence storage format (reuse convert.MdToConfluence, same pipeline as update/create).
Render that storage into a browser-viewable HTML approximation, interpreting the Confluence storage tags the converter emits, and either write it to a file or open it in a browser.
Storage tags to interpret
The converter already emits these (see internal/convert); preview needs to translate them into presentational HTML:
Layouts — ac:layout, ac:layout-section (single/two/three column, sidebars), ac:layout-cell. This is the motivating case: multi-column layouts are invisible in raw markdown and easy to get wrong.
Macros — ac:structured-macro for code blocks, <!-- confluence-toc --> TOC, GitHub-alert callouts/panels, expand, status, etc. (ac:parameter, ac:plain-text-body, ac:rich-text-body).
Images — ac:image + ri:attachment/ri:url (resolve ri:attachment against the local assets/ files so they render offline).
Links — internal doc links / anchors.
Unknown or unsupported tags should degrade gracefully (e.g. a labeled placeholder) rather than break the render.
Open questions / scope
Output: write an .html file, print to stdout, and/or open a browser? A --open flag?
Fidelity: how closely to mimic Confluence CSS — a lightweight stylesheet that captures layout columns, code blocks, and panels is probably enough to start; pixel-fidelity is a non-goal.
Source: preview a local markdown FILE (primary). Could also compose with read to preview a live page's storage (fetch → render) — worth considering but separable.
Macro coverage: start with layouts + code + callouts + images + TOC; expand as needed.
Summary
Add a
previewsubcommand that renders a page locally, approximating how it would look in Confluence, so authors can check layout and macros without publishing.Today the only ways to see the result are to
update/createand open the live page, orreadthe raw storage — neither shows a rendered approximation.--dry-run(#11) reports what actions would happen;previewwould show what the page looks like.What it would do
convert.MdToConfluence, same pipeline asupdate/create).Storage tags to interpret
The converter already emits these (see
internal/convert);previewneeds to translate them into presentational HTML:ac:layout,ac:layout-section(single/two/three column, sidebars),ac:layout-cell. This is the motivating case: multi-column layouts are invisible in raw markdown and easy to get wrong.ac:structured-macrofor code blocks,<!-- confluence-toc -->TOC, GitHub-alert callouts/panels, expand, status, etc. (ac:parameter,ac:plain-text-body,ac:rich-text-body).ac:image+ri:attachment/ri:url(resolveri:attachmentagainst the localassets/files so they render offline).Unknown or unsupported tags should degrade gracefully (e.g. a labeled placeholder) rather than break the render.
Open questions / scope
.htmlfile, print to stdout, and/or open a browser? A--openflag?readto preview a live page's storage (fetch → render) — worth considering but separable.Related
--dry-run) — complementary: dry-run previews actions, this previews appearance.readsubcommand — already fetches/round-trips storage; shares the storage-handling surface.