# 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
            for node in elem.node_svals:
                this_kwargs = dict(kwargs)  # get a fresh copy for each node
                buf.append('## %s' % (node.name))
                this_lazy_load_size = self._get_this_lazy_load_size(node)
                if this_lazy_load_size is not None:
                    this_kwargs['lazy_load_size'] = this_lazy_load_size
                buf.append(self._make_attrs(node, **this_kwargs))
        else:
            buf.append('### Nodes')
            for node in elem.node_svals:
                if level == self.momo_configs['momo_page_level']:
                    buf.append('- [%s](%s.md)' % (node.name, node.name))
                else:
                    buf.append('- [%s](%s/index.md)' % (node.name, node.name))
        return '\n'.join(buf)

    def _make_mkdocs_yml(self):
        mkdocs_yml = os.path.join(self.mkdocs_dir, 'mkdocs.yml')
        with open(mkdocs_yml, 'w') as f:
            yaml.dump(self.mkdocs_configs, f, default_flow_style=False,
                      allow_unicode=True)

    def _serve(self, args=None):
        os.chdir(self.mkdocs_dir)
        cmd = 'mkdocs'
        cmd_args = []
        if not args:
            cmd_args = ['serve']
        else:
            cmd_args.extend(args)

# 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

            for node in elem.node_svals:
                this_kwargs = dict(kwargs)  # get a fresh copy for each node
                buf.append('## %s' % (node.name))
                this_lazy_load_size = self._get_this_lazy_load_size(node)
                if this_lazy_load_size is not None:
                    this_kwargs['lazy_load_size'] = this_lazy_load_size
                buf.append(self._make_attrs(node, **this_kwargs))
        else:
            buf.append('### Nodes')
            for node in elem.node_svals:
                if level == self.momo_configs['momo_page_level']:
                    buf.append('- [%s](%s.md)' % (node.name, node.name))
                else:
                    buf.append('- [%s](%s/index.md)' % (node.name, node.name))
        return '\n'.join(buf)

    def _make_mkdocs_yml(self):
        mkdocs_yml = os.path.join(self.mkdocs_dir, 'mkdocs.yml')
        with open(mkdocs_yml, 'w') as f:
            yaml.dump(self.mkdocs_configs, f, default_flow_style=False,
                      allow_unicode=True)

    def _serve(self, args=None):
        os.chdir(self.mkdocs_dir)
        cmd = 'mkdocs'
        cmd_args = []
        if not args:
            cmd_args = ['serve']
        else:
            cmd_args.extend(args)

        run_cmd(cmd=cmd, cmd_args=cmd_args)