Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add blockdiag support #8

Closed
moigagoo opened this issue Jul 14, 2017 · 5 comments
Closed

Feature request: Add blockdiag support #8

moigagoo opened this issue Jul 14, 2017 · 5 comments

Comments

@moigagoo
Copy link

Hi! This is merely an idea, feel free to close and delete this issue if you think it doesn't make sense.

Currently, Needs uses PlantUML to draw diagrams. PlantUML requires Java, which makes it hard to use on remote machines you don't have control over (i.e. readthedocs).

However, there's a pure-Python alternative to PlantUML, natively supported in Sphinx (and even created by one of its core maintainers)—blockdiag.

Don't you think it would be a good idea to have blockdiag available as a backend for diagrams in Needs?

@danwos
Copy link
Member

danwos commented Jul 14, 2017 via email

@moigagoo
Copy link
Author

I'd love to contribute on that one. Unfortunately, I have very limited experience with Sphinx extension development and the developer docs for it are quite messy (oh the irony).

As far as I understand, here's what has to be done:

  1. Add config value needs_diagram_engine that can be 'plantuml' or 'blockdiag'.
  2. Add an if check for this value here: https://github.com/useblocks/sphinxcontrib-needs/blob/master/sphinxcontrib/needfilter.py#L108
  3. Construct the blockdiag block similar to this https://github.com/useblocks/sphinxcontrib-needs/blob/master/sphinxcontrib/needfilter.py#L123. However, I don't understand why you're building an empty block (startuml followed by enduml).
  4. Construct the actual blockdiag block similar to this https://github.com/useblocks/sphinxcontrib-needs/blob/master/sphinxcontrib/needfilter.py#L249
  5. If show_legend is set, add description to the blockdiag block.

@danwos
Copy link
Member

danwos commented Jul 15, 2017

Your contribution is highly welcome and your description of the needed points is correct.

For 3: After a fast review I'm also not sure, if this empty block is really needed during node declaration.

However, your change would make the related function even more complex, as some more if statements get included. But that's OK for the moment. For one of the next version, we should do some refactoring and split this little monster of a function to higher the maintainability.

Please do not forget to describe the new possibilities inside our sphinx-docs and a test case is also highly appreciated :-)

@ubmarco ubmarco changed the title Feature request: Add blockfiag support Feature request: Add blockdiag support Jul 18, 2017
@twodrops
Copy link
Collaborator

twodrops commented May 1, 2021

A related idea #162

@danwos
Copy link
Member

danwos commented May 7, 2021

I close this, as it would provide already existing features with another technical solution only.
So the benefit is quite small and the costs are too high.

@danwos danwos closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants