summaryrefslogtreecommitdiff
path: root/docutils/docutils/transforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix test failure introduced in [r9348].milde2023-04-171-8/+9
| | | | | | | | | Reword and wrap warning message for incompatible content of the bibliographic field "author". Adapt "frontmatter" unit test cases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9351 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix test for spurious enumerated lists in bibliographic fields.milde2023-04-141-2/+3
| | | | | | | The test for "single line paragraphs" failed for bibliographic fields followed by an empty line. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9348 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More user-friendly DocInfo transform.milde2023-01-171-16/+34
| | | | | | | | | | | | | More detailled feedback when extracting data from a bibliographic field fails. In bibliographic fields expecting a single paragraph (e.g. "author"), restore enumerated lists originating in ambiguous markup like "A. Einstein" (name with initial): in the given context, an we know that this should not be an enumeration, so fixing is better than throwing an error. Fix some cases of "ersatz" Boolean values from pre Python 2.3 times. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9322 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Minor fixes: naming of internal variables, use False as boolean.milde2023-01-172-7/+7
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9320 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bugs:#384]: allow omission of citations with "use_bibtex" setting.milde2022-12-191-2/+7
| | | | | | | | | | | | | | | | | | | If the "use_bibtex" LaTeX writer setting is active (i.e. not empty), citations are added by LaTeX/BibTeX from a database for all citation references in the document. The reference resolver transform now skips `citation_reference` nodes instead of expecting matching `citation` nodes in this case. "use_bibtex" content is now transformed to a list by the `frontend.validate_comma_separated_list()` validator. As BibTeX works only with "LaTeX citations", the "use_latex_citations" setting is set to True whenever "use_bibtex" is not empty. Update documentation. The test function, added in the last commit, now passes. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9312 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make component's "TransformSpec" interface optional.milde2022-11-211-27/+36
| | | | | | | | | | | `Transformer.populate_from_components()` now ignores components not inheriting `docutils.TransformSpec`. This is a prerequisite to allow use of standard I/O classes in the Publisher. Document the handling of `unknown_reference_resolvers`. Use PEP 257 "Docstring Conventions". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9260 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add support for ``pytest``aa-turner2022-11-101-0/+3
| | | | | | | | | | | | This is the minimal configuration required for the test suite to pass using the pytest framework. This is part of the test suite refactoring project. - Ignore two classes that start with the word "Test" - Provide the standard test header to pytest - Update the documentation git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9237 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Resolve flake8 ``E275`` erroraa-turner2022-10-201-1/+1
| | | | | | | E275: missing whitespace after keyword git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9127 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused local variablesmilde2022-03-051-1/+0
| | | | | | | | flake rule F841: local variable 'foo' is assigned to but never used In test_odt.py, a no-op class definition is removed completely. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9038 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-057-12/+10
| | | | | | flake8 rule F401 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9037 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid line break after binary operator.milde2022-03-052-12/+12
| | | | | | | | | Breaking before binary operators is the recommended style in PEP 8 (changed in April 2016). flake8 rule W504 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9035 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid multiple statements on one line. Fix redundant backslashmilde2022-03-052-2/+4
| | | | | | | | | | | | Exceptions for sets of empty class definitions and other cases where it improves comprehension. flake8 rules E502: the backslash is redundant between brackets E701: multiple statements on one line (colon) E704: multiple statements on one line (def) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9032 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-053-5/+10
| | | | | | flake8 rule E501: line too long (N > 79 characters) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9030 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure 2 blank lines around top-level functions and classes.milde2022-03-041-0/+1
| | | | | | | | flake8 rules E302: expected 2 blank lines, found 1 E305: expected 2 blank lines after class or function definition git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9026 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove excess blank lines.milde2022-03-041-1/+0
| | | | | | flakei rule E303: too many blank lines (N) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9025 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces after keywordmilde2022-03-041-6/+6
| | | | | | flake8 rule E271 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9023 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ensure at least two spaces before inline comment.milde2022-03-045-10/+10
| | | | | | | | | flake 8 rule E261 Exceptions for modules sheduled for removal or with 3rd-party origin and for data collections. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9021 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace after ',' or ':'.milde2022-03-031-1/+1
| | | | | | | | flake8 rule E231. Mostly trailing commas in list and dictionary literals. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace around operator.milde2022-03-031-1/+1
| | | | | | | | | | | | | | flake8 rules E225: missing whitespace around operator E226: missing whitespace around arithmetic operator E228: missing whitespace around modulo operator Keep ignoring the latter two rules: PEP8 limits the recommendation to "operators with lowest priority" "if operators with different priorities are used". flake8 also flags top level operators. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9017 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix multiple spaces before/after operatormilde2022-03-032-2/+2
| | | | | | | E221 multiple spaces before operator E222 multiple spaces after operator git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9016 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix whitespace before/after delimiters and colon.milde2022-03-031-2/+2
| | | | | | | | | | | | | | Flake rules E201 whitespace after '(' E202 whitespace before '}' E203 whitespace before ':' E211 whitespace before '(' Exception: : as binary operator in extended slices (cf. https://www.python.org/dev/peps/pep-0008/#pet-peeves). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9015 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix FilterMessages transform [bug:#435].milde2022-02-031-5/+14
| | | | | | | | | | | The "Messages" transform no longer tests for to-be-ignored messages but inserts all `system-messages` without parent into a "System Messages" section. This allows the "FilterMessages" transform to find and convert matching `problematic` nodes (but now it also has to remove the "System Messages" section if empty). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8997 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-293-19/+20
| | | | | | | | | | | | | | | | | | | | Check conformance to our coding policies with flake8. Fix the following problems: E111 indentation is not a multiple of four E114 indentation is not a multiple of four (comment) E115 expected an indented block (comment) E116 unexpected indentation (comment) E117 over-indented E121 continuation line under-indented for hanging indent E122 continuation line missing indentation or outdented E124 closing bracked does not match visual indentaion E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E131 continuation line unaligned for hanging indent git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8994 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warnings W293, W391).milde2022-01-292-3/+3
| | | | | | | W293 blank line contains whitespace W391 blank line at end of file git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8993 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (flake warning W291).milde2022-01-292-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8992 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New style classes no longer need to inherit from `object`.milde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8984 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop string prefix "u".milde2022-01-262-9/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip assigning to a variable when immediately returningmilde2022-01-261-2/+1
| | | | | | Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8980 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-266-10/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-262-3/+3
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes and clean-ups by Adam Turner.milde2022-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Remove duplicate definitions in language modules. Import locale_encoding from `docutils.io` Use decorator for staticmethod Use True/False over 1/0. `collections.OrderedDict` no longer required, all dictionaries are ordered from Python 3.7 Remove obsolete `__cmp__` method cf. https://docs.python.org/3/whatsnew/3.0.html#ordering-comparisons Use str instead of type(''). Zero-argument ``super()`` Simplify test support module as "u" prefix isn't used by repr in Python 3. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8973 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Code modernisation. Use literals.milde2022-01-261-2/+2
| | | | | | Merger of 2 patches by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8969 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sourceforge.net -> https://docutils.sourceforge.iomilde2022-01-201-4/+4
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8956 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-201-3/+3
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change removal warnings to "minor + 2" where appropriate.milde2022-01-141-2/+2
| | | | | | | | | | | | The version number of the next release(s) may be "1.0, 1.1, ...", "0.19, 1.0, ...", or "0.19, 0.20, ...". Lower announced removal version to "0.21 or later" for DeprecationWarnings that did not include a removal version in the last release and for DeprecationWarnings that were added after the last release. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8949 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Refer to the "pycmark" CommonMark parser and other documentation fixes.milde2022-01-111-3/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8942 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop (most) special-casing for Python 2.x.milde2022-01-032-11/+3
| | | | | | Simplifications for nodes.py and error_reporting.py will follow. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8928 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "coding:" slugmilde2022-01-032-2/+0
| | | | | | Only required with Python 2.x. Encoding in Py3k is utf8 by default. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8926 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Deprecate transforms.writer_aux.Compound.milde2021-12-231-0/+11
| | | | | | | This transform is not used since the retirement of the "newlatex" writer in Dec 2010. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8913 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small documentation updates and fixes.milde2021-12-231-2/+8
| | | | | | | Also change the priority of the SmartQuotes transform to a level not already in use. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8912 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Node.traverse() returns a list again to restore backwards compatibility.milde2021-11-115-24/+24
| | | | | | | | | | | | | Although the documented API only promised an "iterable" as return value, the implementation returned a list. Because Sphinx < 4.0.0 relies on this and Sphinx < 3.5.4 places no upper limit to the Docutils dependency, this led to many errors "in the wild". Fixes bug #431. New method Node.findall(): like Node.traverse() but returns an iterator. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8885 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix spellingmilde2021-10-221-6/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8860 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip system_messages when propagating targets. Fixes bug #425.milde2021-09-201-34/+37
| | | | | | | Testing with "alltests.py" is currently impossible due to caching (see itest_hyperlinks_de.py) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8831 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* LaTeX writer: revise Docutils-generated table of contentsmilde2021-09-111-2/+2
| | | | | | | Improve spacing, allow customization. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8826 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small documentation fixes and additions.milde2021-07-121-8/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8801 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Do not use deprecated "rawsource" argument when creating node.Text instances.milde2021-06-302-4/+2
| | | | | | | | The "rawsource" argument of ``nodes.Text.__init__`` is ignored and deprecated. Fix the documentation of nodes.Text.__new__(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8782 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Insert "meta" nodes at begin of document.milde2021-06-171-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8767 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make "meta" a standard node.milde2021-06-171-6/+11
| | | | | | Fixes also bug #241. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8766 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* ``nodes.Node.traverse()`` now returns an iterator instead of a list.milde2021-05-181-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8730 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small documentation update.milde2021-05-181-3/+8
| | | | | | | | | restructuredtext.txt: Clarify which elements may come before the docinfo. Add missing classes in "transforms.universal" docstring. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8727 929543f6-e4f2-0310-98a6-ba3bd3dd1d04