Skip to content

refactor: consolidate markdown/ADF conversion #23

@rianjs

Description

@rianjs

Summary

Consolidate markdown-to-ADF (Atlassian Document Format) conversion logic to eliminate duplication between tools.

Current State

Both tools have markdown-to-ADF conversion:

cfl (tools/cfl/pkg/md/):

  • Full bidirectional conversion (markdown ↔ ADF)
  • Macro support for Confluence-specific features
  • Well-structured with separate files for each direction

jtk (tools/jtk/api/markdown.go):

  • Markdown to ADF only (372 lines)
  • Duplicates significant goldmark parsing logic
  • Simpler implementation without macro support

Proposed Changes

  1. Evaluate if jtk needs the full cfl implementation or a subset
  2. Move shared ADF conversion logic to shared/adf/ package
  3. cfl's more complete implementation should be the basis
  4. jtk imports shared package, removing its local markdown.go

Considerations

  • Jira descriptions don't need Confluence macros
  • May want to keep cfl's macro handling separate
  • Core ADF node types are shared between products

Impact

~300+ lines could be consolidated

Complexity

This is a larger refactoring effort - recommend tackling after simpler consolidations are complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions