Coder Social home page Coder Social logo

Comments (4)

mrjoelkemp avatar mrjoelkemp commented on August 22, 2024

Hi @blowsie, I don't quite follow your request. Do you have a specific use-case that clarifies your feature request? Some sample code would also help. Thanks!

from jsdox.

blowsie avatar blowsie commented on August 22, 2024

generateForDir() only builds jsdox for the current directory right?

I had to write some code to recursively build the documentation, something like this

console.log("=========== DOCUMENT BUILD STARTED ===========");


jsdox = require("jsdox");
file = require("file");
fs = require("fs");
docsPath = "docs/code/";



deleteFolderRecursive = function(path) {
    var files = [];
    if (fs.existsSync(path)) {
        files = fs.readdirSync(path);
        files.forEach(function(file, index) {
            var curPath = path + "/" + file;
            if (fs.lstatSync(curPath).isDirectory()) { // recurse
                deleteFolderRecursive(curPath);
            } else { // delete file
                fs.unlinkSync(curPath);
            }
        });
        fs.rmdirSync(path);
    }
};

// Remove the directory to clean it up
deleteFolderRecursive(docsPath);

file.walk("app", function(a, dirPath, dirs, files) {


    // Adapt the path
    dirPath = dirPath.replace(/\\/g, "/");

    // Make the directories
    file.mkdirsSync(docsPath + dirPath);

    // Make the docs
    jsdox.generateForDir(dirPath + "/", docsPath + dirPath, done);

});

function done() {
    console.log('=========== DOCUMENT COMPLETE ===========', arguments);
}

I would be great if we could bake something like this into the library to save people having to write code similar to mine.

from jsdox.

mrjoelkemp avatar mrjoelkemp commented on August 22, 2024

Interesting. I'd been using the glob format in the grunt-jsdox task to process a list of files within a directory. Hadn't used jsdox as a library.

I personally prefer using node-dir to avoid hand-rolling a recursive directory walker.

Maybe @stouf would be interested in tackling this at some point?

from jsdox.

blowsie avatar blowsie commented on August 22, 2024

I just read the jsdox documentation and got it working.

Perhaps I too should have used the grunt-jsdox.
After all the description does do what I need it to do.


grunt-jsdox

Recursively generates markdown files for your project, using the jsDox parser. Optionally generates a table of contents, and supports git


Someone else may have a use for this, but I guess its a bit niche, as grunt will do the job in most scenarios.

Closing for now.

from jsdox.

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.