# Path: rophako/utils.py
# def render_markdown(body, html_escape=True, extensions=None, blacklist=None):
#     """Render a block of Markdown text.
# 
#     This will default to escaping literal HTML characters. Set
#     `html_escape=False` to trust HTML.
# 
#     * extensions should be a set() of extensions to add.
#     * blacklist should be a set() of extensions to blacklist."""
# 
#     args = dict(
#         lazy_ol=False, # If a numbered list starts at e.g. 4, show the <ol> there
#         extensions=[
#             "fenced_code",  # GitHub style code blocks
#             "tables",       # http://michelf.ca/projects/php-markdown/extra/#table
#             "smart_strong", # Handles double__underscore better.
#             "codehilite",   # Code highlighting with Pygment!
#             "nl2br",        # Line breaks inside a paragraph become <br>
#             "sane_lists",   # Make lists less surprising
#         ],
#         extension_configs={
#             "codehilite": {
#                 "linenums": False,
#             }
#         }
#     )
#     if html_escape:
#         args["safe_mode"] = "escape"
# 
#     # Additional extensions?
#     if extensions is not None:
#         for ext in extensions:
#             args["extensions"].append(ext)
#     if blacklist is not None:
#         for ext in blacklist:
#             args["extensions"].remove(str(ext))
# 
#     return u'<div class="markdown">{}</div>'.format(
#         markdown.markdown(body, **args)
#     )
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


from flask import url_for
from rophako.utils import render_markdown
from rophako.log import logger
import time
import re
import hashlib
import rophako.jsondb as JsonDB
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""Wiki models."""



def render_page(content):
    """Render the Markdown content of a Wiki page, and support inter-page
    linking with [[double braces]].

    For simple links, just use the [[Page Name]]. To have a different link text
    than the page name, use [[Link Text|Page Name]]."""

# Path: rophako/utils.py
# def render_markdown(body, html_escape=True, extensions=None, blacklist=None):
#     """Render a block of Markdown text.
# 
#     This will default to escaping literal HTML characters. Set
#     `html_escape=False` to trust HTML.
# 
#     * extensions should be a set() of extensions to add.
#     * blacklist should be a set() of extensions to blacklist."""
# 
#     args = dict(
#         lazy_ol=False, # If a numbered list starts at e.g. 4, show the <ol> there
#         extensions=[
#             "fenced_code",  # GitHub style code blocks
#             "tables",       # http://michelf.ca/projects/php-markdown/extra/#table
#             "smart_strong", # Handles double__underscore better.
#             "codehilite",   # Code highlighting with Pygment!
#             "nl2br",        # Line breaks inside a paragraph become <br>
#             "sane_lists",   # Make lists less surprising
#         ],
#         extension_configs={
#             "codehilite": {
#                 "linenums": False,
#             }
#         }
#     )
#     if html_escape:
#         args["safe_mode"] = "escape"
# 
#     # Additional extensions?
#     if extensions is not None:
#         for ext in extensions:
#             args["extensions"].append(ext)
#     if blacklist is not None:
#         for ext in blacklist:
#             args["extensions"].remove(str(ext))
# 
#     return u'<div class="markdown">{}</div>'.format(
#         markdown.markdown(body, **args)
#     )
# 
# Path: rophako/log.py
# class LogHandler(logging.Handler):
#     def emit(self, record):


# Path: rophako/model/wiki.py
from flask import url_for
from rophako.utils import render_markdown
from rophako.log import logger
import time
import re
import hashlib
import rophako.jsondb as JsonDB

# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import

"""Wiki models."""



def render_page(content):
    """Render the Markdown content of a Wiki page, and support inter-page
    linking with [[double braces]].

    For simple links, just use the [[Page Name]]. To have a different link text
    than the page name, use [[Link Text|Page Name]]."""

    html = render_markdown(content)