-
2 Apr 2012 4:28 PM #1
Is It Possible To Use JSDuck On Java Code?
Is It Possible To Use JSDuck On Java Code?
Is it possible to use JSDuck on Java code (not javascript)?
I am looking at different documentation tools and would like to have the same format for the Java side as for the javascript side.
-
3 Apr 2012 6:47 AM #2
One of my colleagues has run JSDuck on Java, Ruby and other languages besides JavaScript. I'll see if I can get him to comment...
-
11 Apr 2012 1:44 AM #3
Can I ask why?
Why would you want to use JSDuck to generate docs on Java code? JSDuck is based on Javadoc which was written specifically to generate docs from java code following sun standards.
It comes with eclipse.
-
11 Apr 2012 6:47 AM #4
You might want the output to look extra nice :-)
You might also want all of your application documentation in a centralized place... JavaScript (client), Java (server), and any other tier.
-
12 Apr 2012 6:16 AM #5
Yes, I've used it to document Java, PHP, and Ruby. It's a little trickier with Ruby since you have to wrap your doc comments in =begin, =end ruby comment blocks. PHP also has issue with single line comments that start with '#'. But as for Java, it was the most straight forward.
So, the trick to get JSDuck to document your classes and methods is that you have to add the @class and @method tags in your doc comments. JSDuck is geared toward JavaScript and specifically code written using the ExtJS styles and therefore it will do a lot of the work for you in figuring out what the class and method names are. For non-JavaScript code, you just have to manually add your @tags (@class, @extend, @method, etc.).Jack Ratcliff
Sencha Inc, Green bleeding Senchan
How to report a bug:
http://www.sencha.com/forum/showthre...o-report-a-bug
-
23 Apr 2012 2:49 PM #6
What a great idea
What a great idea
Honestly, what a great idea. I love the output and application that jsduck creates next to the framed, difficult-to-navigate javadocs. If I want to keep a few classes open for reference in Java, I usually end up opening a browser tab for each one (then forgetting which one is which if I have too many and lose the window titles). Not to mention the search feature, ability to show/hide public/protected/private, show/hide inherited fields/methods, etc.
Might just want to add a custom @throws tag to fill in for that need
-
23 Apr 2012 4:49 PM #7
Thanks for the info.
Would you mind pasting a sample command of running it as I haven't used JSDuck before.
Is the only way to integrate it with ant ANT script to use the Exec task?
-
1 May 2012 1:41 PM #8
Here's an example shell script that I use:
However, I seem to recall that on windows, this won't work as a bat file since the line continuation character is different.Code:jsduck \ ./src/com/sencha/test/*.java \ ./src/com/sencha/test/servlet/*.java \ ./src/com/sencha/test/util/*.java \ ./src/com/sencha/jetty/*.java \ --output docs \ --title="Test Title" \ --warnings=-all \ --welcome=./doc_src/welcome.html \
So a more cross-platform way to do this would be to use a config file. Your command would then be:
And your config would be in json format and would look something like this:Code:jsduck --config yourconfigfile.config
Code:{ "--title" : "Test Title", "--warnings" : "-all", "--welcome" : "./doc_src/welcome.html", "--output" : "docs:, "--" : [ "./src/com/sencha/test/*.java", "./src/com/sencha/test/servlet/*.java". "./src/com/sencha/test/util/*.java", "./src/com/sencha/jetty/*.java" ] }Jack Ratcliff
Sencha Inc, Green bleeding Senchan
How to report a bug:
http://www.sencha.com/forum/showthre...o-report-a-bug
-
17 Oct 2012 11:19 PM #9
Windows
Windows
Has anyone tried it on windows. I get an error when i try to include javafiles for the documentation
Code:c:\ jsduck {*.js,*.java} -o docs Error: Error while parsing c:\test.java: Line 1: Unexpected reserved word
-
Today 9:05 AM #10
To save people from drawing the wrong conclusions from this thread:
Since JSDuck 4.0 feeding it non-JavaScript code won't work any more. This is because JSDuck now contains a proper JavaScript parser which will choke when you try to feed it with anything else than JavaScript.


Reply With Quote


