Beispiel #1
0
def test_no_extra(variant):
    with pytest.warns(UserWarning) as warnings:
        assert render('Hello', variant=variant) is None
    assert len(warnings) == 1
    assert warnings[0].message.args[0] == (
        "Markdown renderers are not available. "
        "Install 'readme_render[md]' to enable Markdown rendering."
    )
Beispiel #2
0
def test_no_extra(variant):
    with pytest.warns(UserWarning) as warnings:
        assert render('Hello', variant=variant) is None
    assert len(warnings) == 1
    assert warnings[0].message.args[0] == (
        "Markdown renderers are not available. "
        "Install 'readme_renderer[md]' to enable Markdown rendering."
    )
Beispiel #3
0
def test_md_fixtures(md_filename, html_filename, variant):
    # Get our Markup
    with io.open(md_filename, encoding='utf-8') as f:
        md_markup = f.read()

    # Get our expected
    with io.open(html_filename, encoding="utf-8") as f:
        expected = f.read()

    assert render(md_markup, variant=variant) == expected
Beispiel #4
0
from setuptools import setup, find_packages
from readme_renderer.markdown import render

long_description = ""
with open('README.md', encoding='utf-8') as file:
    long_description = file.read()

setup(
    name='checklist-seo',
    version='0.0.7',
    license='MIT',
    author='RIGAUDIE David',
    url='https://github.com/itarverne/checklist-seo',
    description=
    'The full checklist to provide tools inside Django in order to write right content',
    long_description=render(long_description),
    packages=find_packages(),
    long_description_content_type="text/markdown",
    platforms='any',
    python_requires='>=3.7',
    install_requires=['Django>=3.1,<3.2', 'nltk>=3.5', 'lxml>=4.5.2'],
    include_package_data=True,
    package_data={
        'seo': [
            'static/js/helper.js', 'static/js/seoSidePannel.js',
            'static/images/seo_logo.png', 'static/css/seo.css'
        ]
    },
    test_suite='testing.test_api',
    classifiers=[
        'Development Status :: 4 - Beta', 'Environment :: Web Environment',
Beispiel #5
0
def markdown_value(value):
    """Render to HTML from Markdown."""
    return md_render.render(value)
Beispiel #6
0
def test_missing_variant():
    assert render('Hello', variant="InvalidVariant") is None
Beispiel #7
0
def render_markdown(content):
    # NOTE (fschmidt): We want to return a similar result like the parse_sphinx()
    # function.
    rendered = markdown.render(content)
    return {"html": rendered}
Beispiel #8
0

def readme():
    with open('README.md') as f:
        return f.read()


def get_version():
    with open('VERSION') as f:
        return f.read()


setup(name='pyNakadi',
      version=get_version(),
      description='Python client for Nakadi',
      long_description=markdown.render(readme()),
      long_description_content_type="text/markdown",
      classifiers=[
          'Development Status :: 3 - Alpha',
          'Programming Language :: Python :: 3.6',
          'Intended Audience :: Developers',
          'Programming Language :: Python :: Implementation :: CPython',
          'Topic :: Software Development :: Libraries :: Python Modules'
      ],
      keywords='python client nakadi reader',
      url='https://github.com/eiunkar/pyNakadi',
      author='Ersin Ihsan Unkar',
      author_email='*****@*****.**',
      packages=['pyNakadi'],
      install_requires=[
          'requests'
Beispiel #9
0
import sys

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Renders a .rst or .md README to HTML", )
    parser.add_argument("input",
                        help="Input README file",
                        type=argparse.FileType("r"))
    parser.add_argument(
        "-o",
        "--output",
        help="Output file (default: stdout)",
        type=argparse.FileType("w"),
        default="-",
    )
    args = parser.parse_args()

    if args.input.name.split(".")[-1].lower() == "md":
        # Delay import in case user has not installed with the [md] extra
        from readme_renderer.markdown import render
    elif args.input.name.split(".")[-1].lower() == "txt":
        from readme_renderer.txt import render
    else:
        # Default is rst to preserve backwards compatibility.
        from readme_renderer.rst import render

    rendered = render(args.input.read(), stream=sys.stderr)
    if rendered is None:
        sys.exit(1)
    print(rendered, file=args.output)