Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSDoc UML Diagram

Tags:

uml

jsdoc

jsdoc3

Question: I'm editing and using an open source javascript library that has JSDoc tags in its code. I was wondering if anyone knew of a JSDoc plugin that would allow me to generate a class diagram from the JSDoc tags.

Edit I decided to try out js/uml and found the following. The JS/UML eclipse extension requires an older version of Eclipse (Indigo) and a non-supported dependency library UML2tools. I found the dependencies needed and according to the Eclipse software manager installed correctly. When I tried to enable the uml functionality (having configured the js root), the process would hang. The examples that the group supplies points at single file Javascript. Seems to have trouble with multiple files being referenced.

like image 629
theCrux Avatar asked Dec 18 '13 17:12

theCrux


2 Answers

you can use doxygen tools , it provides metadata to generate uml class diagram

http://plantuml.sourceforge.net/doxygen.html

like image 128
Rotka Avatar answered Oct 01 '22 04:10

Rotka


Not sure what past versions of JSDoc were capable of but JSDoc now supports Javascript classes and the extends keyword. If code is marked up correctly JSDoc can understand class inheritance.

Could make a JSDoc plugin which subscribes to the processingComplete event: "The processingComplete event is fired after JSDoc updates the parse results to reflect inherited and borrowed symbols." http://usejsdoc.org/about-plugins.html

Then you can iterate over the Doclets (objects representing code elements) and serialize your own JSON out. Then you can write a simple HTML renderer for the JSON description of your original code.

like image 41
Geordie Avatar answered Oct 01 '22 06:10

Geordie