pax_global_header 0000666 0000000 0000000 00000000064 13203371565 0014517 g ustar 00root root 0000000 0000000 52 comment=0ca140f84d77c10a03715aac1c76b9d9f1c8c2db python-textile-3.0.0/ 0000775 0000000 0000000 00000000000 13203371565 0014514 5 ustar 00root root 0000000 0000000 python-textile-3.0.0/.coveragerc 0000664 0000000 0000000 00000000112 13203371565 0016627 0 ustar 00root root 0000000 0000000 [run] branch = True [report] show_missing = True omit = textile/tests/* python-textile-3.0.0/.gitignore 0000664 0000000 0000000 00000000247 13203371565 0016507 0 ustar 00root root 0000000 0000000 *.pyc *.orig *.rej *~ *.pyo *.egg-info .cache/ .coverage .eggs/ .noseids* docs/build docs/coverage build bin dist eggs htmlcov parts develop-eggs .DS_Store *.swp .tox python-textile-3.0.0/.travis.yml 0000664 0000000 0000000 00000001005 13203371565 0016621 0 ustar 00root root 0000000 0000000 language: python env: - REQUIREMENTS=true - REQUIREMENTS=false python: - "2.7" - "3.3" - "3.4" - "3.5" - "3.6" - "pypy-5.4" # command to install dependencies install: - if [[ $REQUIREMENTS == true ]] ; then pip install -r requirements.txt ; fi - pip install coveralls pytest pytest-cov coverage codecov - pip install -e . - if [[ ! $TRAVIS_PYTHON_VERSION == 'pypy-5.4' ]] ; then pip install regex; fi # command to run tests script: py.test sudo: false after_success: - coveralls - codecov python-textile-3.0.0/CHANGELOG.textile 0000664 0000000 0000000 00000013761 13203371565 0017413 0 ustar 00root root 0000000 0000000 h1. Textile Changelog 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-3.0.0/CONTRIBUTORS.txt 0000664 0000000 0000000 00000000160 13203371565 0017207 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 python-textile-3.0.0/LICENSE.txt 0000664 0000000 0000000 00000002645 13203371565 0016346 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-3.0.0/MANIFEST.in 0000664 0000000 0000000 00000000066 13203371565 0016254 0 ustar 00root root 0000000 0000000 include MANIFEST.in include tests/fixtures/README.txt python-textile-3.0.0/README.textile 0000664 0000000 0000000 00000002227 13203371565 0017054 0 ustar 00root root 0000000 0000000 !https://travis-ci.org/textile/python-textile.svg!:https://travis-ci.org/textile/python-textile !https://coveralls.io/repos/github/textile/python-textile/badge.svg!:https://coveralls.io/github/textile/python-textile?branch=master !https://codecov.io/github/textile/python-textile/coverage.svg!:https://codecov.io/github/textile/python-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@ Optional dependencies include: * "PIL/Pillow":http://python-pillow.github.io/ (for checking images size) * "regex":https://pypi.python.org/pypi/regex (for faster unicode-aware string matching). 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 2.7 or later (including Python 3.3+). python-textile-3.0.0/TODO.textile 0000664 0000000 0000000 00000000557 13203371565 0016670 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-3.0.0/pytest.ini 0000664 0000000 0000000 00000000153 13203371565 0016544 0 ustar 00root root 0000000 0000000 [pytest] testpaths = tests addopts = --cov=textile --cov-report=html --cov-append --cov-report=term-missing python-textile-3.0.0/requirements.txt 0000664 0000000 0000000 00000000045 13203371565 0017777 0 ustar 00root root 0000000 0000000 html5lib>=1.0b10 Pillow==3.0.0 regex python-textile-3.0.0/setup.cfg 0000664 0000000 0000000 00000000060 13203371565 0016331 0 ustar 00root root 0000000 0000000 [aliases] test=pytest [bdist_wheel] universal=1 python-textile-3.0.0/setup.py 0000664 0000000 0000000 00000004672 13203371565 0016237 0 ustar 00root root 0000000 0000000 from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand import os import sys class PyTest(TestCommand): user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")] def initialize_options(self): TestCommand.initialize_options(self) self.pytest_args = [] def run_tests(self): import shlex #import here, cause outside the eggs aren't loaded import pytest errno = pytest.main(shlex.split(self.pytest_args)) sys.exit(errno) 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', 'Topic :: Software Development :: Libraries :: Python Modules', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], keywords='textile,text,html markup', install_requires=[ 'six', 'html5lib>=0.999999999', ], extras_require={ ':python_version=="2.6"': ['ordereddict>=1.1'], 'develop': ['pytest', 'pytest-cov'], 'imagesize': ['Pillow>=3.0.0'], 'regex': ['regex'], }, entry_points={'console_scripts': ['pytextile=textile.__main__:main']}, setup_requires=['pytest-runner'], tests_require=['pytest', 'pytest-cov'], cmdclass = {'test': PyTest}, include_package_data=True, zip_safe=False, ) python-textile-3.0.0/tests/ 0000775 0000000 0000000 00000000000 13203371565 0015656 5 ustar 00root root 0000000 0000000 python-textile-3.0.0/tests/fixtures/ 0000775 0000000 0000000 00000000000 13203371565 0017527 5 ustar 00root root 0000000 0000000 python-textile-3.0.0/tests/fixtures/README.txt 0000664 0000000 0000000 00000003212 13203371565 0021223 0 ustar 00root root 0000000 0000000python-textile is a Python port of Textile, Dean Allen’s humane web text generator.
pip install textile
Optional dependencies include:
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>
>>>