<commit_before>"""
    Markdown to HTML generator
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Copyright: (c) 2014 <NAME>
"""
import os
import sys
import logging
import argparse

import markdown
from bs4 import BeautifulSoup

from mdcli import __version__
# Future features:
# TODO:2014-10-18:einar: implement file watch functionality
# TODO:2014-10-18:einar: implement 'view in browser' functionality

log = logging.getLogger(__name__)

DOC_TEMPLATE = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
{content}
</body>
</html>
"""

DOC_STYLE = """
body { padding: 1em; margin: 0; color #222; }
a { color: #3498db; }
a:hover, a:visited { color: #2980b9; }
.table-wrapper { width: 100%; overflow-x: auto; margin: 1em 0; }
table { width: 900px; border-collapse: collapse; }
table th { text-align: left; border-bottom: 0.125em solid #888; }
table td { border-bottom: 0.063em solid #888; }
table th, table td { padding: 0.4em; }
tbody tr:nth-child(odd) { background-color: #efefef; }
"""

MARKDOWN_EXTENSIONS = [
    'markdown.extensions.extra'  # Includes table support
]


def create_html5_document(content, args, template=DOC_TEMPLATE, style=DOC_STYLE):
    """Creates the complete html5 document."""
    def create_title(filename):
        return os.path.splitext(os.path.basename(filename))[0]

    if args.vanilla:
        soup = BeautifulSoup(content)
    else:
        soup = BeautifulSoup(template.format(content=content))

        # Add document title<commit_msg>make pre tags work better on small screens<commit_after>"""
    Markdown to HTML generator
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Copyright: (c) 2014 <NAME>
"""
import os
import sys
import logging
import argparse

import markdown
from bs4 import BeautifulSoup

from mdcli import __version__
# Future features:
# TODO:2014-10-18:einar: implement file watch functionality
# TODO:2014-10-18:einar: implement 'view in browser' functionality

log = logging.getLogger(__name__)

DOC_TEMPLATE = """<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
{content}
</body>
</html>
"""

DOC_STYLE = """
body { padding: 1em; margin: 0; color #222; }
a { color: #3498db; }
a:hover, a:visited { color: #2980b9; }
.table-wrapper { width: 100%; overflow-x: auto; margin: 1em 0; }
table { width: 900px; border-collapse: collapse; }
table th { text-align: left; border-bottom: 0.125em solid #888; }
table td { border-bottom: 0.063em solid #888; }
table th, table td { padding: 0.4em; }
tbody tr:nth-child(odd) { background-color: #efefef; }
pre { overflow-x: auto; }
"""

MARKDOWN_EXTENSIONS = [
    'markdown.extensions.extra'  # Includes table support
]


def create_html5_document(content, args, template=DOC_TEMPLATE, style=DOC_STYLE):
    """Creates the complete html5 document."""
    def create_title(filename):
        return os.path.splitext(os.path.basename(filename))[0]

    if args.vanilla:
        soup = BeautifulSoup(content)
    else:
        soup = BeautifulSoup(template.format(content=content))

        # Add document title
{'fraction_non_alphanumeric': 0.1499503475670308, 'fraction_numerical': 0.041708043694141016, 'mean_word_length': 4.320422535211268, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3567688', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1001, 'n_words': 279}