# Path: momo/utils.py
# MIN_PAGE_LINES = 50
# PY3 = sys.version_info[0] == 3
# def eval_path(path):
# def smart_print(*args, **kwargs):
# def utf8_decode(s):
# def utf8_encode(s):
# def run_cmd(cmd_str=None, cmd=None, cmd_args=None, stdout=sys.stdout,
#             stderr=sys.stderr, stdin=None):
# def open_default(path):
# def mkdir_p(path):
# def page_lines(lines):
# 
# Path: momo/plugins/base.py
# class Plugin(object):
#     def __init__(self):
#         self.settings = settings
# 
#     def setup(self):
#         """Initializae the plugin"""
#         raise NotImplementedError
# 
#     def run(self, extra_args=None):
#         """Run the plugin
# 
#         :param extra_args: a list of command-line arguments to pass to the
#             underlying plugin.
#         """
#         raise NotImplementedError


import os
import shutil
import yaml
import glob
from momo.utils import run_cmd, mkdir_p, utf8_encode, txt_type, eval_path
from momo.plugins.base import Plugin
        self.site_dir = os.path.join(self.mkdocs_dir, 'site')
        if os.path.exists(self.docs_dir):
            shutil.rmtree(self.docs_dir)
        mkdir_p(self.docs_dir)
        mkdir_p(self.site_dir)
        assets = glob.glob(os.path.join(self.mkdocs_dir, '*'))
        for asset in assets:
            filename = os.path.basename(asset)
            if filename not in set(['docs', 'site', 'mkdocs.yml']):
                os.symlink(asset, os.path.join(self.docs_dir, filename))

        self.root.name = self.momo_configs['momo_root_name']

    def _get_pages(self, root, level=0):
        if level == self.momo_configs['momo_page_level']:
            filename = self._make_page(root)
            return filename
        else:
            pages = [
                {'Index': self._make_index_page(root, level + 1)}
            ]
            pages += [
                {elem.name: self._get_pages(elem, level + 1)}
                for elem in root.node_svals
            ]
            return pages

    def _get_docs(self):
        if self.momo_configs['momo_docs_dir'] is None:
            return []

# Path: momo/utils.py
# MIN_PAGE_LINES = 50
# PY3 = sys.version_info[0] == 3
# def eval_path(path):
# def smart_print(*args, **kwargs):
# def utf8_decode(s):
# def utf8_encode(s):
# def run_cmd(cmd_str=None, cmd=None, cmd_args=None, stdout=sys.stdout,
#             stderr=sys.stderr, stdin=None):
# def open_default(path):
# def mkdir_p(path):
# def page_lines(lines):
# 
# Path: momo/plugins/base.py
# class Plugin(object):
#     def __init__(self):
#         self.settings = settings
# 
#     def setup(self):
#         """Initializae the plugin"""
#         raise NotImplementedError
# 
#     def run(self, extra_args=None):
#         """Run the plugin
# 
#         :param extra_args: a list of command-line arguments to pass to the
#             underlying plugin.
#         """
#         raise NotImplementedError


# Path: momo/plugins/mkdocs.py
import os
import shutil
import yaml
import glob
from momo.utils import run_cmd, mkdir_p, utf8_encode, txt_type, eval_path
from momo.plugins.base import Plugin

        self.site_dir = os.path.join(self.mkdocs_dir, 'site')
        if os.path.exists(self.docs_dir):
            shutil.rmtree(self.docs_dir)
        mkdir_p(self.docs_dir)
        mkdir_p(self.site_dir)
        assets = glob.glob(os.path.join(self.mkdocs_dir, '*'))
        for asset in assets:
            filename = os.path.basename(asset)
            if filename not in set(['docs', 'site', 'mkdocs.yml']):
                os.symlink(asset, os.path.join(self.docs_dir, filename))

        self.root.name = self.momo_configs['momo_root_name']

    def _get_pages(self, root, level=0):
        if level == self.momo_configs['momo_page_level']:
            filename = self._make_page(root)
            return filename
        else:
            pages = [
                {'Index': self._make_index_page(root, level + 1)}
            ]
            pages += [
                {elem.name: self._get_pages(elem, level + 1)}
                for elem in root.node_svals
            ]
            return pages

    def _get_docs(self):
        if self.momo_configs['momo_docs_dir'] is None:
            return []

        src_momo_docs_dir = eval_path(self.momo_configs['momo_docs_dir'])