-
Notifications
You must be signed in to change notification settings - Fork 31
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
DocString templates #22
Comments
Any idea how you'd like these templates to look? How would they be applied to individual "untemplated" docstrings, i.e. how would you mark which part of each docstring gets inserted into each template "slot"? |
Right now, one gets to specify a template for the docstring of each function (and some details get filled into the template). I was instead thinking of a global template that would apply to all functions in a module, so that
This is a rough sketch of the structure I had in mind: @GlobalTemplate FunctionDocstring
"""
$(SIGNATURES(:with_types))
$(DESCRIPTION)
$(URL)
""" where I hadn't imagined the possibility of some functions/docstrings overriding this template. Maybe one can arrange for that with a suitable flag. |
Thanks for clarifying that,
Would you want to be able to define different templates for different categories such as method, type, macro, const, etc? I'd imagine that would probably be useful. |
I'm not able to think of a compelling need right now; might just be a lack
Fair enough. That was only an illustration; the user could remix whatever
Yes, that's what I had in mind. Maybe all those templates could be |
We could also probably provide a couple of default templates that package authors can just use out-of-the-box. |
Fixes JuliaDocs#22. Implements a `at-template` macro used to define 'template' docstrings that can be applied to different categories of docstrings on a per-module basis.
Fixes JuliaDocs#22. Implements a `at-template` macro used to define 'template' docstrings that can be applied to different categories of docstrings on a per-module basis.
Fixes JuliaDocs#22. Implements a `at-template` macro used to define 'template' docstrings that can be applied to different categories of docstrings on a per-module basis.
Fixes JuliaDocs#22. Implements a `at-template` macro used to define 'template' docstrings that can be applied to different categories of docstrings on a per-module basis.
Fixes JuliaDocs#22. Implements a `at-template` macro used to define 'template' docstrings that can be applied to different categories of docstrings on a per-module basis.
It would be very convenient to have a docstring "template" which can be made to apply to all functions in a module. Eg: one could define at the start of a module that each docstring will present function names with type signatures, default argument values and a url to the function definition.
Also part of the template could be a slot (abbreviation?) where locally defined docstrings would be filled in. Eg: When one describes some detail specific to a function, that description could get filled in between the type signature and the url, if the programmer so chooses.
The text was updated successfully, but these errors were encountered: