How to use the markdown2.markdown_path function in markdown2

To help you get started, we’ve selected a few markdown2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trentm / nodedoc / bin / nodedoc.py View on Github external
def generate_html_path(markdown_path, html_path):
    if not exists(dirname(html_path)):
        os.makedirs(dirname(html_path))
    html = markdown2.markdown_path(markdown_path)
    codecs.open(html_path, 'w', 'utf-8').write(html)
github teampheenix / StarCraft-Casting-Tool / scctool / view / main.py View on Github external
def showAbout(self):
        """Show subwindow with about info."""
        html = markdown2.markdown_path(
            scctool.settings.getResFile("about.md"))

        html = html.replace("%VERSION%", scctool.__version__)
        if(not scctool.__new_version__):
            new_version = _("StarCraft Casting Tool is up to date.")
        else:
            new_version = _("The new version {} is available!").format(
                scctool.__latest_version__)
        html = html.replace('%NEW_VERSION%', new_version)

        # use self as parent here
        QMessageBox.about(
            self, _("StarCraft Casting Tool - About"), html)
github icyphox / vite / vite / make.py View on Github external
def markdown_render(filename):
    html_text = markdown_path(PAGES_PATH + filename)
    return html_text
github gdamdam / iagitup / iagitup / iagitup.py View on Github external
arguments:
                gh_repo_folder -- the repo local folder path

        returns:
                description -- html description
    """
    path = '{}/{}'.format(gh_repo_folder,'README.md')
    path3 = '{}/{}'.format(gh_repo_folder,'readme.md')
    path2 = '{}/{}'.format(gh_repo_folder,'readme.txt')
    description = ''
    if os.path.exists(path):
        description = markdown_path(path)
        description = description.replace('\n','')
    elif os.path.exists(path3):
        description = markdown_path(path3)
        description = description.replace('\n','')
    elif os.path.exists(path2):
        with open(path2,'r') as f:
            description = f.readlines()
            description =' '.join(description)
    return description
github jmaupetit / md2pdf / md2pdf.py View on Github external
def main(argv=None):

    # Parse command line arguments
    arguments = docopt(
        __doc__,
        version='md2pdf %s' % __version__)

    # Paths
    md_file_path = arguments.get('INPUT.MD')
    pdf_file_path = arguments.get('OUTPUT.PDF')
    css_file_path = arguments.get('--css', None)

    # Convert markdown to html
    raw_html = markdown_path(md_file_path)

    # Weasyprint HTML object
    html = HTML(string=raw_html)

    # Get styles
    css = []
    if css_file_path:
        css.append(CSS(filename=css_file_path))

    # Generate PDF
    html.write_pdf(pdf_file_path, stylesheets=css)

    return 1
github beancount / fava / fava / application.py View on Github external
def help_page(page_slug="_index"):
    """Fava's included documentation."""
    if page_slug not in app.config["HELP_PAGES"]:
        abort(404)
    html = markdown2.markdown_path(
        os.path.join(resource_path("help"), page_slug + ".md"),
        extras=["fenced-code-blocks", "tables"],
    )
    return render_template(
        "_layout.html",
        active_page="help",
        page_slug=page_slug,
        help_html=render_template_string(html),
    )