[Python-ideas] Add an UML class diagram to the collections.abc module documentation

Barry barry at barrys-emacs.org
Tue Jan 2 16:29:16 EST 2018


After reading this thread I went off and read up about plantuml.
According to its docs it produces dot files that it reandes with graphviz.
So if graphviz will produce svg that part is solved.

Can you creat the plantuml file automatically from the python code?

Barry

On 2 Jan 2018, at 15:26, Yahya Abou 'Imran via Python-ideas <python-ideas at python.org> wrote:

>> Can I suggest that rather than manually producing or tweaking, and later
>> updating, the diagrams it might be better to spend a little time
>> annotating the source code [...]
>> While the diagrams produced might lack the elegance of manually produced
>> ones they would be much more useful as they would always be up to date
>> due to being produced, and updated, automatically.
> 
> I think it would be a lot of changes in the source code...
> 
> I would like to precise, so everybody can know it, the syntax of a .puml is realy simple. For example:
> 
> test.puml:
> 
> @startuml
> 
> hide members
> show methods
> 
> abstract class Iterable {
>  {abstract} __iter__()
> }
> 
> abstract class Iterator {
>   {abstract} __next__()
>   ..
>   __iter__()
> }
> 
> Iterable <|-- Iterator
> 
> @enduml
> 
> Then:
> 
> $ plantuml test.puml
> 
> And you have test.png I joined.
> 
> 
> 
>> [...]
>> I am attaching the diagram produced for the full inheritance of
>> collections.abc as produced by doxygen/graphviz but I am sure that there
>> are some options that could make this more readable/useful.
>> 
>> Steve
> 
> It's a blank file that I have...
> 
> I've been struggling with those kind of tools these days, and realised that it's a lot more work (and pain) than a plain text file.
> <test.png>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/



More information about the Python-ideas mailing list