Custom label for code-block captions (Output 1.2 / Input 1.2 / Source 1.4 / Directory tree 1.2 / etc) #6642
Labels
type:enhancement
enhance or introduce a new feature
Milestone
Is your feature request related to a problem? Please describe.
Although
Listing 1.2
is used in English literature for both source code listing, pseudocode, programoutput, console sessions etc. I would often prefer to use "Output 1.2" when listing output, "Source 1.2" when listing source code etc.I refer to the
Listing
inListing 1.2
as the caption label. This might be the wrong terminology, I don't know. It is of course not to be confused with labels used with references.Describe the solution you'd like
Input:
Output:
Output 1.2: Output of nested loop.
Although not the prettiest, the code-block counters could be kept as they were, i.e. no matter the
:caption-label:
they would use the same counter producing what is in the screenshot.I suppose the optimal thing would be to use separate counters for each
:caption-label:
.Describe alternatives you've considered
I suppose one could use / create special extensions for each use case, extensions which would provide new directives like
.. output-block::
. This would be semantically pretty, but also a bit overkill in my view, after all it is just a label for the caption, it is not like the block itself should be rendered differently.The text was updated successfully, but these errors were encountered: