pax_global_header 0000666 0000000 0000000 00000000064 14147205701 0014513 g ustar 00root root 0000000 0000000 52 comment=6cdcd52d5ed004ad48368e7017a0bb911dad2ec0 python-textile-4.0.2/ 0000775 0000000 0000000 00000000000 14147205701 0014513 5 ustar 00root root 0000000 0000000 python-textile-4.0.2/.coveragerc 0000664 0000000 0000000 00000000153 14147205701 0016633 0 ustar 00root root 0000000 0000000 [run] branch = True source = textile parallel = True [report] show_missing = True omit = textile/tests/* python-textile-4.0.2/.gitignore 0000664 0000000 0000000 00000000265 14147205701 0016506 0 ustar 00root root 0000000 0000000 *.pyc *.orig *.rej *~ *.pyo *.egg-info .cache/ .coverage .eggs/ .noseids* .pytest_cache docs/build docs/coverage build bin dist eggs htmlcov parts develop-eggs .DS_Store *.swp .tox python-textile-4.0.2/.travis.yml 0000664 0000000 0000000 00000000734 14147205701 0016630 0 ustar 00root root 0000000 0000000 dist: xenial # required for Python >= 3.7 language: python env: - IMAGESIZE=true - IMAGESIZE=false python: - "3.5" - "3.6" - "3.7" - "3.8" - "3.9" # PyPy versions - "pypy3" # command to install dependencies install: - imagesize='' - pip install -U pytest pytest-cov coverage codecov - if [[ $IMAGESIZE == true ]] ; then imagesize='[imagesize]' ; fi - pip install -e ".${imagesize}" # command to run tests script: py.test after_success: - codecov python-textile-4.0.2/CHANGELOG.textile 0000664 0000000 0000000 00000017034 14147205701 0017407 0 ustar 00root root 0000000 0000000 h1. Textile Changelog h2. Version 4.0.2 * Bugfixes: ** Support non-http schemas in url refs ("#75":https://github.com/textile/python-textile/pull/75) ** pytest-runner is deprecated ("#77":https://github.com/textile/python-textile/issues/77) *** other changes related to CI infrastructure h2. Version 4.0.1 * Bugfixes: ** SyntaxWarnings with Python 3.8 i("#71":https://github.com/textile/python-textile/issues/71) ** testsuite: internal error with coverage 5.0.X ("#72":https://github.com/textile/python-textile/issues/72) ** DeprecationWarnings about invalid escape sequences ("#73":https://github.com/textile/python-textile/issues/73) h2. Version 4.0.0 * Drop support for Python 2, hence the version bump. Update list of PY3K versions to currently-supported versions. If you need to use textile on Python 2.7 or Python 3.3 or 3.4, please use textile Version 3.0.4. * For use in PyPy environments, textile used to work well with the regex package. Lately, it's running into trouble. Please uninstall regex if this is the case for you. h2. Version 3.0.4 * BUGFIX: Restricted mode strips out CSS attributes again. * Update travis to more current versions and test against current Pillow version. h2. Version 3.0.3 * BUGFIX: Improve handling code block following extended p block ("#63":https://github.com/textile/python-textile/pull/63) h2. Version 3.0.2 * BUGFIX: Fix for multiple multi-line paragraphs. ("#62":https://github.com/textile/python-textile/pull/62) h2. Version 3.0.1 * BUGFIX: Fix improper handling of extended code blocks. ("#61":https://github.com/textile/python-textile/pull/61) h2. Version 3.0.0 * Drop support for Python 2.6 and 3.2. * Update to the current version of html5lib * Bugfixes: ** Fix handling of HTML entities in extended pre blocks. ("#55":https://github.com/textile/python-textile/issues/55) ** Empty definitions in definition lists raised an exception ("#56":https://github.com/textile/python-textile/issues/56) ** Fix handling of unicode in img attributes ("#58":https://github.com/textile/python-textile/issues/58) h2. Version 2.3.16 * Bugfixes: ** Fix processing of extended code blocks ("#50":https://github.com/textile/python-textile/issues/50) ** Don't break when links fail to include "http:" ("#51":https://github.com/textile/python-textile/issues/51) ** Better handling of poorly-formatted tables ("#52":https://github.com/textile/python-textile/issues/52) h2. Version 2.3.15 * Bugfix: Don't break on unicode characters in the fragment of a url. h2. Version 2.3.14 * Bugfix: Fix textile on Python 2.6 ("#48":https://github.com/textile/python-textile/issues/48) h2. Version 2.3.13 * Remove extraneous arguments from textile method. These were originally added long ago to work with django, but markup languages are long gone from django. * Bugfix: Don't mangle percent-encoded URLs so much. ("#45":https://github.com/textile/python-textile/issues/45) * Bugfix: More fixes for poorly-formatted lists. ("#46":https://github.com/textile/python-textile/issues/46) * Bugfix: Improve handling of whitespace in pre-formatted blocks. This now matches php-textile's handling of pre blocks much more closely. ("#47":https://github.com/textile/python-textile/issues/47) h2. Version 2.3.12 * Bugfix: Don't die on pre blocks with unicode characters. ("#43":https://github.com/textile/python-textile/issues/43) * Bugfix: Fix regressions introduced into the code between 2.2.2 and 2.3.11. (Special thanks to "@adam-iris":https://github.com/adam-iris for providing pull request "#44":https://github.com/textile/python-textile/pull/44) * Bugfix: Don't just die when processing poorly-formatted textile lists. ("#37":https://github.com/textile/python-textile/issues/37) * Add Python 3.6 to testing. * Add a "print the version string and exit" argument to the cli tool: @pytextile -v@ h2. Version 2.3.11 * Bugfix: Don't strip leading dot from image URIs ("#42":https://github.com/textile/python-textile/issues/42) h2. Version 2.3.10 * Packaging: cleanup in MANIFEST.IN leads to better linux packaging, and smaller wheel size. h2. Version 2.3.9 * Packaging: remove extraneous files from the source distribution upload. * Remove a lingering file from a feature branch for overhauling list handling. This brings coverage back up to 100% h2. Version 2.3.8 * Bugfix: Fix process of string containing only whitespaces ("#40":https://github.com/textile/python-textile/issues/40) * Bugfix: Fix process of formatted text after lists ("#37":https://github.com/textile/python-textile/issues/37) * Test: Use sys.executable instead of 'python' to test the CLI ("#38":https://github.com/textile/python-textile/issues/38) h2. Version 2.3.7 * Bugfix: Don't assume pytest is available to be imported in setup.py ("#39":https://github.com/textile/python-textile/issues/39) h2. Version 2.3.6 * Packaging: @tests@ directory is correctly included in source-tarball. ("#33":https://github.com/textile/python-textile/issues/33) h2. Version 2.3.5 * Bugfix: Correctly handle unicode text in url query-strings. ("#36":https://github.com/textile/python-textile/issues/36) h2. Version 2.3.4 * Bugfix: fix an issue with extended block code * Remove misplaced shebang on non-callable files. * Packaging: Add test-command to setup.py directly. * Packaging: Included the tests/ directory for source-tarballs, useful for packaging checks. ("#33":https://github.com/textile/python-textile/issues/33) * Add a cli tool @pytextile@ which takes textile input and prints html output. See @pytextile -h@ for details. h2. Version 2.3.3 * Bugfix: Unicode in URL titles no longer break everything ("#30":https://github.com/textile/python-textile/issues/30) * Display DeprecationWarning when using textile on Python 2.6. h2. Version 2.3.2 * Bugfix: properly handle @":"@ as text, not a link. h2. Version 2.3.1 * Regression bugfix: empty string input returns empty string again. h2. Version 2.3.0 * Bugfixes: ** Support data URIs in img tags ** Fix autolink urls with image references ("#17":https://github.com/textile/python-textile/issues/17) ** Fix textile links containing parentheses ("#20":https://github.com/textile/python-textile/issues/20) ** Fix double-encoding of code blocks ("#21":https://github.com/textile/python-textile/issues/21) ** Fix handling of scheme in self-linked URLs ("#16":https://github.com/textile/python-textile/issues/16) ** Fix Markup not parsed if followed by certain characters ("#22":Markup not parsed if followed by certain characters) * Convert testing over to "py.test":http://pytest.org/, improving unicode testing * Update functionality for tables, notelists, and footnotes. This involved a major reworking of parts of the code, but it should now match php-textile and txstyle.org precisely. Please file an issue for any bugs you come across. * Remove @head_offset@ option from parse. I'm not sure it ever existed in php-textile. h2. Version 2.2.2 * bugfix: "regex":https://pypi.python.org/pypi/regex is now an optional dependency h2. Version 2.2.1 * drop textilefactory support for html. * Various development-related bugfixes. * Added this changelog. h2. Version 2.2.0 * Started refactoring the code to be less repetitive. @textile.Textile().parse()@ is a little more friendly than @textile.Textile().textile()@ There may be more work to be done on this front to make the flow a little smoother. * We now support versions 2.6 - 3.4 (including 3.2) using the same codebase. Many thanks to Radek Czajka for this. * Drop support for html4. We now only output xhtml or html5. * Various development-related bugfixes. h2. Version 2.1.8 * Add support for html5 output. * Lots of new functionality added bringing us in line with the official Textile 2.4 python-textile-4.0.2/CONTRIBUTORS.txt 0000664 0000000 0000000 00000000217 14147205701 0017211 0 ustar 00root root 0000000 0000000 Dennis Burke Radek Czajka Roberto A. F. De Almeida Matt Layman Mark Pilgrim Alex Shiels Jason Samsa Kurt Raschke Dave Brondsema Dmitry Shachnev python-textile-4.0.2/LICENSE.txt 0000664 0000000 0000000 00000002645 14147205701 0016345 0 ustar 00root root 0000000 0000000 L I C E N S E ============= Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name Textile nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. python-textile-4.0.2/MANIFEST.in 0000664 0000000 0000000 00000000066 14147205701 0016253 0 ustar 00root root 0000000 0000000 include MANIFEST.in include tests/fixtures/README.txt python-textile-4.0.2/README.textile 0000664 0000000 0000000 00000003111 14147205701 0017044 0 ustar 00root root 0000000 0000000 !https://travis-ci.org/textile/python-textile.svg!:https://travis-ci.org/textile/python-textile !https://codecov.io/github/textile/python-textile/coverage.svg!:https://codecov.io/github/textile/python-textile !https://img.shields.io/pypi/pyversions/textile! !https://img.shields.io/pypi/wheel/textile! h1. python-textile python-textile is a Python port of "Textile":http://txstyle.org/, Dean Allen's humane web text generator. h2. Installation @pip install textile@ Dependencies: * "html5lib":https://pypi.org/project/html5lib/ * "regex":https://pypi.org/project/regex/ (The regex package causes problems with PyPy, and is not installed as a dependency in such environments. If you are upgrading a textile install on PyPy which had regex previously included, you may need to uninstall it.) Optional dependencies include: * "PIL/Pillow":http://python-pillow.github.io/ (for checking image sizes). If needed, install via @pip install 'textile[imagesize]'@ h2. Usage bc.. import textile >>> s = """ ... _This_ is a *test.* ... ... * One ... * Two ... * Three ... ... Link to "Slashdot":http://slashdot.org/ ... """ >>> html = textile.textile(s) >>> print html
This is a test.
Link to Slashdot
>>> h3. Notes: * Active development supports Python 3.5 or later. h3. Running Tests To run the test suite, use pytest. `pytest-cov` is required as well. When textile is installed locally: bc.. pytest When textile is not installed locally: bc.. PYTHONPATH=. pytest python-textile-4.0.2/TODO.textile 0000664 0000000 0000000 00000000557 14147205701 0016667 0 ustar 00root root 0000000 0000000 TODO * Improve documentation, both of the code and Textile syntax. ** Not all functions have docstrings or adequate docstrings. ** Because the Textile syntax implemented by PyTextile has deviated from the syntax implemented by other implementations of Textile, PyTextile-specific documentation needs to be produced for end-users. * Update to comply with Textile 2.5 python-textile-4.0.2/pytest.ini 0000664 0000000 0000000 00000000154 14147205701 0016544 0 ustar 00root root 0000000 0000000 [pytest] testpaths = tests addopts = --cov=textile --cov-report=html --cov-append --cov-report=term-missing python-textile-4.0.2/setup.py 0000664 0000000 0000000 00000003457 14147205701 0016236 0 ustar 00root root 0000000 0000000 from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import os import sys def get_version(): basedir = os.path.dirname(__file__) with open(os.path.join(basedir, 'textile/version.py')) as f: variables = {} exec(f.read(), variables) return variables.get('VERSION') raise RuntimeError('No version info found.') setup( name='textile', version=get_version(), author='Dennis Burke', author_email='ikirudennis@gmail.com', description='Textile processing for python.', url='http://github.com/textile/python-textile', packages=find_packages(), classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Topic :: Software Development :: Libraries :: Python Modules', ], keywords='textile,text,html markup', install_requires=[ 'html5lib>=1.0.1', 'regex>1.0; implementation_name != "pypy"', ], extras_require={ 'develop': ['pytest', 'pytest-cov'], 'imagesize': ['Pillow>=3.0.0'], }, entry_points={'console_scripts': ['pytextile=textile.__main__:main']}, tests_require=['pytest', 'pytest-cov'], include_package_data=True, zip_safe=False, python_requires='>=3.5', ) python-textile-4.0.2/tests/ 0000775 0000000 0000000 00000000000 14147205701 0015655 5 ustar 00root root 0000000 0000000 python-textile-4.0.2/tests/fixtures/ 0000775 0000000 0000000 00000000000 14147205701 0017526 5 ustar 00root root 0000000 0000000 python-textile-4.0.2/tests/fixtures/README.txt 0000664 0000000 0000000 00000004245 14147205701 0021231 0 ustar 00root root 0000000 0000000python-textile is a Python port of Textile, Dean Allen’s humane web text generator.
pip install textile
Dependencies:
Optional dependencies include:
pip install 'textile[imagesize]'
import textile
>>> s = """
... _This_ is a *test.*
...
... * One
... * Two
... * Three
...
... Link to "Slashdot":http://slashdot.org/
... """
>>> html = textile.textile(s)
>>> print html
<p><em>This</em> is a <strong>test.</strong></p>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
<p>Link to <a href="http://slashdot.org/">Slashdot</a></p>
>>>
To run the test suite, use pytest. `pytest-cov` is required as well.
When textile is installed locally:
pytest
When textile is not installed locally:
PYTHONPATH=. pytest