This commit reverts part of 5976facae92c commit:
Refactor comment generating code for message catalogs.
The commit says "Refactor" but it changes original code behavior.
In original code, start path for path.relpath() is self.outdir but
in refactored code, start path for path.relpath() is self.srcdir.
It should be self.outdir not self.srcdir to improve po-mode.el
support. po-mode.el has "po-cycle-source-reference" command. It
search source code relative from .po file directory.
See also::
http://www.gnu.org/s/hello/manual/gettext/C-Sources-Context.html
Program source files are usually found relative to where the PO
file stands. As a special provision, when this fails, the file
is also looked for, but relative to the directory immediately
above it.
Add a new option, :emphasize-lines:, to the source-code and
literal-include directives. The format is the same as the :lines:
option for literal-include. The resulting list of lines is passed to
the Pygments formatter as 'hl_lines', which is only honored by the HTML
formatter.
For the HTML and LaTeX writers, if 'highlight_args' is set on
a literal_block node, this is taken as a dictionary of keyword arguments
to pass to PygmentsBridge.highlight_block. This allows custom
directives to directly set formatter options.
In Pygments.highlight_block, pass all extra keyword arguments, including
linenos, directly to the Pygments formatter. This allows custom
directives to use other Pygments features.
Previously, we pre-constructed two different formatters, one with line
numbers and one without. This made the code rather confusing and also
was not scalable for options that take arguments, such as 'hl_lines'.
Now, we construct a new HTMLFormatter or LatexFormatter on each call to
highlight_block().
Previously, the includehidden method argument was only being taken into account
for top level toctrees. This meant that hidden subtree toctrees were still
being resolved if they exists below a non-hidden toctree.
We get the following error message when we have a translated admonition
(e.g. 'note') label:
Exception occurred:
File "../sphinx/sphinx/locale/__init__.py", line 75, in __str__
return str(self.data)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)