On this opportunity the code and comments in sphinx.sty from commit
9d82cad (LaTeX captions of literal blocks now glued to framed verbatim)
have been re-organized, uses less macros. Only functional difference
should be the fix of #2447.
modified: sphinx/texinputs/sphinx.sty
As conf.py has now numfig = True, needed to modify accordingly test for
links in html output.
This topic branch fixes#2405, #2414, and also makes for latex(pdf)
functional hyperlinks to named references, but only for literal blocks
(code-block or literalinclude).
modified: tests/roots/test-directive-code/caption.rst
modified: tests/roots/test-directive-code/conf.py
new file: tests/roots/test-directive-code/namedblocks.rst
modified: tests/test_directive_code.py
Indeed, sphinx.sty redefines _environment_ Verbatim, and LaTeX's
environments always are scope-limiting for local assignments.
modified: sphinx/texinputs/sphinx.sty
This is tango between latex.py and sphinx.sty to handle PDF hyperlinks
to literal-blocks (both code-block and literalinclude) either with name
or caption (then numref can be used) or both.
modified: sphinx/texinputs/sphinx.sty
modified: sphinx/writers/latex.py
This test file is now back to original.
modified: tests/test_directive_code.py
Allow these time formatters again.
This requires to use babel.dates.format_datetime instead of babel.dates.format_date
for formating. The approach of babel compared to ustrftime to use different functions
for time, date and datetime formating creates an ambiguousness for translating %c, %x, %X
from ustrftime to babel. Hence we look out for %x and %X to use the appropriate babel
function in this case.
Change of behaviour: People using the short, medium, long or full babel formats in
today_fmt will now get the respective datetime format instead of just the date format.
The `\label` is now inserted into the caption on top of the Verbatim,
and `\ref` will work as expected. No need for `\phantomsection`.
modified: sphinx/writers/latex.py
modified: tests/test_directive_code.py
`html_last_updated_fmt` is commonly used for non date formatting. But
LDML is difficult to represent them from its characteristics.
Now we moved to strftime format again (ref: #2394).