Open dbaston opened 3 days ago
LGTM. Maybe describe that in https://gdal.org/en/latest/development/dev_documentation.html#sphinx-rst-style-guide ?
Going to spend a bit more time on this. It doesn't work well for multi-command examples. Maybe a custom directive is the way to go, if it can be done without too much code.
What does this PR do?
Tests out a pattern for enabling cross-references to specific code snippets. This makes it easy to jump from the description of a CLI argument to an example that uses it.
Sphinx allows a code block to have a name attribute, but to enable cross-referencing it must also have a caption. So I took the description of each snippet (previously written in plain text) and moved it into the caption. The default style for a caption looks a bit awkward:
so this PR overrides the CSS so that the "caption" is more of a title:
If the pattern looks OK, it can be applied to documentation for the other CLI tools.