markdown-blockdiag icon indicating copy to clipboard operation
markdown-blockdiag copied to clipboard

Add edge_label_box configuration to optionally remove edge label boxes

Open Copilot opened this issue 4 months ago • 0 comments

Adds configuration to render edge labels without bounding boxes for cleaner diagrams.

Changes

  • New configuration: edge_label_box (default: True) in BlockdiagExtension
  • Drawing logic: Monkey-patches blockdiag's edge_label method to omit outline parameter when disabled
  • Compatibility fix: Made md_globals optional in extendMarkdown for newer Markdown versions
  • Documentation: Added configuration options section to README with usage examples
  • Tests: Added test_edge_label_box_config to verify configuration behavior

Usage

# Python API
diagram = draw_blockdiag(content, edge_label_box=False)

# Markdown extension
markdown.markdown(text, extensions=['markdown_blockdiag'],
    extension_configs={'markdown_blockdiag': {'edge_label_box': False}})
# MkDocs
markdown_extensions:
  - markdown_blockdiag:
      edge_label_box: False

Implementation Notes

Only blockdiag uses outline parameter for edge label boxes. Seqdiag renders edge labels without boxes by default, so no patching needed. The monkey-patch approach avoids modifying upstream blockdiag library while providing clean API surface.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support Removal of Edge Label Box</issue_title> <issue_description>Optionally rendering Edge Labels without a bounding box could produce cleaner diagrams.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes gisce/markdown-blockdiag#13

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Nov 06 '25 06:11 Copilot