2

Is there a way to generate html from jsdocs online or with a standalone tool? I have created an internal JS library and documented it with JSDoc specifications and would now like to generate documentation to share with my team. I can't, for reasons I won't get into, install the jsdoc npm package like I would at home.

So is there a way to generate the html documentation (or similar) without installing JSDoc?

jjspace
  • 178
  • 2
  • 11

3 Answers3

1

If you need JSDoc documentation, you need to install or copy over JSDoc package. As the package is JavaScript based, you need to have node.js installed on your computer prior, as JS runtime environment. If you have node.js installed on your work computer you may install the package

npm install -g jsdoc 

or just copy (from your home computer) "node_modules/.bin" and "node_modules/jsdoc" folders to anywhere on your work computer. After generate your documentation by using command line

.bin/jsdoc path/to/file.js

More information on the topic is over here: How do I use JSDoc on Windows?.

Note: I am not aware any online service to generate JS Documentation, but even if I would, I wouldn't advise you to use it. The script which you wrote is ypur (or your company) intellectual property and send it to any 3rd party service, even to generate documentation sounds weird. I would generate documentation at home and bring it to work in your case.

Community
  • 1
  • 1
Slava Ivanov
  • 6,666
  • 2
  • 23
  • 34
1

Maybe not a solution for an internal library, but if your code is hosted on GitHub, you can use https://doxdox.org/

https://doxdox.org/<username>/<repo>

Sphinxxx
  • 12,484
  • 4
  • 54
  • 84
  • is there an example? I see only package descriptions at https://doxdox.org/docsbydoxdox/doxdox.org/master – 4esn0k Jan 19 '20 at 05:44
  • 1
    @4esn0k - The repo needs to have source files with JSDoc comments in them, which that repo doesn't seem to have. Random example: https://doxdox.org/bradtraversy/jsdoc-examples – Sphinxxx Jan 19 '20 at 11:16
0

If you for some reason cannot install the JSDoc utility I would still just implement a minimal server that consumed javascript and output html and fire that up on a server that you control. Minimal work and you get exactly what you want without installing it on your computer.

You would then just do

curl -X POST private-server.com/jsdoc-service ---data @my-javascript.js

and get the html back. Alternatively, bundle the entire project as a zip and POST that, unzipping on the server, run the tool and return a zip back. Easy peezy.

oligofren
  • 20,744
  • 16
  • 93
  • 180