Comments (4)
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.
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.
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.
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)
- Broken tags view
- Config flag confusing
- Replace -rr with just -r? HOT 7
- Should we deprecate the use of a config file? HOT 3
- Use cases for jsdox? HOT 6
- Support of @example HOT 4
- Generate table of contents HOT 3
- Fails on --rr with empty grandparent folder. HOT 1
- How to get parameters of Class Constructor HOT 2
- Enable Sourcegraph HOT 1
- Param descriptions show function description of no param description was defined
- @copyright, @license, etc. do not show unless @overview is defined
- How to document object params with particular properties HOT 1
- Can you suppress the Global title at the top of the page? HOT 3
- Jsdox doesn't handle optional parameters HOT 4
- Error: Unexpected end of input HOT 4
- ECMA6 Support HOT 1
- Generated paths do not work when generated content is pushed to Git.
- Recursive command doesn't ignore non-JS files
- NPM Mustache vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsdox.