Everyone knows how import documentation is and how import tests are and stuff like that.
I don’t know a ton of people who love to write documentation because it is stressful to maintain.
How to build the perfect documentation?
The perfect documentation has to be
- easy to maintain
- easy to ready for everyone
- online
- REPL
- editor
In my case it’s foremost about documentation about how to use different options which are stored in a type called SolverOptions. Which has fields like branch_strategy
.
At the moment I’m using Documenter.jl and have markdown files without autodocs and stuff like that. Actually I kind of would like to keep it that way as I like to have longer documentation inside markdown than inside code. I don’t wanna write things more than once (easy to maintain) therefore I don’t want to have a small documentation inside the code if I have a full one in markdown.
My idea would be the following which I hope is at least somehow possible
In my code I would like to have
" @LINK_TO_SolverOptions_MD"
type SolverOptions
log_levels :: Vector{Symbol}
branch_strategy :: Symbol
strong_branching_nvars :: Int64
strong_branching_nsteps :: Int64
strong_restart :: Bool
incumbent_constr :: Bool
obj_epsilon :: Float64
time_limit :: Float64
mip_gap :: Float64
best_obj_stop :: Float64
solution_limit :: Int64
all_solutions :: Bool
list_of_solutions :: Bool
processors :: Int64
traverse_strategy :: Symbol
end
Then in my SolverOptions.md
Something like
## log_levels
Explanation for log levels
## branch_strategy
.....
.....
The markdown is easy to include using Documenter.jl. But it would be nice to have documentation inside the repl as well. This also can be used by editors or extensions.
In the reply I would like to use ?SolverOptions
to get the markdown version. Copying more or less works (should of course be automated ) Latex does seem to have a different structure like
“```math vs $”
It would also be nice to get a sub part of the documentation using ?SolverOptions.log_levels
which can be accessed by following the header structure in the markdown.
Several question
- What do you think about this idea?
- What do you use atm?
- Is there a way to document stuff like
SolverOptions.log_levels
atm?
I’ve build a bunch of extensions for Brackets to make documenting JS easier and I think Documenter.jl and the REPL documentation are a good start to make Julia great in documenting stuff. This is just an approach to think about it in a different way and get some insights from other programmers.