mirror of
git://repo.or.cz/docutils.git
synced 2025-10-06 00:32:41 +02:00
Various small fixes.
Markup "long description" in README as "abstract". Solve QA: ISC001 in LaTeX writer. Fix naming of auxiliary variables in _html_base.HTMLTranslator.prepare_svg(). The "style" attribute (as one of the "image" node attributes ("atts")) contains a list of ";"-separated style declarations. Fixes r10024 and r10026. Fix cross-link. git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@10049 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
This commit is contained in:
@@ -8,10 +8,10 @@
|
||||
:Web site: https://docutils.sourceforge.io/
|
||||
:Copyright: This document has been placed in the public domain.
|
||||
|
||||
Docutils is a modular system for processing documentation
|
||||
into useful formats, such as HTML, XML, and LaTeX.
|
||||
For input Docutils supports reStructuredText, an easy-to-read,
|
||||
what-you-see-is-what-you-get plaintext markup syntax.
|
||||
:Abstract: Docutils is a modular system for processing documentation into
|
||||
useful formats, such as HTML, XML, and LaTeX.
|
||||
For input Docutils supports reStructuredText, an easy-to-read,
|
||||
what-you-see-is-what-you-get plaintext markup syntax.
|
||||
|
||||
.. contents::
|
||||
|
||||
|
@@ -495,16 +495,16 @@ class HTMLTranslator(writers.DoctreeTranslator):
|
||||
# Apply image node attributes:
|
||||
if 'style' in atts:
|
||||
# update style declarations
|
||||
clean_atts = {}
|
||||
svg_style = svg.get('style', '').split(';')
|
||||
style_atts = atts['style'].split(';')
|
||||
for att in svg_style + style_atts:
|
||||
if not att.strip():
|
||||
declaration_dict = {}
|
||||
svg_declarations = svg.get('style', '').split(';')
|
||||
node_declarations = atts['style'].split(';')
|
||||
for declaration in svg_declarations + node_declarations:
|
||||
if not declaration.strip():
|
||||
continue
|
||||
key, _, value = att.partition(':')
|
||||
clean_atts[key.strip()] = value.strip()
|
||||
style_att = ' '.join(f'{k}: {v};' for k, v in clean_atts.items())
|
||||
svg.set('style', style_att)
|
||||
key, _, value = declaration.partition(':')
|
||||
declaration_dict[key.strip()] = value.strip()
|
||||
svg.set('style', ' '.join(f'{k}: {v};'
|
||||
for k, v in declaration_dict.items()))
|
||||
for dimension in ('width', 'height'):
|
||||
if dimension in atts:
|
||||
svg.set(dimension, atts[dimension])
|
||||
|
@@ -2581,13 +2581,12 @@ class LaTeXTranslator(writers.DoctreeTranslator):
|
||||
|
||||
Corresponding rST elements: literal block, parsed-literal, code.
|
||||
"""
|
||||
packages = {
|
||||
'lstlisting': r'\usepackage{listings}' '\n' # NoQA: ISC001
|
||||
r'\lstset{xleftmargin=\leftmargin}',
|
||||
'listing': r'\usepackage{moreverb}',
|
||||
'Verbatim': r'\usepackage{fancyvrb}',
|
||||
'verbatimtab': r'\usepackage{moreverb}',
|
||||
}
|
||||
packages = {'lstlisting': '\\usepackage{listings}\n'
|
||||
'\\lstset{xleftmargin=\\leftmargin}',
|
||||
'listing': r'\usepackage{moreverb}',
|
||||
'Verbatim': r'\usepackage{fancyvrb}',
|
||||
'verbatimtab': r'\usepackage{moreverb}',
|
||||
}
|
||||
|
||||
literal_env = self.literal_block_env
|
||||
|
||||
|
@@ -99,7 +99,7 @@ Powered by |Python|_.
|
||||
https://docutils.sourceforge.io/docs/index.html
|
||||
.. _Docutils' Subversion repository:
|
||||
https://docutils.sourceforge.io/docs/dev/repository.html
|
||||
.. _requirement: https://docutils.sourceforge.io/README.html#requirements
|
||||
.. _requirement: https://docutils.sourceforge.io/README.html#dependencies
|
||||
.. _release packages: https://pypi.org/project/docutils/#files
|
||||
.. _PyPI: https://pypi.org
|
||||
.. _release notes: https://docutils.sourceforge.io/RELEASE-NOTES.html
|
||||
|
Reference in New Issue
Block a user