ModelPredictiveControl.jl defines plot recipes that works on SimResult
types. My recipes include keyword arguments like plotu=false
so user can type
using ModelPredictiveControl, ControlSystemsBase, Plots
res = sim!(LinModel(tf(2, [10, 1]), 1.0), 50) # return a SimResult object
plot(res, plotu=false)
to plot the model output, without including an additional subplot with the manipulated input. I would like to document these keyword arguments. Ideally both in the REPL with ?
-mode and in the online documentation. According to the RecipesBase.jl documentation:
Documenting plot functions
A documentation string added above the recipe definition will have no effect, just like the function name is meaningless. Since everything in Julia can be associated with a doc-string, the documentation can be added to the name of the plot function like this
""" My docstring """ my_plotfunc
This can be put anywhere in the code and will appear on the call
?my_plotfunc
.
This trick does work for the ?
-mode, but for the Documenter.jl doc, this block:
```@docs
ModelPredictiveControl.my_plotfunc
```
produces this error at building:
┌ Error: undefined binding 'ModelPredictiveControl.my_plotfunc' in `@docs` block in src/public/plot_sim.md:30-32
│ ```@docs
│ ModelPredictiveControl.plot_recipe
│ ```
└ @ Documenter ~/.julia/packages/Documenter/C1XEF/src/utilities/utilities.jl:44
What’s the best way to do that ?