1

I'm using jsdoc3 for my project and everything compiles nicely.

But this I've been fiddling with for the last 2 days and I give up :(

When using the most basic call from MacOsX Terminal to run jsdoc I ALWAYS get the full path of my source file within the generated documentation.

Example:

./jsdoc ../projectname/js/jsfile.js

In the generated index file I can see a h1 with "index" and below it a h2 with the full path to the js file:

/Users/username/projects/path/projectname/js/jsfile.js

I don't like that it shows my complete local path...
After reading up I thought it would be relative to where I run jsdoc from.
But all this has the same exact result:

cd /Users/username/projects/path/projectname
../jsdoc-master/jsdoc js/jsfile.js

as well as

cd /Users/username/projects/path/projectname/js
../../jsdoc-master/jsdoc jsfile.js

The problem is, that this path is also used with the line number references and on the sourcecode page. And it's really not nice that my internal path is displayed...

The output I would want is projectname/js/jsfile.js or at least just jsfile.js, but I can not for the life of me get this to work.

I hope someone can tell me what I'm doing wrong.

regards,
Jan

Jan Paepke
  • 1,997
  • 15
  • 25
  • What specific version of jsdoc 3 are you using? – Louis Feb 27 '14 at 23:27
  • You might want to try again with 3.2.2. 3.3.0-dev is alpha software. If you still get the problem with 3.2.2 I would suggest posting in your question a fragment of code that reproduces the problem. – Louis Feb 28 '14 at 00:41
  • Hi Louis, this really did the trick! The path was correctly generated. The Problem now is though, that 3.2.2 does not seem to be able to parse ordered lists. :-/ I might end up using 3.3. and then manually correcting the generated files... – Jan Paepke Feb 28 '14 at 11:16
  • Glad to have been of help. I'm not sure what you mean by "ordered lists". Is it a new `@` directive that was added in 3.3.0? – Louis Feb 28 '14 at 11:26
  • Ordered Lists is
    and unordered is
      ... I use unordered lists in my readme, which I include in my docs. So in compliance with markdown syntax I use * xzy Also tried + and -, no luck. 3.2.2 just doesnt parse it properly - 3.3.0 does.
    – Jan Paepke Feb 28 '14 at 12:06

1 Answers1

0

@Louis helped me figure out it was a problem with the alpha version.
3.2.2 did not export the full path to the docs.

Unfortunately it had other problems, like the lacking of support for unordered lists.
So I decided to stick with 3.3.0 and make a shell script correcting the wrong output of jsdoc afterwards.
Contents of the shell file:

./jsdoc-master/jsdoc ./projectname/js/jsfile.js
ABSPATH=$(cd "$(dirname "$0")"; pwd)
perl -pi -e "s?$ABSPATH/projectname/js/??g" ./out/*.html

So this basically deletes the full path from the generated html files.
It's a bit dirty, but it works...

regards,
Jan

Louis
  • 146,715
  • 28
  • 274
  • 320
Jan Paepke
  • 1,997
  • 15
  • 25
  • 1
    Hi Guys. I was talking to the developer of jsdoc and it turns out this was indeed a bug in the alpha. It is now resolved and works as expected. – Jan Paepke Mar 08 '14 at 16:08