summaryrefslogtreecommitdiff
path: root/docutils
Commit message (Collapse)AuthorAgeFilesLines
...
* Correct a typo in ``RELEASE-NOTES``aa-turner2023-04-061-1/+1
| | | | | | | | | Docutils 0.21 will support Python 3.9 or later, so Python 3.7 and 3.8 will be dropped. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9337 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add "auto_encode" argument to `publish_string()`milde2023-04-066-20/+196
| | | | | | | | | | | | | | | | Add "auto_encode" argument to publish_string() and publish_programmatically() to give the user an option to select the output type (`bytes` or `OutString`) in a way that does not interfere with the intended encoding of the output (the problem with the "dummy" output encoding name ``unicode``). The default will change from ``False`` to ``True`` in Docutils 0.22 New class for `io.StringOutput`: `io.OutString` adds "encoding" and "errors" attributes to `str`. Allows storing the "output_encoding" and "output_encoding_error_handler" settings in a transparent and easy to process way. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9336 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update source links for smartquotes localization.milde2023-04-061-12/+14
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9335 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prefer Unix style line endingsaa-turner2023-03-311-28/+28
| | | | | | | | | | | | | | I had inadvertently committed two files with Windows style 'CRLF' (``\r\n``) line endings. This commit changes ``docutils/test/conftest.py`` and ``.gitattributes`` to use Unix style 'LF' (``\n``) endings. We additionally specify that Unix style line endings are only enforced in the ``docutils`` directory, as there are around 20 files in the sandbox that use Windows style line endings, and I don't want to change these at the moment. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9334 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update Flake8 version and resolve lint warningsaa-turner2023-03-252-2/+2
| | | | | | | | | Flake8 6.0.0 introduces a stricter format for parsing ``.flake8`` files, which does not allow comments on the same line as the error code in ``ignore`` sections. For now, update to the last version before 6.0.0. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9331 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use absolute paths in ``test_CLI``aa-turner2023-03-251-2/+4
| | | | | | | | | | | When running tests in working directories other than ``docutils/test``, the tests fail as the expected files cannot be opened from the relative ``./data`` path. This change uses the defined ``DATA_ROOT`` constant so that the tests pass regardless of working directory. We also take the opportunity to explicitly specify the encoding with which to open the file, avoiding platform-dependent behaviour. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9330 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous module name `io`.milde2023-02-072-53/+54
| | | | | | | There are standard `io` and `docutils.io`. Avoid ambiguity by not using ``from docutils import io``. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9329 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New general setting "output".milde2023-02-078-13/+68
| | | | | | | | This setting obsoletes the positional argument <destination>. Cf. the announcement of command line pattern changes in the RELEASE-NOTES. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9328 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Announce command-line usage pattern change.milde2023-02-072-2/+27
| | | | | | Cf. [feature-requests:#36]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9327 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update documentation on planned changes.milde2023-02-063-9/+20
| | | | | | | | Announce target versions for imminent changes. Announce raise of required minimal Python version to 3.9. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9326 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New functions for use as `rst2*` "console_scripts entry points".milde2023-02-067-28/+579
| | | | | | | | | | | | | | The new functions allow the installation of `rst2*` command line scripts via standard `entry points`__ instead of the current "scripts" list in ``setup.py`` after a transition period (cf. [feature-requests:#88]). + Works also for Windows. + Allows shorter command names (drop the extension), already in use in Debian and Ubuntu. __ https://packaging.python.org/en/latest/specifications/entry-points/ git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9325 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* LaTeX writer: outsourcing of some code from `depart_document()`.milde2023-01-212-31/+48
| | | | | | | | Move parts of the spaghetti code in `LaTeXTranslator.depart_document() to new auxiliary methods `LaTeXTranslator.make_title()` and `LaTeXTranslator.append_bibliography()`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9324 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix test case under Windows, add HISTORY entry for last commit.milde2023-01-172-7/+16
| | | | | | Thanks to Alan Isaac for test and report. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9323 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More user-friendly DocInfo transform.milde2023-01-173-25/+54
| | | | | | | | | | | | | 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
* Fix failures when running "transform" test modules as "__main__".milde2023-01-172-40/+33
| | | | | | | | | | | | | | | | | | | | | | | Also restructure `test_docinfo` to reduce code duplication. Running "transform" test modules independently failed due to an additional INFO message: Loading a language module results in an INFO message. Import statements don't trigger the INFO message if the language module is already loaded. When running a test module as __main__, the INFO message is added to the first document using both, the language module and the `Messages` or `TestMessages` transform. When running the test suite, the language module may already be loaded by another test. For stable results, the optional message must be filtered. In "transform" tests, we do not load the default transforms, so INFO messages are only filtered if `FilterMessages` is explicitly added. As `FilterMessages` only acts on attached messages, it must run *after* `TestMessages`, therefore we load it with custom priority 890. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9321 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
* "tuftig" style sheet: drop fonts that don't look good at small resolutions.milde2023-01-161-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9319 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use self documenting name for `core.Publisher` instances.milde2023-01-161-30/+31
| | | | | | | | Use "publisher" instead of "pub" in publish_* functions for internal variables holding `core.Publisher` instances in `publish_*()` functions. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9318 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix and activate test for "parts" published by the LaTeX writer.milde2023-01-161-23/+23
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9317 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Always use POSIX path in macros loading stylesheets.milde2023-01-163-11/+11
| | | | | | Thanks to Alan G. Isaac for reporting the bug and proposing a patch. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9316 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop not required parentheses.milde2023-01-151-27/+27
| | | | | | Line continuation works also without parentheses inside `{}`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9315 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* `locale.getdefaultlocale()` is deprecated in Python 0.11milde2023-01-103-3/+7
| | | | | | | | | | | | | | | Let `smartquotes.py` to use `locale.getlocale` instead. (Only used if this module is called as standalone application.) Suppress warning in `docutils.io`: * Don't change current behaviour without advance warning. * The deprecated function is called inside a try-block with catchall, so this will not lead to errors once it is removed (if we were to keep the code until then). Fixes [bugs:#464]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9314 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Policy change: accept literal Unicode characters except for identifiers.milde2023-01-101-9/+5
| | | | | | | | With UTF-8 as default encoding for Python source code and widespread Unicode support in todays editors on all platforms, there is no need to be more restrictive than PEP 8 any more. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9313 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bugs:#384]: allow omission of citations with "use_bibtex" setting.milde2022-12-194-40/+57
| | | | | | | | | | | | | | | | | | | 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
* Refactor latex writer tests.milde2022-12-192-195/+218
| | | | | | | | | | | | | | | | Define default test settings as class attribute. Use separate test functions for different settings instead of running all sub-test from one function. Simplify naming. Add test for "use_bibtex" setting (will be fixed in next commit). Add stub for testing `core.publish_parts()` with the "latex" writer. (Currently publish_parts does not work with "latex".) git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9311 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bugs:#463]. Spurious comma in deprecation warning.milde2022-12-173-4/+10
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9310 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update Publisher API documentation.milde2022-12-132-20/+76
| | | | | | | | | | | | Use Python 3 terminology: "Unicode string" -> `str` instance. Document "string I/O" (input/output using `str` or `bytes` instances). Document input encoding auto-detection. Specify the behaviour and the "explicit encoding declaration". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9309 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update test documentation. Set executable bit on test scripts.milde2022-12-133-8/+8
| | | | | | | | | | | Don't mention the "nose" test framework. (It is unmaintained, deprecated, and fails to find all test cases.) Hint to a possible future dependency on "pytest". Two recently added test scripts missed the executable bit. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9308 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* replace: whitelist_externals renamed to allowlist_externalsgrubert2022-12-091-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9307 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* remove blanks at eol in code NOT in expectsgrubert2022-12-031-8/+8
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9305 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Allow empty string as encoding value (to re-activate default).milde2022-12-022-1/+5
| | | | | | | | | Value `None` cannot be specified on the command line. Use ``--input-encoding=""`` go back to Docutil's default behaviur (use encoding indicated in the file or fallbacks) if a config file sets "input_encoding" to another value. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9303 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify error message if recommonmark is missing.milde2022-12-022-4/+3
| | | | | | | | | As we provide a mock Sphinx package, there is no need to emphasise recommonmark's dependency on Sphinx. Wrap error message. Adapt the test case. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9302 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip test_recommonmark/ directory if recommonmark is missing.milde2022-12-0214-74/+18
| | | | | | | | | | | After basing "alltests.py" on the `unittest.defaultTestLoader`, we can (again) skip the complete directory from the __init__.py file. Simplify recommonmark test files (when running individually, failing with an ImportError when recommonmark is missing is no problem). Keep the `sys.path` setup, we still want test the local "docutils" package. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9301 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Only extempt sample *.txt files from "trailing whitespace" git pre-commit check.milde2022-12-021-114/+114
| | | | | | | | | | | | Mask trailing whitespace in test_latex2e.py. Replace the generic extemption for '*.txt' with '*pseudoxml.txt'. (Expected output from the "pseudoxml" writer which has trailing whitespace by design.) Also simplify rule after ``prest`` moved to the attic. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9300 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update test documentation.milde2022-12-021-51/+42
| | | | | | | Add links. Adapt to the changes during the recent refactoring. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9299 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove duplicate dictionary entryaa-turner2022-12-021-1/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9298 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix an f-string in `docutils.io`aa-turner2022-12-021-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9297 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Ignore ``frontend.OptionParser`` deprecation warnings in ``HelperFunctionTests``aa-turner2022-12-021-2/+4
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9296 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use unicode literal for U+00E4aa-turner2022-12-021-3/+3
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9295 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use ``unittest.defaultTestLoader`` to load testsaa-turner2022-12-021-56/+1
| | | | | | This allows raising the ``unittest.SkipTest`` error at the module level git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9294 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* The "xetex" writer now ignores settings in the [latex2e writer] config section.milde2022-12-014-18/+22
| | | | | | | Move settings intended for both, `xetex` and `latex2e` writers to section [latex writers]. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9293 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5: Use dpub-ARIA role "doc-footnote" for footnotesmilde2022-12-017-47/+58
| | | | | | | | (instead of ARIA role "note"). No change with "html4css1". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9292 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Raise version to 0.20b.dev.milde2022-12-0122-40/+44
| | | | | | There are not only bugfix changes since 0.19, so a new "minor" release is required. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9291 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update documentation.milde2022-12-014-162/+161
| | | | | | | | | | Simplify/update instructions for installing, Simplify/update instructions for building docs (there is now an up-to-date docutils.conf in the "docutils root" archive path. Update links. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9290 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Announce support for Ukrainian, cf. [r9114].milde2022-12-011-1/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9289 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix [bugs:#461] "html files in egg-info".milde2022-12-011-24/+25
| | | | | | | | | | | Update [buildhtml] section in docutils/docutils.conf to prune the "docutils.egg-info" directory. Also: Set the writer to "html5". Use POSIX line ends ("\\\\n"). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9288 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add anchors to future, ".py"-less front-end commands to "tools" documentation.milde2022-12-011-0/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9287 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* add link to user config for image_loadinggrubert2022-11-301-0/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9286 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update the "future changes" documentation.milde2022-11-291-21/+36
| | | | | | | | | | | | | | Provide example for stable command line name (when dropping .py extension from rst2*). Rewrite suggestions for stable HTML writer. Styling: Docutils writer names in quotes ("") (use the default role when referencing the `docutils.writers.<name>` sub-module, but "<name>" when referencing a writer as, e.g., configuration settings value or attribute value to `get_writer_by_name()`.). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9285 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Axe a no-op (repeated typecast).milde2022-11-281-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9284 929543f6-e4f2-0310-98a6-ba3bd3dd1d04