summaryrefslogtreecommitdiff
path: root/docutils/tools
Commit message (Collapse)AuthorAgeFilesLines
* Add a small backwards compatibility script for rst2odt_prepstyles.py.milde2023-05-161-0/+20
| | | | | | | This way, users can adapt to the new command before the "tools/*.py" scripts are no longer installed in Docutils 0.21. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9387 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Move auxiliary script rst2odt_prepstyles.py to the library.milde2023-05-161-78/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9386 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fixes for "rst2odf_prepstyles" module.milde2023-04-261-8/+19
| | | | | | | | | | Apply [patch:#427] by Dmitry Shachnev: Open output (zip)file in binary mode. Use standard `xml.etree` module instead of 3rd party `lxml`. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9365 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Small fixes to odt_prepstyles module.milde2023-04-191-3/+5
| | | | | | | | Add link to the full documentation to "usage". Specify encoding when writing to zipfile. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9360 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid ambiguous module name `io`.milde2023-02-071-4/+4
| | | | | | | 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
* Simplify/update utils.punctuation_chars and generating script.milde2022-11-241-83/+86
| | | | | | | | | | | 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
* 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
* Update `utils.punctuation_chars` (keeping backwards compatibility).milde2022-11-161-26/+27
| | | | | | | | | | 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
* Update ``generate_punctuation_chars`` templatesaa-turner2022-11-161-26/+28
| | | | | | | | | 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
* Move ``quicktest`` to ``tools/dev``aa-turner2022-11-021-25/+22
| | | | | | | | | | The quicktest tool has not been substantively modified since 2006. It may still be useful for generating test-cases, so move it to the developer tools section and do not advertise it as a front-end tool. Update documentation where relevant to remove mention of quicktest as a front-end tool, and remove obsolete "EasyDialogs" code path. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9201 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Cleanup.milde2022-07-2813-13/+13
| | | | | | | | Fix typo. Remove spurious whitespace. Bare "except" replaced with ``except Exception``. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9115 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Add encoding arguments when opening files.milde2022-06-152-2/+2
| | | | | | | | | | | | | Specify intended incoding, when possible. Avoids `EncodingWarning` in PEP 597 and nasty surprises if the default encoding is not what the user expects. Keep encoding unspecified where this may be an API change. Based on patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9072 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Unify naming of the "utf-8" codec.milde2022-06-131-6/+6
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9068 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Postpone deprecations to Docutils 2.0milde2022-05-301-1/+1
| | | | | | | Starting in 1.0, we want to move to "semantic versioning": no incompatible API changes in "minor" releases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9062 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Command line "entry point" to the docutils package. Part 2/2.milde2022-05-301-0/+24
| | | | | | | | | | | | | | Support ``python -m docutils`` with new module `docutils.__main__`. Support ``docutils`` CLI command via "entry point" in setup.py. Keep tools/docutils-cli.py for backwards compatibility and manual installation. Calls `docutils.__main__.main()`. Thanks to Adam Turner for contributions and review. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9061 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Command line "entry point" to the docutils package. Part 1/2.milde2022-05-301-106/+0
| | | | | | Move the generic command line interface to docutils/__main__.py. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9060 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Suppress deprecation warnings and some cleanup in buildhtml tool.milde2022-04-021-22/+24
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9052 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Prepare switch from optparse to argparse.milde2022-03-171-2/+2
| | | | | | | | | | | | | New interface function: frontend.get_default_settings() easy access to default settings for programmatic use. Add deprecation warnings. Catch them when accessing the deprecated functions from Docutils. Make docstrings conform to the Documentation Policies (first line: summary, next line empty). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9047 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused imports.milde2022-03-051-2/+2
| | | | | | 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-051-2/+2
| | | | | | | | | 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 ambiguous variable name l (may be mixed up with 1).milde2022-03-051-13/+13
| | | | | | flake8 rule E741 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9034 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Avoid too long lines.milde2022-03-054-9/+7
| | | | | | 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-045-0/+25
| | | | | | | | 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
* Ensure at least two spaces before inline comment.milde2022-03-045-16/+16
| | | | | | | | | 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 unexpected spaces around equals indicating keyword arguments.milde2022-03-032-2/+2
| | | | | | flake8 rule E251 git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9020 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix missing whitespace after ',' or ':'.milde2022-03-031-2/+2
| | | | | | | | 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-032-4/+4
| | | | | | | | | | | | | | 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 whitespace before/after delimiters and colon.milde2022-03-032-19/+19
| | | | | | | | | | | | | | 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
* Make docutils-cli.py importable. Better/simpler help output.milde2022-02-101-57/+70
| | | | | | | | | | Put action code in function main(). Use CliSettingsSpec to provide both, defaults for Publisher.get_settings() and help with publish_cmdline(). git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@9005 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix trailing whitespace (non-Python files).milde2022-01-293-3/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8995 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Fix code indentationmilde2022-01-296-36/+34
| | | | | | | | | | | | | | | | | | | | 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-291-1/+0
| | | | | | | 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-291-1/+1
| | | | 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-263-4/+4
| | | | | | 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-261-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8983 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused importsmilde2022-01-262-2/+0
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8979 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use "x not in y" over "not x in y"milde2022-01-261-2/+2
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8978 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove redundant parenthesesmilde2022-01-261-1/+1
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8976 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Use generator expressions with functions expecting a sequence.milde2022-01-262-4/+4
| | | | | | Based on patches by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8970 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Modernise helper script generating `punctuation_chars.py`.milde2022-01-261-39/+37
| | | | | | | | Update/clean code after droping Python 2.7 support. Based on patch-set by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8968 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Suppress help output for deprecated command line options.milde2022-01-251-1/+1
| | | | git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8966 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* docutils-cli: Use "SettingsSpec" interface for config file parsing.milde2022-01-251-58/+53
| | | | | | | | Use the high-level interface provided by docutils.core instead of the low-level classes/functions in docutils.frontend to get reader/parser/writer names from standard configuration files. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8965 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Update URLs in the docs.milde2022-01-213-5/+5
| | | | | | | | Mostly http: -> https:, based on a patch by Adam Turner Remove/update some dead links. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8959 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sourceforge.net -> https://docutils.sourceforge.iomilde2022-01-205-9/+9
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8956 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* More changes to https://sourceforge.netmilde2022-01-201-1/+1
| | | | | | Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8955 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Change http://docutils.sf.net -> https://docutils.sourceforge.iomilde2022-01-203-3/+3
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8954 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Remove unused optparse import.milde2022-01-141-1/+0
| | | | | | Patch by Adam Turner. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8950 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Drop use of utils.error_reporting module and deprecate it.milde2022-01-072-12/+10
| | | | | | | | | | SafeString not required in Python 3 ErrorString obsoleted by new function io.error_string(). ErrorOutput and locale_encoding moved to docutils.io. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8937 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
* Front-end documentation update and small fix.milde2022-01-051-1/+1
| | | | | | | | | Revise/fix front-end tool documentation. Add support for -h and --help options to rst2odt_prepstyles.py in order to unify behaviour. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk@8932 929543f6-e4f2-0310-98a6-ba3bd3dd1d04