mozilla / sphinx-js

Autodoc-style extraction into Sphinx for your JS project
https://pypi.python.org/pypi/sphinx-js/
MIT License
282 stars 81 forks source link

Ability to document blocks of code #108

Closed carlosvega closed 5 years ago

carlosvega commented 5 years ago

It could be food if for example we want to document blocks such as:

/**
* ... 
*/
Vue.component({ ... 
 ... 
})
carlosvega commented 5 years ago

Anything?

erikrose commented 5 years ago

Could you be more specific as to what you mean?

carlosvega commented 5 years ago

For example, if there is a part of code in which I make a call to select2 or create a Vue component, I would love to add documentation to that part of the code. For instance, if you go to point 5 here, http://sethherr.github.io/soulheart/examples_select2/

documenting that select2 initialization could be very interesting. Same for Vue components. Thanks !

erikrose commented 5 years ago

I'm not aware of JSDoc supporting the extraction of generic comments from inside a function. Are you? Unfortunately, sphinx-js has only the output of JSDoc to work with.

carlosvega commented 5 years ago

I'm not aware. It's a pitty. Thanks though!

erikrose commented 5 years ago

One idea: you could name your function(data, page) { function and put a proper doclet above it; that would give you a handle to extract some documentation by.

carlosvega commented 5 years ago

And then I can call it, yes. Like a closure. Good idea. Thanks!

erikrose commented 5 years ago

No problem! :-D