Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/tools/build/v2/tools/docutils.jam @ 12

Last change on this file since 12 was 12, checked in by landauf, 18 years ago

added boost

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1# Copyright David Abrahams 2004. Distributed under the Boost
2# Software License, Version 1.0. (See accompanying
3# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5# Support for docutils ReStructuredText processing.
6
7import type ;
8import scanner ;
9import generators ;
10import os ;
11import common ;
12import toolset ;
13import path ;
14import feature : feature ;
15
16.initialized = ;
17
18type.register ReST : rst ;
19
20class rst-scanner : common-scanner
21{
22    rule pattern ( )
23    {
24         return "^\\w*\\.\\.\\w+include::\w+(.*)"
25        "^\\w*\\.\\.\\w+image::\w+(.*)"
26        "^\\w*\\.\\.\\w+figure::\w+(.*)"
27        ;
28    }
29}
30
31scanner.register rst-scanner : include ;
32type.set-scanner ReST : rst-scanner ;
33
34generators.register-standard docutils.html : ReST : HTML ;
35
36rule init ( docutils-dir )
37{
38    docutils-dir ?= [ modules.peek : DOCUTILS_DIR ] ;
39
40    if ! $(.initialized)
41    {
42        .initialized = true ;
43        .docutils-dir = $(docutils-dir) ;
44       
45        .setup = [
46          common.prepend-path-variable-command PYTHONPATH
47            : $(.docutils-dir) $(.docutils-dir)/extras ] ;
48    }
49}
50
51rule html ( target : source : properties *  )
52{
53    docutils-dir on $(target) = $(.docutils-dir) ;
54}
55
56
57feature docutils : : free ;
58feature docutils-html : : free ;
59toolset.flags docutils COMMON-FLAGS : <docutils> ;
60toolset.flags docutils HTML-FLAGS : <docutils-html> ;
61 
62actions html
63{
64    $(.setup)
65    python $(docutils-dir)/tools/rst2html.py $(COMMON-FLAGS) $(HTML-FLAGS) $(>) $(<)
66}
67
Note: See TracBrowser for help on using the repository browser.