Comments (5)
For now coffeedoc only documents top-level functions and classes in a file, at least when the commonjs parser is used. The reasoning is that nested functions and classes do not generally form part of the API, and do not need to be documented in the same way. Of course if you nest everything in a top-level function it won't work.
This should be easy to fix though, just write a custom Parser
class that knows where to look in the coffeescript AST. Have a look at how the requirejs parser is written, it does something similar. Shout if you get stuck
from coffeedoc.
I'm with @Cybolic.
We too use namespacing for our api, and we're doing it like this (using underscore.js):
_.extend nsName, varOne: "a value" methodOne: -> ...
I understand that this can be manually done by extending the BaseParser ourselves, but that requires to get to know your code, and since it's reasonable to put your api into a namespace, maybe it's worth to add this as a feature as well?
from coffeedoc.
I appreciate that lots of people use namespacing as a way to write modular code, but it would be quite tricky to write a generic parser that could handle all namespacing techniques. Some people put everything in a top-level object, other people attach public properties to a named wrapper function using this
, @nitm uses underscore... the possibilities are endless. How does coffeedoc know where to look in the general case?
If someone can hack something together I'm happy to merge it in, but it seems like a lot of work, especially when you can just use commonjs/requirejs and have everything just work.
from coffeedoc.
I was actually looking at doing that before posting here, by simply copying the require class and replace all the "require" strings with "namespace", but that didn't work and I didn't have the time to look into it further.
I'm guessing the problem of where to look can be solved by having a --namespace argument that takes a parameter which is the name of the function to look for?
from coffeedoc.
I already forked the project, and will hopefully have enough time to make it work for what I need, then I'll try to tackle the generic issue.
Thanks for the great project.
from coffeedoc.
Related Issues (20)
- No --requirejs when installed via npm, version 0.1.11 HOT 2
- Sphinx integration HOT 2
- DocBlock before statements (functions) HOT 3
- Participate in DocSpec HOT 1
- I built coffeedoctest from coffeedoc HOT 2
- weird stuff happens with classes defined in index.coffee HOT 3
- Does not generate html files only index.html HOT 3
- Flag to ignore files or folders HOT 3
- HtmlRenderer() has no method 'renderIndex' HOT 1
- reserved word "private" HOT 4
- String literal in the beginning of the class declaration makes coffeedoc to fail HOT 3
- Hide non-public class methods from documentation HOT 1
- Class instance method not documented HOT 2
- Suggestion: headers beyond h2 HOT 1
- Ability to hide functions starting with _? HOT 2
- Class docstring is null when using tabs for indenting HOT 6
- Top-level documentation comment not parsed when preceded by another line HOT 2
- <Object> has no method 'existsSync' HOT 4
- Feature Request: Don't render AST nodes that aren't commented HOT 1
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 coffeedoc.