modelmat / sphinxcontrib-drawio

Sphinx extension for including draw.io files.
MIT License
39 stars 17 forks source link

add support for "--layers" #97

Closed stan23 closed 1 month ago

stan23 commented 11 months ago

Is your feature request related to a problem? Please describe. I would like to export certain layers to an SVG. draw.io supports layers, and draw.io CLI allows to specify the layers that shall be exported.

Describe the solution you'd like sphinxcontrib-drawio should allow to specify the layers that shall be exported, and pass this to draw.io CLI. It should be similar to --page-index but as a comma separated list. If the parameter is not specified then it shall not be passed to draw.io in order to export all visible layers (default behavior).

Describe alternatives you've considered At the moment I export the SVG manually from draw.io, with the desired layers manually made visible. It does not work well if multiple exports with different layers of the same file are needed.

Additional context Layer selection in CLI has been added in draw.io v20.6.0.

draw.io counts the layers from 0 where layer 0 is the one at the bottom of the list, usually the Background layer.

draw.io CLI:

-l, --layers <comma separated layer indexes>
selects which layers to export (applies to all pages), if not specified, all layers are selected
MaGeisUMT commented 10 months ago

Hi @modelmat, do I need to add a testcase for this? The parameters are just passed to draw.io without touching them.

MaGeisUMT commented 5 months ago

For those who are wondering: @stan23 is my private account @MaGeisUMT is my "business" account

I decided to contribute to this repo with my newly crated business account.