liran-funaro / sphinx-markdown-builder

A Sphinx extension to add markdown generation support.
https://pypi.org/project/sphinx-markdown-builder
MIT License
45 stars 20 forks source link

[FEATURE REQUEST] No support for plantuml diagrams #9

Open revati-naik opened 1 year ago

revati-naik commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

I have links to certain plantuml diagrams in my .rst file.

I use it in the `.rst file as

.. uml:: path_to_uml/file.puml

The extensions I use are:

  1. sphinx-makrdown-builder v0.6.6
  2. sphinxcontrib.plantuml v0.27
  3. sphinx-needs v1.2.2

It works fine with HTML builder and I see the diagrams generated just right. In the markdown, I see empty blocks. No reference of uml diagrams exist in the generate markdown file

If I add it as a need type

The directive added in the conf.py file is .. uml::.

directive="uml", title="UML", prefix="UML_", color="#BFD8D2", style="node"

This is what my markdown looks like

<a id="UML_5EDCF"></a>

| UML: **path\_to\_uml/file.puml** [UML_5EDCF](#UML_5EDCF)  ![image](/home/$USERinternal_python_vendor_sphinx_needs/site-packages/sphinx_needs/images/feather_svg/arrow-down-circle.svg)![image](//home/$USER/internal_python_vendor_sphinx_needs/site-packages/sphinx_needs/images/feather_svg/arrow-right-circle.svg) <br/><br/>   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <br/><br/><br/>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

However, I do want to add it as a need type.

To Reproduce Steps to reproduce the behavior:

  1. Clone git@github.com:sphinx-doc/sphinx.git
  2. Install packages 'sphinxcontrib-plantuml==0.27,sphinx-markdown-builder,sphinx-needs==1.2.2`
  3. Run sphinx-build -M markdown input_dir output_dir
  4. Add the above.rst file
  5. See error as the missing signature of uml dagram

Expected behavior A clear and concise description of what you expected to happen

Just like the HTML markdown supports uml images, the markdown builder should also render the images. Atleast to begin with I need to see the signature of the uml in the .md file. For example, in case f drawio images, I see the sphinxcontrib.drawio working to add the ![image](image.drawio) in the markdown file.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

liran-funaro commented 12 months ago

@revati-naik Thank you for the report. I'm sorry it took so much time to reply. I've been on vacation, followed by a war. I'll attend to this issue in the following weeks.

revati-naik commented 8 months ago

@liran-funaro Do we have any update on this?

liran-funaro commented 8 months ago

Hi @revati-naik. Please try to create a minimalistic example to reproduce this issue.

revati-naik commented 8 months ago

Hi @revati-naik. Please try to create a minimalistic example to reproduce this issue.

I just updated the first comment.

And to add more context, please find the diff patch for my test. I tried to add a .. uml:: directive in the image-target.rst file.

test_uml.PATCH

And I see the following warning:

markdown-builder/tests/source/image-target.rst:13: WARNING: unknown node type: <plantuml: >

Also, I do not feel my initial approach of adding plantuml as a directive was correct.

liran-funaro commented 6 months ago

I modified the title to be a feature request. I don't have plans to add more features at the time. But I will keep this issue open if I will have time for it in the future.