How to use the markdown2.markdown 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 Splawik / pytigon / pytigon / prj / _schwiki / schwiki / models.py View on Github external
def _get_markdown_object(buf):
    return markdown.markdown("\n".join(buf), extras=['tables', 'codehilite'])
github Wikitude / wikitude-titanium / WikitudeIOSModule / Project / build.py View on Github external
def generate_doc(config):
	docdir = os.path.join(cwd,'documentation')
	if not os.path.exists(docdir):
		print "Couldn't find documentation file at: %s" % docdir
		return None

	try:
		import markdown2 as markdown
	except ImportError:
		import markdown
	documentation = []
	for file in os.listdir(docdir):
		if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)):
			continue
		md = open(os.path.join(docdir,file)).read()
		html = markdown.markdown(md)
		documentation.append({file:html});
	return documentation
github nuno / TiCollectionView / iphone / build.py View on Github external
if not os.path.exists(docdir):
		docdir = os.path.join(cwd,'..','documentation')
	if not os.path.exists(docdir):
		print "Couldn't find documentation file at: %s" % docdir
		return None

	try:
		import markdown2 as markdown
	except ImportError:
		import markdown
	documentation = []
	for file in os.listdir(docdir):
		if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)):
			continue
		md = open(os.path.join(docdir,file)).read()
		html = markdown.markdown(md)
		documentation.append({file:html});
	return documentation
github verybadsoldier / backtrader_plotting / backtrader_plotting / html / metadata.py View on Github external
def get_metadata_div(strategy: bt.Strategy) -> str:
    md = ""

    md += _get_strategy(strategy)
    md += '* * *'
    md += _get_datas(strategy)
    md += '* * *'
    md += _get_observers(strategy)
    md += '* * *'
    md += _get_analyzers(strategy)
    md += '* * *'

    css_classes = {'table': 'metaDataTable'}

    html = markdown2.markdown(md, extras={
        'fenced-code-blocks': None,
        'tables': None,
        'html-classes': css_classes
    })
    return html
github Splawik / pytigon / app_pack / _schwiki / wiki / models.py View on Github external
def _get_markdown_object(buf):
    return markdown.markdown("\n".join(buf), extras=['tables', 'codehilite'])
github KaimingWan / PureBlog / www / handlers.py View on Github external
def get_blog(id):
    # 根据博客id查询该博客信息
    blog = yield from Blog.find(id)
    # 根据博客id查询该条博客的评论
    comments = yield from Comment.findAll('blog_id=?', [id], orderBy='created_at desc')
    # markdown2是个扩展模块,这里把博客正文和评论套入到markdonw2中
    for c in comments:
        c.html_content = text2html(c.content)
    blog.html_content = markdown2.markdown(blog.content)
    # 返回页面
    return {
        '__template__': 'blog.html',
        'blog': blog,
        'comments': comments
    }
github xumingming / yash / yash.py View on Github external
def render_markdown(text):
    return markdown.markdown(
        text,
        extras        = ["tables", "code-friendly", "fenced-code-blocks"]
    )
github appcelerator-modules / ti.moddevguide / ios / build.py View on Github external
if not os.path.exists(docdir):
		print "Couldn't find documentation file at: %s" % docdir
		return None
	sdk = config['TITANIUM_SDK']
	support_dir = os.path.join(sdk,'module','support')
	sys.path.append(support_dir)
	try:
		import markdown2 as markdown
	except ImportError:
		import markdown
	documentation = []
	for file in os.listdir(docdir):
		if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)):
			continue
		md = open(os.path.join(docdir,file)).read()
		html = markdown.markdown(md)
		documentation.append({file:html});
	return documentation
github kcl-ddh / digipal / digipal / views / doc.py View on Github external
ret['title'] = m.group(1)
            # If the doc starts with a main title, we remove it
            # as it will be preserved in the CMS Page title
            # Without this, the title would appear twice on the site.
            md = re.sub(ur'(?usi)^\s*', '', md)
            md = re.sub(ur'(?usi)\s*$', '', md)
            md = re.sub(ur'(?ui)^#\s+[^\n\r]*', '', md)
            break

    # convert the document to HTML
    import markdown2
    from django.utils.safestring import mark_safe

    md = preprocess_markdown(md, request)

    html = markdown2.markdown(md)

    html = postprocess_markdown(html, request)

    ret['content'] = mark_safe(html)

    return ret
github appcelerator / titanium_mobile / iphone / templates / module / default / template / iphone / build.py View on Github external
def generate_doc(config):
	docdir = os.path.join(cwd,'documentation')
	if not os.path.exists(docdir):
		print "Couldn't find documentation file at: %s" % docdir
		return None

	try:
		import markdown2 as markdown
	except ImportError:
		import markdown
	documentation = []
	for file in os.listdir(docdir):
		if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)):
			continue
		md = open(os.path.join(docdir,file)).read()
		html = markdown.markdown(md)
		documentation.append({file:html});
	return documentation