source: anuga_core/documentation/user_manual/update_anuga_user_manual.py @ 4785

Last change on this file since 4785 was 4785, checked in by ole, 16 years ago

Added build placeholder to Release info in user guide

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/usr/bin/env python
2
3"""Update, compile and create PDF and HTML from LaTeX file
4
5Usage:
6    python update_anuga_user_manual.py <options>
7   
8Options:
9    --no_html: Skip automatic generation of html version
10   
11
12
13This script can for example be run from a cronjob:
14
15  crontab -e
16
17with content
18
19SHELL=/bin/sh
20PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:~/bin
21
22# m h dom mon dow command
23  42 *  *   *   *  ~/inundation/anuga_core/documentation/user_manual/update_anuga_user_manual.py > ~/inundation/anuga_core/documentation/user_manual/update_anuga.log
24#
25
26
27Note UNIX only
28 
29"""
30
31from os import system, chdir
32from os.path import expanduser
33from anuga.abstract_2d_finite_volumes.util import get_revision_number
34from sys import argv
35
36
37anugapath = expanduser('~/inundation/anuga_core/documentation/user_manual')
38texfiles = ['anuga_user_manual', 'anuga_installation_guide']
39
40chdir(anugapath) # Move to location of LaTeX files
41system('svn update') # Update from svn
42
43
44do_html = True       
45if len(argv) > 1:
46    if argv[1] == '--no_html':
47        do_html = False
48    else:
49        msg = 'Unknown option: %s' %argv[1]
50        raise Exception(msg)
51   
52for texfile in texfiles:
53    print 'Processing %s' %texfile
54    # Compile with LaTeX, makeindex etc
55    for i in range(3):
56        #system('latex --interaction=nonstopmode %s.tex' %texfile)
57        system('pdflatex --interaction=nonstopmode %s.tex' %texfile)
58        system('makeindex %s.idx' %texfile)
59        system('makeindex mod%s.idx' %texfile)
60        system('bibtex %s' %texfile)   
61
62    # Create pdf file
63    #system('dvips %s -o %s.ps' %((texfile,)*2))   
64    #system('ps2pdf %s.ps' %texfile)   
65     
66    # Create html pages
67    if do_html is True:
68        system('latex2html %s' %texfile)
69    else:
70        print 'Skipping html version for %s as requested' %texfile
71
Note: See TracBrowser for help on using the repository browser.