GithubHelp home page GithubHelp logo

Output to JSON? about grunt-jsdoc HOT 6 CLOSED

krampstudio avatar krampstudio commented on May 28, 2024
Output to JSON?

from grunt-jsdoc.

Comments (6)

krampstudio avatar krampstudio commented on May 28, 2024

I'm agree with you it could be a nice feature!

from grunt-jsdoc.

rvangundy avatar rvangundy commented on May 28, 2024

Another nice feature would be to keep track of inline comments. I can see this making it possible to document a lot more interesting things within code, and convert them in to an easy-to-read format. It also would help computers make inferences between computational procedures and verbal communication. Could be neat.

Are you spending much time on this project these days? I've been thinking for a while about a code documentation JSON Schema based on the jsdoc3 spec. I'd be willing to pitch in a few drafts.

from grunt-jsdoc.

krampstudio avatar krampstudio commented on May 28, 2024

Definitely agree.
I had also in mind to rewrite the jsdoc parser using node instead of rhino (and the complex legacy system that comes with jsdoc3), to be able to integrate some features like docco's code and comments layout and so on.

from grunt-jsdoc.

Risto-Stevcev avatar Risto-Stevcev commented on May 28, 2024

You can get the JSdoc JSON object by running jsdoc with the --explain flag.

from grunt-jsdoc.

mboles avatar mboles commented on May 28, 2024

I am trying to get the JSON file. I use the --explain flag and get the correct result without Grunt. Using Grunt and your plugin I get the standard JSDoc output, but as I said need the JSON file. I found in the cli.js file (line 388) this code where --explain is handled:

cli.processParseResults = function() {
    if (env.opts.explain) {
        cli.dumpParseResults();
    }
    else {
        cli.resolveTutorials();
        cli.generateDocs();
    }
    return cli;
};
cli.dumpParseResults = function() {
    global.dump(props.docs);
    return cli;
};

From that I thought I could just write the file like this using fs.writeFile:

cli.dumpParseResults = function() {
    var fs = require('fs');
    global.dump(props.docs);
    fs.writeFile('videojs-src/cumulative.json', props.docs);
    return cli;
};

The file was created, but it as empty. I tried to just write some simple text to the file fs.writeFile('videojs-src/cumulative.json', 'hello');, and that wouldn't write out either.

Any ideas? It seems something is interfering with the write.
Thanks-
Matt

from grunt-jsdoc.

krampstudio avatar krampstudio commented on May 28, 2024

Old issue, please reopen if needed (the plugin relies now of the node implementation)

from grunt-jsdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.