def generate_project_overview(file):
    file.write("## Project Overview\n\n")

    for fn in sorted(glob.glob("projects/*/README.md"),
                     key=lambda fn: (fn.count("."), fn)):
        dirname = os.path.dirname(fn)
        project_name = os.path.basename(dirname)
        file.write(f"### [{project_name}]({os.path.basename(dirname)}/)\n\n")
        with open(fn) as readme:
            files = BlockLexer().parse(readme.read())
            file.write(_find_descr(files) + "\n")
            file.write("\n    flow-clone https://github.com/glotzerlab/"
                       f"signac-examples.git#projects/{project_name}\n\n")
def generate_project_overview(file):
    file.write("## Project Overview\n\n")

    for fn in sorted(glob.glob('projects/*/README.md'),
                     key=lambda fn: (fn.count('.'), fn)):
        dirname = os.path.dirname(fn)
        project_name = os.path.basename(dirname)
        file.write("### [{}]({}/)\n\n".format(project_name,
                                              os.path.basename(dirname)))
        with open(fn) as readme:
            files = BlockLexer().parse(readme.read())
            file.write(_find_descr(files) + '\n')
            file.write(
                '\n    flow-clone https://bitbucket.org/glotzer/signac-examples.git#projects/{}\n\n'
                .format(project_name))
Exemplo n.º 3
0
 def __init__(self, config):
     BlockLexer.__init__(self)
     self._init_shortcodes_compiler(config)
     self._init_shortcodes_lexer()
Exemplo n.º 4
0
def _parse_readme(text):
    blocks = BlockLexer().parse(text)
    return {
        "description": _find_descr(blocks),
        "test_code": "\n".join(_find_test_code(blocks)),
    }
Exemplo n.º 5
0
 def __init__(self, config, *, env=None):
     BlockLexer.__init__(self)
     if env is None:
         env = Environment
     self._init_shortcodes_compiler(config, env)
     self._init_shortcodes_lexer()
Exemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     BlockLexer.__init__(self, *args, **kwargs)
     self.enable_math()