-
Notifications
You must be signed in to change notification settings - Fork 571
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
Windows (win7) - run docco on all .js files #200
Comments
Creating a But now that I think about it, the documentation files from Interesting idea. I've opened another issue #201 so this issue can focus on your problem. |
I can confirm +1 that this is an issue exactly as stated on Windows 7 x64. Note: I wrote a Handlebar template compilation library called rex-template, and I dealt with this exact same issue. I could be wrong, but I would venture a guess that docco isn't handling Windows directory separators properly. I'm going to look into this and see if I'm on the right track. If so, it's an easy fix. |
I have this problem on windows 8 x64 as well. |
The problem is that * are not a common pattern on Windows. |
Is this going anywhere? I basically can't use Docco because of this. |
If someone sends a patch to fix it, then yes, it will ;) Personally, I don't use Windows, so I can't really help test out a fix for you. |
@jashkenas I have been looking over the source for maybe a half hour now and I'm not entirely sure where Docco actually finds the files based on the file input parameters. I really like @ocombe's recommendation to use isaacs/node-glob for filename parsing, and I would be happy to implement that patch. I just can't seem to find at what point node-glob would actually need to be inserted to parse those file names. Can you point me in the right direction? The closest I have come to a solid lead is this line: https://github.com/jashkenas/docco/blob/master/docco.js#L169 I know it's compiled from |
Docco doesn't. Glob expansion is a unix thing (a bash thing), not an in-javascript thing. The files are already listed out explicitly by the time Docco sees them. |
Ah, I see! Perhaps that is why I was having such a hard time finding the line in which that took place :-P I was seriously starting to question myself, especially when communicating with a legit, real-world javascript guru. What would you think about this: During the docco "boot" process, The problems I see with this idea:
The benefits I see with this idea:
I would be willing to write and submit the patch, but I'd really appreciate your feedback before I even got started. |
Feel free to give it a try, and try to make it nice — if it's clean enough, and doesn't force non-windows users to download node-glob (which they won't need), then we can merge it. If it's too hairy, then it's too hairy. |
I completely understand. This will be the first time I've ever dealt with package.json {
"scripts": {
"preinstall": "node detect-windows.js"
}
} detect-windows.coffee (compiles to fs = require 'fs'
path = require 'path'
if process.platform is 'win32'
package_path = path.join __dirname, 'package.json'
package = require current_package_path
package.dependencies['node-glob'] = '3.x'
unless fs.writeFileSync package_path, package then console.error "Unable to install suggested Windows dependency" Again, I've never done platform-specific package installation before and there could very easily be a better, more official way to do this, but I think the above solution is a decent, non-hairy way to avoid unnecessary packages for non-windows users. On a slight side note: I've never heard that phrase before, and I love it. It's so damn descriptive and I wish more people would understand that and take it to heart. "If it's too hairy, it's too hairy." |
@rex the package name is "glob" not "node-glob". However even with glob installed, I cannot get docco to work on Win8 x64. Still getting the same error the OP described. |
workaround for the time being:
This will create the docco documentation for all .js files in the current folder and subdirs. |
@jdoose That is totally badass. Well done, sir! |
:D Thanks! |
Until we have any resolution for this. For the time being you can use grunt-docco to use any globbing pattern you need in on any OS. https://github.com/DavidSouther/grunt-docco @jashkenas I understand your reservations regarding unwieldy hairy solutions, but really well thought of and successful tools like grunt precisely add a layer such as Besides, one of the conventions (albeit not entirely well thought of) in the |
The batch file worked for me once ..but now when i am running the same batch file it does not produce the docs folder.. Any help plz |
@sourav2029 Please uncomment the first line "@echo off", run the batch file from a command shell and post the result here. |
@jdoose "The syntax of the command is incorrect." |
;) Could you post some more lines? It is quite hard to find which command is incorrect if the call is missing :D |
@jdoose Okay so after trying so many things when i removed the node modules folder from my project it finally worked ...probably too long filename was causing the error..can you explain it what does this too long filename error mean and why does it occur ..I really appreciate your time and effort ..Thank you |
@jdoose this is the result when i run the batch file from the terminal C:\Users\Prem\Desktop\yoga_app>set LIST=".\app.js" ".\config\asana_function.js" C:\Users\Prem\Desktop\yoga_app>docco ".\app.js" ".\config\asana_function.js" ". |
@jdoose when i removed the node modules from the project ,the output was C:\Users\Prem\Desktop\yoga_app>set LIST=".\app.js" ".\config\asana_function.js C:\Users\Prem\Desktop\yoga_app>docco ".\app.js" ".\config\asana_function.js" " |
Ah, okay, I see. Well, that batch file just enumerates all js-files in the directory, including sub-directories and instructs docco to work on them. The long folder structure is the way how npm 2 works on windows. |
docco does not support executing commands on *.js (wildcard) files in Windows jashkenas/docco#200
Hi,
I can't seem to get docco to run all all .js files in a folder, I'm running
but it seems to work with
Also - I'm not sure if it functions in this way, but it would be great if it generates an index.html file with links to each of the .html files it generates.
The text was updated successfully, but these errors were encountered: