Zine

open source content publishing system


source: scripts/build-documentation @ 1279:088d2f519391

Revision 1279:088d2f519391, 1.1 KB checked in by Georg Brandl <georg@…>, 2 years ago (diff)

Update copyright notices.

  • Property exe set to *
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3"""
4    Build the Documentation
5    ~~~~~~~~~~~~~~~~~~~~~~~
6
7    This command builds the documentation for Zine or a plugin.
8
9    :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details.
10    :license: BSD, see LICENSE for more details.
11"""
12import sys
13from os.path import isdir, join, dirname, pardir, abspath
14from optparse import OptionParser
15
16
17sys.path.append(dirname(__file__))
18import _init_zine
19from zine.docs.builder import walk
20
21
22def main():
23    parser = OptionParser(usage='%prog [options] [path]')
24    options, args = parser.parse_args()
25    if not args:
26        path = join(dirname(__file__), pardir, 'zine', 'docs')
27    elif len(args) == 1:
28        path = join(args[0], 'docs')
29        if not isdir(path):
30            parser.error('source folder missing')
31    else:
32        parser.error('incorrect number of arguments')
33    path = abspath(path)
34    print 'Building docs from', path
35
36    def callback(filename):
37        print filename
38    walk(path, callback)
39    print 'All done.'
40
41
42if __name__ == '__main__':
43    main()
Note: See TracBrowser for help on using the repository browser.