` tag for SVG images.
object_image_types = {}
SETTINGS = {
# Cloaking email addresses provides a small amount of additional
# privacy protection for email addresses inside of a chunk of ReST.
"cloak_email_addresses": True,
# Prevent a lone top level heading from being promoted to document
# title, and thus second level headings from being promoted to top
# level.
"doctitle_xform": True,
# Prevent a lone subsection heading from being promoted to section
# title, and thus second level headings from being promoted to top
# level.
"sectsubtitle_xform": True,
# Set our initial header level
"initial_header_level": 2,
# Prevent local files from being included into the rendered output.
# This is a security concern because people can insert files
# that are part of the system, such as /etc/passwd.
"file_insertion_enabled": False,
# Halt rendering and throw an exception if there was any errors or
# warnings from docutils.
"halt_level": 2,
# Output math blocks as LaTeX that can be interpreted by MathJax for
# a prettier display of Math formulas.
"math_output": "MathJax",
# Disable raw html as enabling it is a security risk, we do not want
# people to be able to include any old HTML in the final output.
"raw_enabled": False,
# Disable all system messages from being reported.
"report_level": 5,
# Use typographic quotes, and transform --, ---, and ... into their
# typographic counterparts.
"smart_quotes": True,
# Strip all comments from the rendered output.
"strip_comments": True,
# Use the short form of syntax highlighting so that the generated
# Pygments CSS can be used to style the output.
"syntax_highlight": "short",
}
def render(raw, stream=None, **kwargs):
if stream is None:
# Use a io.StringIO as the warning stream to prevent warnings from
# being printed to sys.stderr.
stream = io.StringIO()
settings = SETTINGS.copy()
settings["warning_stream"] = stream
writer = Writer()
writer.translator_class = ReadMeHTMLTranslator
try:
parts = publish_parts(raw, writer=writer, settings_overrides=settings)
except SystemMessage:
rendered = None
else:
rendered = parts.get("docinfo", "") + parts.get("fragment", "")
if rendered:
return clean(rendered)
else:
return None
readme_renderer-24.0/readme_renderer/txt.py 0000644 2200500 0257523 00000001736 13365117747 024420 0 ustar dustiningram primarygroup 0000000 0000000 # Copyright 2015 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function
import sys
from .clean import clean
if sys.version_info >= (3,):
from html import escape as html_escape
else:
from cgi import escape
def html_escape(s):
return escape(s, quote=True).replace("'", ''')
def render(raw, **kwargs):
rendered = html_escape(raw).replace("\n", " ")
return clean(rendered, tags=["br"])
readme_renderer-24.0/readme_renderer.egg-info/ 0000755 2200500 0257523 00000000000 13365121720 024674 5 ustar dustiningram primarygroup 0000000 0000000 readme_renderer-24.0/readme_renderer.egg-info/PKG-INFO 0000644 2200500 0257523 00000004543 13365121720 025777 0 ustar dustiningram primarygroup 0000000 0000000 Metadata-Version: 2.1
Name: readme-renderer
Version: 24.0
Summary: readme_renderer is a library for rendering "readme" descriptions for Warehouse
Home-page: https://github.com/pypa/readme_renderer
Author: The Python Packaging Authority
Author-email: admin@mail.pypi.org
License: Apache License, Version 2.0
Description: Readme Renderer
===============
Readme Renderer is a library that will safely render arbitrary
``README`` files into HTML. It is designed to be used in Warehouse_ to
render the ``long_description`` for packages. It can handle Markdown,
reStructuredText (``.rst``), and plain text.
.. _Warehouse: https://github.com/pypa/warehouse
Check Description Locally
-------------------------
To locally check whether your long descriptions will render on PyPI, first
build your distributions, and then use the |twine check|_ command.
Code of Conduct
---------------
Everyone interacting in the readme_renderer project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.
.. |twine check| replace:: ``twine check``
.. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Provides-Extra: md
readme_renderer-24.0/readme_renderer.egg-info/SOURCES.txt 0000644 2200500 0257523 00000010662 13365121720 026565 0 ustar dustiningram primarygroup 0000000 0000000 .coveragerc
CHANGES.rst
LICENSE
MANIFEST.in
README.rst
pytest.ini
setup.cfg
setup.py
tox.ini
readme_renderer/__about__.py
readme_renderer/__init__.py
readme_renderer/__main__.py
readme_renderer/clean.py
readme_renderer/markdown.py
readme_renderer/rst.py
readme_renderer/txt.py
readme_renderer.egg-info/PKG-INFO
readme_renderer.egg-info/SOURCES.txt
readme_renderer.egg-info/dependency_links.txt
readme_renderer.egg-info/entry_points.txt
readme_renderer.egg-info/requires.txt
readme_renderer.egg-info/top_level.txt
readme_renderer/integration/__init__.py
readme_renderer/integration/distutils.py
tests/__init__.py
tests/test_clean.py
tests/test_integration_distutils.py
tests/test_markdown.py
tests/test_noextra.py
tests/test_rst.py
tests/test_txt.py
tests/fixtures/test_CommonMark_001.html
tests/fixtures/test_CommonMark_001.md
tests/fixtures/test_CommonMark_002.html
tests/fixtures/test_CommonMark_002.md
tests/fixtures/test_CommonMark_003.html
tests/fixtures/test_CommonMark_003.md
tests/fixtures/test_CommonMark_004.html
tests/fixtures/test_CommonMark_004.md
tests/fixtures/test_CommonMark_005.html
tests/fixtures/test_CommonMark_005.md
tests/fixtures/test_CommonMark_006.html
tests/fixtures/test_CommonMark_006.md
tests/fixtures/test_CommonMark_007.html
tests/fixtures/test_CommonMark_007.md
tests/fixtures/test_CommonMark_008.html
tests/fixtures/test_CommonMark_008.md
tests/fixtures/test_CommonMark_009.html
tests/fixtures/test_CommonMark_009.md
tests/fixtures/test_CommonMark_smart_strong.html
tests/fixtures/test_CommonMark_smart_strong.md
tests/fixtures/test_CommonMark_style.html
tests/fixtures/test_CommonMark_style.md
tests/fixtures/test_GFM_001.html
tests/fixtures/test_GFM_001.md
tests/fixtures/test_GFM_002.html
tests/fixtures/test_GFM_002.md
tests/fixtures/test_GFM_003.html
tests/fixtures/test_GFM_003.md
tests/fixtures/test_GFM_004.html
tests/fixtures/test_GFM_004.md
tests/fixtures/test_GFM_005.html
tests/fixtures/test_GFM_005.md
tests/fixtures/test_GFM_006.html
tests/fixtures/test_GFM_006.md
tests/fixtures/test_GFM_007.html
tests/fixtures/test_GFM_007.md
tests/fixtures/test_GFM_008.html
tests/fixtures/test_GFM_008.md
tests/fixtures/test_GFM_009.html
tests/fixtures/test_GFM_009.md
tests/fixtures/test_GFM_010.html
tests/fixtures/test_GFM_010.md
tests/fixtures/test_GFM_011.html
tests/fixtures/test_GFM_011.md
tests/fixtures/test_GFM_012.html
tests/fixtures/test_GFM_012.md
tests/fixtures/test_GFM_013.html
tests/fixtures/test_GFM_013.md
tests/fixtures/test_GFM_014.html
tests/fixtures/test_GFM_014.md
tests/fixtures/test_GFM_015.html
tests/fixtures/test_GFM_015.md
tests/fixtures/test_GFM_016.html
tests/fixtures/test_GFM_016.md
tests/fixtures/test_GFM_017.html
tests/fixtures/test_GFM_017.md
tests/fixtures/test_GFM_018.html
tests/fixtures/test_GFM_018.md
tests/fixtures/test_GFM_019.html
tests/fixtures/test_GFM_019.md
tests/fixtures/test_GFM_020.html
tests/fixtures/test_GFM_020.md
tests/fixtures/test_GFM_021.html
tests/fixtures/test_GFM_021.md
tests/fixtures/test_GFM_022.html
tests/fixtures/test_GFM_022.md
tests/fixtures/test_GFM_023.html
tests/fixtures/test_GFM_023.md
tests/fixtures/test_GFM_doublequotes.html
tests/fixtures/test_GFM_doublequotes.md
tests/fixtures/test_GFM_highlight.html
tests/fixtures/test_GFM_highlight.md
tests/fixtures/test_GFM_highlight_default_py.html
tests/fixtures/test_GFM_highlight_default_py.md
tests/fixtures/test_GFM_img.html
tests/fixtures/test_GFM_img.md
tests/fixtures/test_GFM_malicious_pre.html
tests/fixtures/test_GFM_malicious_pre.md
tests/fixtures/test_GFM_style.html
tests/fixtures/test_GFM_style.md
tests/fixtures/test_rst_003.html
tests/fixtures/test_rst_003.rst
tests/fixtures/test_rst_004.html
tests/fixtures/test_rst_004.rst
tests/fixtures/test_rst_005.html
tests/fixtures/test_rst_005.rst
tests/fixtures/test_rst_006.html
tests/fixtures/test_rst_006.rst
tests/fixtures/test_rst_007.html
tests/fixtures/test_rst_007.rst
tests/fixtures/test_rst_008.html
tests/fixtures/test_rst_008.rst
tests/fixtures/test_rst_caption.html
tests/fixtures/test_rst_caption.rst
tests/fixtures/test_rst_docinfo.html
tests/fixtures/test_rst_docinfo.rst
tests/fixtures/test_rst_linkify.html
tests/fixtures/test_rst_linkify.rst
tests/fixtures/test_rst_png.html
tests/fixtures/test_rst_png.rst
tests/fixtures/test_rst_png_attrs.html
tests/fixtures/test_rst_png_attrs.rst
tests/fixtures/test_rst_svg.html
tests/fixtures/test_rst_svg.rst
tests/fixtures/test_rst_svg_attrs.html
tests/fixtures/test_rst_svg_attrs.rst
tests/fixtures/test_txt_001.html
tests/fixtures/test_txt_001.txt readme_renderer-24.0/readme_renderer.egg-info/dependency_links.txt 0000644 2200500 0257523 00000000001 13365121720 030742 0 ustar dustiningram primarygroup 0000000 0000000
readme_renderer-24.0/readme_renderer.egg-info/entry_points.txt 0000644 2200500 0257523 00000000112 13365121720 030164 0 ustar dustiningram primarygroup 0000000 0000000 [distutils.commands]
check = readme_renderer.integration.distutils:Check
readme_renderer-24.0/readme_renderer.egg-info/requires.txt 0000644 2200500 0257523 00000000102 13365121720 027265 0 ustar dustiningram primarygroup 0000000 0000000 bleach>=2.1.0
docutils>=0.13.1
Pygments
six
[md]
cmarkgfm>=0.2.0
readme_renderer-24.0/readme_renderer.egg-info/top_level.txt 0000644 2200500 0257523 00000000020 13365121720 027416 0 ustar dustiningram primarygroup 0000000 0000000 readme_renderer
readme_renderer-24.0/setup.cfg 0000644 2200500 0257523 00000000146 13365121720 021701 0 ustar dustiningram primarygroup 0000000 0000000 [bdist_wheel]
universal = 1
[metadata]
license_file = LICENSE
[egg_info]
tag_build =
tag_date = 0
readme_renderer-24.0/setup.py 0000644 2200500 0257523 00000004633 13365117747 021615 0 ustar dustiningram primarygroup 0000000 0000000 # Copyright 2014 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function
import os
import setuptools
base_dir = os.path.dirname(__file__)
with open(os.path.join(base_dir, "readme_renderer", "__about__.py")) as f:
about = {}
exec(f.read(), about)
with open(os.path.join(base_dir, "README.rst")) as f:
long_description = f.read()
setuptools.setup(
name=about["__title__"],
version=about["__version__"],
description=about["__summary__"],
long_description=long_description,
license=about["__license__"],
url=about["__uri__"],
author=about["__author__"],
author_email=about["__email__"],
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
install_requires=[
"bleach>=2.1.0",
"docutils>=0.13.1",
"Pygments",
"six",
],
entry_points={
"distutils.commands": [
"check = readme_renderer.integration.distutils:Check",
],
},
extras_require={
"md": "cmarkgfm>=0.2.0",
},
packages=setuptools.find_packages(exclude=["tests", "tests.*"]),
)
readme_renderer-24.0/tests/ 0000755 2200500 0257523 00000000000 13365121720 021221 5 ustar dustiningram primarygroup 0000000 0000000 readme_renderer-24.0/tests/__init__.py 0000644 2200500 0257523 00000000000 13327731113 023321 0 ustar dustiningram primarygroup 0000000 0000000 readme_renderer-24.0/tests/fixtures/ 0000755 2200500 0257523 00000000000 13365121720 023072 5 ustar dustiningram primarygroup 0000000 0000000 readme_renderer-24.0/tests/fixtures/test_CommonMark_001.html 0000644 2200500 0257523 00000000015 13327731113 027437 0 ustar dustiningram primarygroup 0000000 0000000 Hello
readme_renderer-24.0/tests/fixtures/test_CommonMark_001.md 0000644 2200500 0257523 00000000006 13327731113 027073 0 ustar dustiningram primarygroup 0000000 0000000 Hello
readme_renderer-24.0/tests/fixtures/test_CommonMark_002.html 0000644 2200500 0257523 00000000043 13327731113 027441 0 ustar dustiningram primarygroup 0000000 0000000 http://mymalicioussite.com/
readme_renderer-24.0/tests/fixtures/test_CommonMark_002.md 0000644 2200500 0257523 00000000034 13327731113 027075 0 ustar dustiningram primarygroup 0000000 0000000 http://mymalicioussite.com/
readme_renderer-24.0/tests/fixtures/test_CommonMark_003.html 0000644 2200500 0257523 00000000242 13327731113 027443 0 ustar dustiningram primarygroup 0000000 0000000 Required packages
To run the PyPI software, you need Python 2.5+ and PostgreSQL
Quick development setup
Make sure you are sitting
readme_renderer-24.0/tests/fixtures/test_CommonMark_003.md 0000644 2200500 0257523 00000000212 13327731113 027074 0 ustar dustiningram primarygroup 0000000 0000000 ## Required packages
To run the PyPI software, you need Python 2.5+ and PostgreSQL
## Quick development setup
Make sure you are sitting
readme_renderer-24.0/tests/fixtures/test_CommonMark_004.html 0000644 2200500 0257523 00000000242 13327731113 027444 0 ustar dustiningram primarygroup 0000000 0000000 Required packages
To run the PyPI software, you need Python 2.5+ and PostgreSQL
Quick development setup
Make sure you are sitting
readme_renderer-24.0/tests/fixtures/test_CommonMark_004.md 0000644 2200500 0257523 00000000241 13327731113 027077 0 ustar dustiningram primarygroup 0000000 0000000 Required packages
To run the PyPI software, you need Python 2.5+ and PostgreSQL
Quick development setup
Make sure you are sitting