Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting Complex Project #132

Closed
Queuecumber opened this issue Jul 29, 2015 · 7 comments
Closed

Documenting Complex Project #132

Queuecumber opened this issue Jul 29, 2015 · 7 comments

Comments

@Queuecumber
Copy link

I have a complex project with several modules and many js files in a directory structure. With JSDoc I could point to the root of my source code and it would traverse the directory structure recursively and generate documentation for every file.

I have since added a large C++ portion to my project as a node addon so I wanted to document it as well and it seems that documentationjs supports that. However I can't get it to generate documentation in the same way. Is there a standard way to traverse a large project like this?

@tmcw
Copy link
Member

tmcw commented Jul 29, 2015

Right now there are two modes for documentationjs:

  • Polyglot mode, which takes lists of filenames as input and parses files agnostically
  • JavaScript mode, which takes files as input, crawls their dependencies, and parses them as JavaScript

to document cross-language repositories, we would need to separate the input step from the parsing step and have the parser decide on JavaScript vs C++ based on extension or some other cue.

@elwayman02
Copy link

@tmcw is it possible to simply provide a directory and have documentationjs parse all files in that directory?

@tmcw
Copy link
Member

tmcw commented Nov 3, 2015

@elwayman02 sure, you can do

documentation --polyglot directory/*

As previously discussed, though, this uses the polyglot parser that does not do any code inference - to infer JS and polyglot-parse other types, we might need some sort of filename sniffing.

@elwayman02
Copy link

@tmcw I get this error when I try that:

$ documentation -f html -o docs --polyglot addon/*
fs.js:552
  var r = binding.read(fd, buffer, offset, length, position);
                  ^
Error: EISDIR, illegal operation on a directory
    at Error (native)
    at Object.fs.readSync (fs.js:552:19)
    at Object.fs.readFileSync (fs.js:384:28)
    at /usr/local/lib/node_modules/documentation/lib/input/shallow.js:26:20
    at Array.map (native)
    at module.exports (/usr/local/lib/node_modules/documentation/lib/input/shallow.js:23:33)
    at module.exports (/usr/local/lib/node_modules/documentation/index.js:80:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/documentation/bin/documentation.js:19:1)
    at Module._compile (module.js:460:26)

@tmcw
Copy link
Member

tmcw commented Nov 3, 2015

There's probably a directory in that directory and documentation's trying to read it. We do not currently recurse down directories.

@elwayman02
Copy link

Ah, yea there definitely is. That's what I'm ultimately looking for; I'd like to take a complex project and input the parent directory, getting back generated documentation for all the files

@tmcw
Copy link
Member

tmcw commented Dec 9, 2016

Going to rename this module to reflect the idea that maybe normal mode and polyglot mode shouldn't be mutually exclusive. For the immediate issue - this illegal operation thing:

  • For now, use recursive globs: documentation --polyglot directory/**

tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
@tmcw tmcw closed this as completed in #851 Jul 27, 2017
tmcw added a commit that referenced this issue Jul 27, 2017
BREAKING CHANGE: I'd like to still support C++ and other languages in the future! But I'm much
happier doing so by separating the extraction & input phases to the degree that documentation.js can
read the output of another module that extracts JSDoc comments from C++ code, rather than having CPP
support in it.

Fixes #850. Fixes #731. Fixes #702. Fixes #132.
rhendric pushed a commit to rhendric/documentation that referenced this issue Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants