Skip to content

Documenting Complex Project #132

Closed
Closed

Description

@Queuecumber

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?

Activity

  1. tmcw commented on Jul 29, 2015

    @tmcw
    Member

    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.

  2. elwayman02 commented on Nov 3, 2015

    @elwayman02

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

  3. tmcw commented on Nov 3, 2015

    @tmcw
    Member

    @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.

  4. elwayman02 commented on Nov 3, 2015

    @elwayman02

    @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)
    
  5. tmcw commented on Nov 3, 2015

    @tmcw
    Member

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

  6. elwayman02 commented on Nov 3, 2015

    @elwayman02

    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

  7. tmcw commented on Dec 9, 2016

    @tmcw
    Member

    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/**
  8. added 2 commits that reference this issue on Jul 27, 2017
    3ba5ffe
    7b982ea
  9. added a commit that references this issue on Jul 27, 2017
    5b373ff
  10. added a commit that references this issue on Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions