Sphinx: code-block and literalinclude should support a caption

Bug #606265 reported by Eike on 2010-07-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Freeode
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.

Eike (eike-welk) on 2010-07-16
Changed in freeode:
importance: Undecided → Low
tags: added: sphinx website
Eike (eike-welk) on 2010-07-19
summary: - Sphinx: Code code-block and literalinclude should support a caption
+ Sphinx: code-block and literalinclude should support a caption
Eike (eike-welk) on 2011-06-10
description: updated
JacobSingh (jacobsingh) wrote :

+1, how would you see this implemented?

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.

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) on 2012-02-29
Changed in freeode:
milestone: none → 0.4.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers