예제 #1
0
파일: toc.py 프로젝트: AXNY/docs
def make_toc():
    inputs = [i for i in util.expand_tree('./source/includes') if i.startswith('./source/includes/ref-toc-') ]

    for document in inputs:
        document = document[2:]

        base_name = document.rsplit('/', 1)[1].rsplit('.', 1)[0][8:]
        
        m.section_break(document)
        
        table_target = 'source/includes/table-' + base_name + '.rst'
        m.append_var('ref-toc-output', table_target, block=base_name)
        m.target(target=table_target,
                 dependency=[document, 'bin/toc_builder.py'], block=base_name)
        m.job('$(PYTHONBIN) bin/toc_builder.py $< --table $@', block=base_name)
        m.msg('[toc-builder]: built table file for %s' % base_name, block=base_name)

        m.newline()
        toc_target = 'source/includes/toc-' + base_name + '.rst'
        m.append_var('ref-toc-output', toc_target, block=base_name)
        m.target(target=toc_target,
                 dependency=[document, 'bin/toc_builder.py'], block=base_name)
        m.job('$(PYTHONBIN) bin/toc_builder.py $< --contents $@', block=base_name)
        m.msg('[toc-builder]: built toctree file for %s' % base_name, block=base_name)

    m.section_break('meta')
    m.target('.PHONY', ['$(ref-toc-output)', 'ref-toc'], block='meta')
    m.target('ref-toc', '$(ref-toc-output)', block='meta')
    m.target('clean-ref-toc', block='meta')
    m.job('rm -f $(ref-toc-output)', ignore=True)
예제 #2
0
파일: toc.py 프로젝트: rMendozajy/docs
def collect_source_files():
    output = []

    for i in util.expand_tree('./source/includes', 'yaml'):
        if i.startswith('./source/includes/ref-toc-'):
            output.append((i, 'table'))
        if i.startswith('./source/includes/toc-'):
            output.append((i, 'dfn'))

    return output
예제 #3
0
def collect_source_files():
    output = []

    for i in util.expand_tree('./source/includes', 'yaml'):
        if i.startswith('./source/includes/ref-toc-'):
            output.append((i, 'table'))
        if i.startswith('./source/includes/toc-'):
            output.append((i, 'dfn'))

    return output
예제 #4
0
파일: toc.py 프로젝트: trenchmortar/docs
def make_toc():
    inputs = [
        i for i in util.expand_tree('./source/includes')
        if i.startswith('./source/includes/ref-toc-')
    ]

    for document in inputs:
        document = document[2:]

        base_name = document.rsplit('/', 1)[1].rsplit('.', 1)[0][8:]

        m.section_break(document)

        table_target = 'source/includes/table-' + base_name + '.rst'
        m.append_var('ref-toc-output', table_target, block=base_name)
        m.target(target=table_target,
                 dependency=[document, 'bin/toc_builder.py'],
                 block=base_name)
        m.job('$(PYTHONBIN) bin/toc_builder.py $< --table $@', block=base_name)
        m.msg('[toc-builder]: built table file for %s' % base_name,
              block=base_name)

        m.newline()
        toc_target = 'source/includes/toc-' + base_name + '.rst'
        m.append_var('ref-toc-output', toc_target, block=base_name)
        m.target(target=toc_target,
                 dependency=[document, 'bin/toc_builder.py'],
                 block=base_name)
        m.job('$(PYTHONBIN) bin/toc_builder.py $< --contents $@',
              block=base_name)
        m.msg('[toc-builder]: built toctree file for %s' % base_name,
              block=base_name)

    m.section_break('meta')
    m.target('.PHONY', ['clean-ref-toc', 'ref-toc', 'reftoc', 'clean-reftoc'],
             block='meta')
    m.target(['ref-toc', 'reftoc'], '$(ref-toc-output)', block='meta')
    m.target(['clean-ref-toc', 'clean-reftoc'], block='meta')
    m.job('rm -f $(ref-toc-output)', ignore=True)
    m.msg('[toc-builder]: cleaned all ref-toc build products.')