Hi everyone, quick question about docstrings. Sometimes it makes sense
to use the same help text for different functions; I'm particularly
thinking mutating and non-mutating versions of the same algorithm. Is
there a natural way to reuse a docstring for different functions
(either in Docile.jl or in v0.4 base)?

Specifically, I'm doing something like the following, but would prefer
to avoid the temporary variable `recursive_ols_doc` if possible (for
style reasons, if nothing else), and without writing the documentation in
a separate file.

recursive_ols_doc = """
  Calculates the OLS estimators for the model y ~ x recursively...
  * `recursive_ols` is a wrapper that works like this...
  * `recursive_ols!` does all the real work like that...
"""

@doc recursive_ols_doc ->
function recursive_ols!(estimates::Array, y, x)
    ## Calculations
end

@doc recursive_ols_doc ->
function recursive_ols(y, x, R::Integer)
    ## preallocate, then call recursive_ols!
end

Thanks!

(Really liking this documentation tool, btw)

Reply via email to