Problem
Confluence documents frequently use inline status badges — colored pill labels like ON TRACK, BEHIND, DONE — to summarize the state of an initiative inline with prose. The Confluence editor exposes these via the status structured macro with six colors (Grey, Red, Yellow, Green, Blue, Purple).
Today rw has no equivalent. Markdown authored for rw and then published to Confluence loses the ability to use status badges; Confluence pages imported into rw's viewer render them as nothing, or as raw text.
Proposed solution
Add a status inline directive that mirrors the Confluence status macro. It reuses the existing directive system (crates/rw-renderer/src/directive/) — no new grammar, no new processor — and wires through to both the HTML backend and the Confluence backend.
Syntax
Q2 plan: :status[On Track]{color=green} for billing, :status[Behind]{color=yellow}
for search, :status[Declined]{color=grey} for the audit log rewrite.
:status[Text] — the bracketed text is the badge label.
{color=NAME} — one of grey | red | yellow | green | blue | purple.
color is optional; defaults to grey.
- Unknown color values fall back to
grey (consistent with how unknown code block languages are handled today).
HTML output
<span class="status status-green">On Track</span>
CSS lives in packages/viewer/src/styles/content.css alongside .alert-*, with the same light/dark-mode pattern (Tailwind utilities under .prose .status-green and :where(.dark, .dark *) .prose .status-green). Bold white text on a saturated background, small border-radius pill.
Confluence output
Emit the native status macro in rw-confluence:
<ac:structured-macro ac:name="status" ac:schema-version="1">
<ac:parameter ac:name="colour">Green</ac:parameter>
<ac:parameter ac:name="title">On Track</ac:parameter>
</ac:structured-macro>
Color names capitalize to match Confluence's expected values.
Why an inline directive
The InlineDirective trait (crates/rw-renderer/src/directive/inline.rs) already handles :name[content]{attrs} — same shape as the existing tabs directive but inline. Preprocessing runs before pulldown-cmark, so the emitted <span> flows through the rest of the pipeline unchanged (including the Confluence backend, which sees the raw HTML tag and can translate it to the macro).
Implementation sketch
- New crate module:
crates/rw-renderer/src/status/ with:
directive.rs — StatusDirective implementing InlineDirective
- tests alongside (mirror
tabs/directive.rs structure)
- Register: add
.with_inline(StatusDirective::new()) where the DirectiveProcessor is constructed in renderer.rs
- Confluence backend (
crates/rw-confluence/src/backend.rs): detect <span class="status ..."> during HTML→XHTML translation and emit the status macro. Alerts already use a similar pattern (backend.rs:52–68).
- Viewer CSS (
packages/viewer/src/styles/content.css): add .prose .status base + six color variants, with dark-mode pairs. Follow the alert pattern at content.css:60–124.
- Docs: short section in
docs/ describing the syntax and color list.
- Changelog entry under
### Added.
Out of scope
- Other Confluence inline macros (jira, date, user mention) — separate proposals.
- Custom color palettes beyond the six Confluence-native colors.
- Block-level status (the image example is inline-only; Confluence's macro is inline too).
- Subtle/inverted variant (Confluence's
ac:subtle parameter).
Acceptance
:status[Text]{color=green} renders a green pill in the viewer (light + dark)
rw confluence update publishes the macro
color omitted → grey pill
- Unknown color → grey pill, no error
- End-to-end tests mirroring
tabs/directive.rs tests
Problem
Confluence documents frequently use inline status badges — colored pill labels like
ON TRACK,BEHIND,DONE— to summarize the state of an initiative inline with prose. The Confluence editor exposes these via thestatusstructured macro with six colors (Grey, Red, Yellow, Green, Blue, Purple).Today rw has no equivalent. Markdown authored for rw and then published to Confluence loses the ability to use status badges; Confluence pages imported into rw's viewer render them as nothing, or as raw text.
Proposed solution
Add a
statusinline directive that mirrors the Confluence status macro. It reuses the existing directive system (crates/rw-renderer/src/directive/) — no new grammar, no new processor — and wires through to both the HTML backend and the Confluence backend.Syntax
:status[Text]— the bracketed text is the badge label.{color=NAME}— one ofgrey|red|yellow|green|blue|purple.coloris optional; defaults togrey.grey(consistent with how unknown code block languages are handled today).HTML output
CSS lives in
packages/viewer/src/styles/content.cssalongside.alert-*, with the same light/dark-mode pattern (Tailwind utilities under.prose .status-greenand:where(.dark, .dark *) .prose .status-green). Bold white text on a saturated background, small border-radius pill.Confluence output
Emit the native status macro in
rw-confluence:Color names capitalize to match Confluence's expected values.
Why an inline directive
The
InlineDirectivetrait (crates/rw-renderer/src/directive/inline.rs) already handles:name[content]{attrs}— same shape as the existing tabs directive but inline. Preprocessing runs before pulldown-cmark, so the emitted<span>flows through the rest of the pipeline unchanged (including the Confluence backend, which sees the raw HTML tag and can translate it to the macro).Implementation sketch
crates/rw-renderer/src/status/with:directive.rs—StatusDirectiveimplementingInlineDirectivetabs/directive.rsstructure).with_inline(StatusDirective::new())where theDirectiveProcessoris constructed inrenderer.rscrates/rw-confluence/src/backend.rs): detect<span class="status ...">during HTML→XHTML translation and emit thestatusmacro. Alerts already use a similar pattern (backend.rs:52–68).packages/viewer/src/styles/content.css): add.prose .statusbase + six color variants, with dark-mode pairs. Follow the alert pattern atcontent.css:60–124.docs/describing the syntax and color list.### Added.Out of scope
ac:subtleparameter).Acceptance
:status[Text]{color=green}renders a green pill in the viewer (light + dark)rw confluence updatepublishes the macrocoloromitted → grey pilltabs/directive.rstests