blob: 6b50f9cb903b71aec4e3ea2e3744f77b52830202 (
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
#!/bin/bash
# This file is part of RTSAdmin Community Edition.
# Copyright (c) 2011 by RisingTide Systems LLC
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, version 3 (AGPLv3).
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
path=$PWD
rm -rf doc &>/dev/null
mkdir doc
cp README COPYING doc/
cp rtsadmin-doc/rtslogo.* doc/
CSS=../rtsadmin-doc/html4css1.css
#CSS=../rtsadmin-doc/voidspace.css
RSTTITLE="rtsadmin_reference"
TITLE=$RSTTITLE
#MARK="% generated by Docutils"
MARK="\documentclass.*"
./bin/gendoc.py > doc/$TITLE.rst
cd doc
rst2html $TITLE.rst --stylesheet-path $CSS --embed-stylesheet --no-xml-declaration $TITLE.html
cat $TITLE.rst | grep -v ".. sectnum::" | grep -v "header::" > $TITLE.rst2
mv $TITLE.rst2 $TITLE.rst
rst2latex $RSTTITLE.rst --toc-entry-backlinks --compound-enumerators --use-verbatim-when-possible --use-latex-toc --section-numbering --documentclass article --documentoptions "10pt,a4paper" --use-latex-toc --use-latex-docinfo --hyperlink-color black $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{fancyhdr}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{lastpage}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{color}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{titlesec}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\pagestyle{fancy}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\definecolor{rtsblue}{RGB}{79,130,189}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\rhead{\\\includegraphics[height=13pt]{rtslogo.eps}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\chead{}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\lhead{\\\leftmark}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\cfoot{}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\lfoot{Copyright \\\copyright2009-2010 by RisingTide Systems LLC}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\rfoot{Page \\\thepage\\\ of\\\ \\\pageref{LastPage}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrulewidth}{0.4pt}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrulewidth}{0.4pt}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\chapter}\[display\]{\\\color{rtsblue}\\\normalfont\\\huge\\\bfseries}{\\\chaptertitlename\\\thechapter}{20pt}{\\\Huge}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\section}{\\\color{rtsblue}\\\normalfont\\\Large\\\bfseries}{\\\thesection}{1em}{}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\subsection}{\\\color{rtsblue}\\\normalfont\\\large\\\bfseries}{\\\thesubsection}{1em}{}/g" $TITLE.tex
# once for generating the formatting
latex $TITLE.tex $TITLE.dvi
# once more for the TOC
latex $TITLE.tex $TITLE.dvi
# And now get the labels right
latex $TITLE.tex $TITLE.dvi
dvipdf $TITLE.dvi $TITLE.pdf
TITLE="rtsadmin_reference_for_print"
rst2latex $RSTTITLE.rst --toc-entry-backlinks --compound-enumerators --use-verbatim-when-possible --use-latex-toc --section-numbering --documentclass book --documentoptions "10pt,a4paper" --use-latex-toc --use-latex-docinfo --hyperlink-color black $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{fancyhdr}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{lastpage}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{color}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\usepackage{titlesec}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\definecolor{rtsblue}{RGB}{79,130,189}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\pagestyle{fancy}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\rhead{\\\includegraphics[height=13pt]{rtslogo.eps}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\chead{}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\lhead{\\\leftmark}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\cfoot{}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\lfoot{Copyright \\\copyright2009-2010 by RisingTide Systems LLC}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\rfoot{Page \\\thepage\\\ of\\\ \\\pageref{LastPage}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrule}{{\\\color{rtsblue}\\\hrule width\\\headwidth height\\\headrulewidth \\\vskip-\\\headrulewidth}}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\headrulewidth}{0.4pt}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\renewcommand{\\\footrulewidth}{0.4pt}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\chapter}\[display\]{\\\color{rtsblue}\\\normalfont\\\huge\\\bfseries}{\\\chaptertitlename\\\thechapter}{20pt}{\\\Huge}/g" $TITLE.tex
perl -pi -e "s/\($MARK\)/\1\n\\\\titleformat{\\\section}{\\\color{rtsblue}\\\normalfont\\\Large\\\bfseries}{\\\thesection}{1em}{}/g" $TITLE.tex
# once for generating the formatting
latex $TITLE.tex $TITLE.dvi
# once more for the TOC
latex $TITLE.tex $TITLE.dvi
# And now get the labels right
latex $TITLE.tex $TITLE.dvi
dvipdf $TITLE.dvi $TITLE.pdf
cd ..
|