-
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
Examples of how to use all of the functionality #122
Comments
AFAIK Typically one does something like """
$(SIGNATURES)
# Arguments
- `startingAmount`: how much money you have now
- ...
"""
function calculate_retirement_monthly_savings(startingAmount::Number, ... which indeed duplicates argument names. |
Yes, @document_arguments begin
"""
$(ARGUMENTS)
"""
function func(
"docs for `arg`" ->
arg,
)
# ...
end
end which would pull out the |
Thanks for the clarification on FIELDS! I'll have to read the section on julia macros to understand your suggestion. Just so this doesn't get closed prematurely, the most important part of this issue is to get a page of examples if at all possible. 🙏 |
On this, I think it could be helpful to document/include an example on how to use Define your templates in your ...
#DocStringExtensions Templates
using DocStringExtensions
@template (FUNCTIONS, METHODS) = """
$(TYPEDSIGNATURES)
$(DOCSTRING)
$(METHODLIST)
"""
@template TYPES = """
$(TYPEDEF)
$(TYPEDFIELDS)
$(DOCSTRING)
"""
# file includes
include("somefile1.jl")
include("somefile2.jl")
... This could also address #117 |
I know I am late, but the above use of the @template DEFAULT =
"""
$(TYPEDSIGNATURES)
$(DOCSTRING)
""" and have some function in an included module """
Some docstring
"""
function some_func(x::Float64, y)
return nothing
end The function does not show typed signatures as suggested by setting the |
This seems like a great package! One thing that's really missing is an example of how to use each and every functionality. Ideally, this would be a single page with two columns. The left would be the function definitions and the right would be the rendered help text.
More specifically, I'm currently struggling to find out how to use the FIELDS variable effectively to document the arguments to a functoin without me having to duplicate the names of all of the variables (single source of truth!!!). Let's say I have this function:
It would be great if those comments could make it to an argument list, with the types, but without having to duplicate (and possibly cause inconsistencies) the variable names. Is that possible with the existing pacakge? I don't currently know because I can't find examples of how to use the FIELDS variable effectively
The text was updated successfully, but these errors were encountered: