Sphinx: code-block and literalinclude should support a caption

Bug #606265 reported by Eike
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Freeode
New
Low
Unassigned

Bug Description

Put wish into Sphinx Bugzilla or create patch.

The two markup elements "code-block" and "literalinclude" should include a caption.
With caption I mean a line of text, which appears directly under the block of code and
which contains a short description.

The "figure" element supports such a caption.

A caption would also make automatic references to the block of code possible.

Tags: sphinx website
Eike (eike-welk)
Changed in freeode:
importance: Undecided → Low
tags: added: sphinx website
Eike (eike-welk)
summary: - Sphinx: Code code-block and literalinclude should support a caption
+ Sphinx: code-block and literalinclude should support a caption
Eike (eike-welk)
description: updated
Revision history for this message
JacobSingh (jacobsingh) wrote :

+1, how would you see this implemented?

Revision history for this message
Eike (eike-welk) wrote :

The bug mainly serves as a reminder that I want to file a wish in Sphinx's issue tracker. (Filing bugs in my issue tracker is fast for me.)

I think the implementation of the feature should be relatively easy, because the functionality already exists for the ``figure`` element. ``code-block`` and ``literalinclude`` elements are often small rectangular regions of the document, similar to ``figure`` elements, and in these situations a caption makes sense. Therefore I think in the necessary HTML or TEX code for captions could be very similar for these three elements.

Revision history for this message
Eike (eike-welk) wrote :

There is an open issue for a similar wish already in Sphinx's bug tracker:

https://bitbucket.org/birkenfeld/sphinx/issue/541/captions-for-literalinclude

Eike (eike-welk)
Changed in freeode:
milestone: none → 0.4.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.