summaryrefslogtreecommitdiff
path: root/docutils
Commit message (Collapse)AuthorAgeFilesLines
...
* Use pathlib.Path in utils.find_file_in_dirs().milde2022-11-283-23/+17
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9283 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Wrap definition lists with "details" class argument in a <div>milde2022-11-285-10/+23
| | | | | | | | with the "id" and "class" values of the list node. Enables setting an "anchor" or a "class" value for "detail disclosure elments". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9282 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small documentation fixes and updates.milde2022-11-283-42/+47
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9281 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add navigation links to the documentation in the "Docutils root" directory.milde2022-11-288-2/+26
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9280 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More consistent formatting in HISTORY log.milde2022-11-281-221/+238
| | | | | | | | | | Use "inline-literal" for code snippets, filenames, command-line-options, and terminal output. Use hyperlinks for configuration settings. Use double quotes for, e.g., rST directive names and string values. Keep formatting for changes in Docutils versions <= 0.4 (2006). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9279 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert "Use literal syntax in HISTORY"milde2022-11-281-86/+84
| | | | | | | | Use the default role for names of functions, classes, modules, and packages. This reverts commit 36992b9f5b75c91b501c6c25eab10fc3d8723db8. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9278 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix IndexError when running individual test modules under Python <3.9milde2022-11-26135-137/+139
| | | | | | | | | Up to Python 3.8, __file__ returns a relative path for the main script specified on the command line. Use `Path.resolve()` to make it absolute before calling `Path.parents`. https://docs.python.org/3/whatsnew/3.9.html#other-language-changes git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9277 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update FAQ, add TODO-list example.milde2022-11-252-139/+334
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9276 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small cleanups and comments.milde2022-11-252-12/+20
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9275 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix import errors with ``python -m unittest``.milde2022-11-25114-150/+715
| | | | | | | | Running standard unittest on the test suite resulted in 89 ImportErrors because ``import DocutilsTestSupport was used to set up sys.path() but the module could not be found on the original sys.path(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9274 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "pathlib" to simplify path manipulations. No change to behaviour.milde2022-11-248-65/+66
| | | | | | | | | | | Rely on `utils.relative_path()` to normalize paths. No need to use `os.normpath()` or `os.abspath()` separately. `utils.DependencyList.add()` accepts `pathlib.Path` instances. Small code cleanups. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9272 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix terminal help message under Windows.milde2022-11-241-2/+3
| | | | | | Also on Windows, the "EOT Key" (^Z) must be input on an empty line. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9271 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Simplify/update utils.punctuation_chars and generating script.milde2022-11-242-101/+97
| | | | | | | | | | | Since Python 3.3 (PEP 393), all Python builds have support for the full range of Unicode, and hence there are no longer "wide" and "narrow" builds. Patch by Adam Turner. Review/refactoring of ``generate_punctuation_chars.py`` including fixup for r9253: add quote pair for Old Hungarian. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9270 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove spurious "import unittest" from test scripts.milde2022-11-24101-101/+0
| | | | | | | There was a "late" import if __name__ == "__main__" which is no longer required when importing `unittest` at the top. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9269 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "pathlib.Path" for self-documenting path manipulations.milde2022-11-242-18/+28
| | | | | | | | Also, use Unicode literals for Umlauts. Signed-off-by: milde <milde@users.sf.net> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9268 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make "record_dependecies" test independent of the working dir.milde2022-11-241-57/+60
| | | | | | | | | | | | | | | In rST, the location of images and figures is specified as URI and used literally. As a consequence, finding a corresponding image file in the local filesystem depends on the current working directory. The tests are designed to work if the cwd is the test root. As only files that are actually found are written to the "dependencies", we disable the tests for image file registry if cwd != test root. Also, use "pathlib.Path" for simpler path manipulations. Signed-off-by: milde <milde@users.sf.net> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9267 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix failure when "pygments" is not installed.milde2022-11-241-5/+10
| | | | | | | | | A name mismatch occured during the test refactoring which prevented deleting a test sample requiring "pygments". Signed-off-by: milde <milde@users.sf.net> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9266 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Reset not only `_roles` but also `_directives` cache dictionary.milde2022-11-243-8/+52
| | | | | | | | | | | | | | | | Clean the global caches to ensure predictable test results. (There were additional warnings for undefined directive and role names under Windows. These were suppressed due to other tests adding canonical names to the cache under Linux.) Add additional warnings to the expected output samples. Registering directives at test module level no longer works. Move `register_directive()` call to the test function. Signed-off-by: milde <milde@users.sf.net> git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9265 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Skip individual "recommonmark" tests if "recommonmark" is missing.milde2022-11-2414-56/+156
| | | | | | | | Skipping the complete test directory does not work with "alltests.py". Also fix running the individual tests scripts. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9264 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix running of individual test (first batch).milde2022-11-2415-15/+54
| | | | | | | | | | | | | | | | | | After test refactoring, test scripts failed with ImportError unless started from the "test root" ``docutils/test/``. Prepend the "docutils root" to the Python library path so we import the local `docutils` and `test` packages, ignoring an eventually installed Docutils package. Set executable bit where this was missing. Also: Use "pathlib" instead of "os.path" for self-documenting path manipulations. Remove duplicate ``import unittest`` statements. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9263 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Put `first` and `second` arguments of `assertEqual` on the top line.milde2022-11-241-6/+4
| | | | | | | | | When a test fails, only the first line of the failing statement is printed. Writing the statements that should be equal just behind the function name, we can see which argument is the actual "output" and which is the "expected" value if the assertment fails. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9262 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update/Add docstrings in `docutils.io`.milde2022-11-211-21/+35
| | | | | | | Document requirements for classes to be compatible to the Docutils I/O API. Use PEP 257 "Docstring Conventions". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9261 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make component's "TransformSpec" interface optional.milde2022-11-213-45/+65
| | | | | | | | | | | `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
* Small documentation fixes.milde2022-11-212-15/+10
| | | | | | | | | | | transforms.txt: Update "added by" in "Transforms Listed in Priority Order". io.py: reword docstrings and assertion messages, use PEP 257 "Docstring Conventions". git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9259 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use `super()` for calls to `get_transforms()` from parent class.milde2022-11-218-19/+16
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9258 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use boolean values for boolean settings.milde2022-11-181-5/+5
| | | | | | This fixes a leftover from the times Python did not have a `bool` datatype. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9257 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert FutureWarnings.milde2022-11-182-15/+14
| | | | | | | Wait with warnings until a consensus is found about the future "string/bytes" export API and stable usage patterns can be recommended. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9256 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Documentation updatemilde2022-11-183-47/+51
| | | | | | | | | | | | | | | | dev/hacking: Format example code as script rather than as console log (enables easier use via drag-and-drop). Hint to the "quicktest" development tool. Add links. user/config: Fix legacy-lass-functions default change warning. user/toos: Simplify description of the generic front end. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9255 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use a simpler algorithm to generate char listsaa-turner2022-11-161-17/+8
| | | | | | | | | | | | | The current algorithm checks each codepoint at least once, and when ``cp_max`` is ``None``, it checks all used characters twice. This combines the two loops and stores the results of the call to ``unicodedata``. Also remove the text about "wide" builds of Python, since PEP 393 and Python 3.3, all builds of Python carry support for the full Unicode space. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9254 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix ``punctuation_chars`` regeneration for testsaa-turner2022-11-161-0/+7
| | | | | | | | | | | | | | | Unicode version 7.0 introduced U+2E42, "DOUBLE LOW-REVERSED-9 QUOTATION MARK", in the Ps category. This codepoint doesn't have a pair corresponding to it in the Pe category, breaking the assumptions in the ``openers`` and ``closers`` strings. The only usages I have been able to identify are in Old Hungarian, where the character does not seem to have been used as a quotation mark, so the concept of an opening character and corresponding closing character do not easily fit. As the simplest fix to allow tests to pass following regeneration of the ``punctuation_chars`` file without manual editing, we remove the U+2E42 character from the Ps category. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9253 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix ``.flake8`` for ``generate_punctuation_chars``aa-turner2022-11-161-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9252 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update `utils.punctuation_chars` (keeping backwards compatibility).milde2022-11-162-84/+93
| | | | | | | | | | Update/harmonize the formatting/layout in both, the generated file and the generating script. Remaining differences between the current module and a re-generation result are due to different versions of Python's `unicodedata` module. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9251 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix "shebang on non-executable files".milde2022-11-164-7/+3
| | | | | | | | Based on patch in opensuse.org RPM package spec. - Change mode of files supporting use as command-line script. - Remove "shebang line" from library modules. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9250 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop default settings from individual functional test files.milde2022-11-1634-886/+295
| | | | | | | | | Define common defaults for all functional tests in `test_functional.py`. Only specify settings that differ from the default/fallback value in the individual test files. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9249 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Revert [r9247] "Regenerate ``punctuation_chars``"aa-turner2022-11-161-78/+57
| | | | | | Two tests failed. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9248 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Regenerate ``punctuation_chars``aa-turner2022-11-161-57/+78
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9247 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update ``generate_punctuation_chars`` templatesaa-turner2022-11-162-26/+31
| | | | | | | | | This changes the templates to match changes made to ``punctuation_chars``, making updating the file easier. It also changes the string wrapping algorithm, leaving less space blank on each line. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9246 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use literal syntax in HISTORYaa-turner2022-11-151-87/+89
| | | | | | | Switch emphasis syntax (italics) to literal syntax (monospaced) for code, methods, classes, functions, programme names, and file paths. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9245 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Restructure HISTORY to file-based listingaa-turner2022-11-151-29/+40
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9244 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix: SetuptoolsDeprecationWarning: Installing '' as data is deprecatedgrubert2022-11-142-0/+9
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9243 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* HTML5 writer: use parent `depart_document()` method.milde2022-11-132-38/+15
| | | | | | | Store the arguments to starttag() in a class property, to allow for different tags (HTML4 <div class="document"> and HTML5 <main>). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9242 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More consistent HISTORY styling.milde2022-11-131-55/+54
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9241 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Refactor HTMLTranslator initialization and parts setup.milde2022-11-1328-142/+127
| | | | | | | | | | | | | | | | | Use utils.xml_declaration(). Don't write charset (encoding) declaration if the intended output encoding is not known. Copy "meta" part content into "head" in `depart_document()` (i.e. after collecting all items). Obsoletes auxiliary method `add_meta()`. Remove it. Changes to the HTML output (no space character before closing tag of XML declaration, order of metadata elements) don't affect the HTML semantics, styling, and rendering. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9240 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* New function utils.xml_declaration()milde2022-11-134-11/+37
| | | | | | | | | Return XML text declaration. Include an encoding declaration if the intended encoding is known. Used in XML (and soon also in HTML) writer. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9239 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove "fixltx2e.sty" package call from "titlepage.tex" LaTeX template.milde2022-11-112-1/+5
| | | | | | | This package is loaded by default since 2015. The package call was removed from the other templates in Docutils 0.14. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9238 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add support for ``pytest``aa-turner2022-11-104-6/+33
| | | | | | | | | | | | 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
* Make the tests agnostic to the working directoryaa-turner2022-11-1019-128/+243
| | | | | | | | | | | Previously, the test suite only worked when the current working directory was ``docutils/test/`. With this change all relative paths are calculated explicitly such that the working directory no longer affects the tests, meaning a less fragile test environment and greater flexibility to use test runners other than ``alltests.py``. This is part of the test suite refactoring project. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9236 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix/complement publisher documentation and tests.milde2022-11-103-24/+76
| | | | | | | | | | | | | | | | | | | | | | | API documentation: - Spell out ampersand (&) as "and". - Finish description of part "pepnum". - Add links to LaTeX templates. - Remove trailing whitespace. Docstrings: - Clarify source and output data type for functions using "string I/O" (with "string" in the general sense of "`str` or `bytes`"). - Recommend using publish_parts() to get Docutils output as `str`. - Add "()" to functions so that pydoc HTML rendering generates auto-links. - Add links to the HTML documentation. Tests: - Add test for input/output data types of publish_string(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9235 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Inline ``DocutilsTestSupport.testroot``aa-turner2022-11-094-22/+16
| | | | | | | | | - Move all usages of ``testroot`` to defining and using a ``TEST_ROOT`` constant within the module, as part of the test suite refactoring project - Avoid ``os.chdir`` calls within ``test_error_reporting`` git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9234 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Make ``test_include`` independent of the CWDaa-turner2022-11-091-267/+268
| | | | | | | | | Tests in ``test_include`` previously only passed when the current working directory was equal to the test root. This change makes it possible to run the tests without changing the CWD, as part of the test suite refactoring project git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9233 929543f6-e4f2-0310-98a6-ba3bd3dd1d04