aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/wscript
blob: c3ead304356a1218cbb72ec728a1a7b567e79243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python
import os

from waflib.extras import autowaf as autowaf
import waflib.Logs as Logs

import literasc

def confgure(conf):
    pass

def bld_book_src(task):
    filenames = []
    for i in task.inputs:
        filenames += [i.abspath()]

    literasc.gen(open(task.outputs[0].abspath(), 'w'), filenames)
    
def build(bld):
    files = [bld.path.find_node('README.txt')]
    for i in bld.path.ant_glob('*', src=False, dir=True):
        files += bld.path.ant_glob('%s/*.txt' % i)
        files += bld.path.ant_glob('%s/manifest.ttl*' % i)
        files += bld.path.ant_glob('%s/*.ttl' % i)
        files += bld.path.ant_glob('%s/*.c' % i)

    # Compile book sources into book.txt asciidoc source
    bld(rule   = bld_book_src,
        source = files,
        target = 'book.txt')

    # Run asciidoc to generate book.html
    stylesdir      = bld.path.find_node('../doc/').abspath()
    pygments_style = bld.path.find_node('../doc/style.css').abspath()
    bld(rule   = 'asciidoc -a stylesdir=%s -a source-highlighter=pygments -a pygments-style=%s -b html -o ${TGT} ${SRC}' % (
        stylesdir, pygments_style),
        source = 'book.txt',
        target = 'book.html')