00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 from os.path import splitext, join
00020
00021 l2h_init_txt = '''
00022 # This file is automatically generated. Do not edit! #####################
00023
00024 ### Command Line Argument Defaults #######################################
00025 $TRANSPARENT_FIGURES = 0;
00026 $LATEX_COLOR = "\\\pagecolor{white}";
00027 $default_title = '';
00028 $TITLE = $default_title;
00029 $address_data[0] = 'Generated using repro, a Python package for automating reproducible research in scientific computing';
00030 $ADDRESS = "<I>$address_data[0] <BR>\\n$address_data[1]</I>";
00031 ### Other global variables ###############################################
00032 $MATH_SCALE_FACTOR = 1.6;
00033 $FIGURE_SCALE_FACTOR = 1;
00034 $TITLES_LANGUAGE = "english";
00035 $LATEX2HTMLSTYLES = join(':',$LATEX2HTMLSTYLES,$ENV{'LATEX2HTMLSTYLES'});
00036
00037 ### Navigation Panel #####################################################
00038 sub my_navigation_panel {
00039 my $title = $t_title;
00040 $title =~ s/<BR>//g;
00041 '<table align="center" width="100%" cellpadding="0" cellspacing="0">'
00042 . "\\n<tr>"
00043 . "<td class=\\"navigation\\" align=\\"center\\" width=\\"100%\\">"
00044 . "$title</td>"
00045 . "\\n</tr></table>\\n" .
00046 "<BR>\\n" .
00047 ($NEXT_TITLE ? "<B> Next:</B> $NEXT_TITLE\\n" : undef) .
00048 ($UP_TITLE ? "<B>Up:</B> $UP_TITLE\\n" : undef) .
00049 ($PREVIOUS_TITLE ? "<B> Previous:</B> $PREVIOUS_TITLE\\n" : undef)
00050 }
00051
00052 sub top_navigation_panel {
00053 my_navigation_panel() .
00054 "<BR><HR>\\n";
00055 }
00056
00057 sub bot_navigation_panel {
00058 "<HR>\\n" . my_navigation_panel();
00059 }
00060
00061 1;
00062 '''
00063
00064 l2h_style_txt = '''
00065 /* This file is automatically generated. Do not edit! */
00066
00067 .MATH { font-family: "Century Schoolbook", serif; }
00068 .MATH I { font-family: "Century Schoolbook", serif; font-style: italic }
00069 .BOLDMATH { font-family: "Century Schoolbook", serif; font-weight: bold }
00070
00071 SMALL.XTINY { font-size : xx-small }
00072 SMALL.TINY { font-size : x-small }
00073 SMALL.SCRIPTSIZE { font-size : smaller }
00074 SMALL.FOOTNOTESIZE { font-size : small }
00075 SMALL.SMALL { }
00076 BIG.LARGE { }
00077 BIG.XLARGE { font-size : large }
00078 BIG.XXLARGE { font-size : x-large }
00079 BIG.HUGE { font-size : larger }
00080 BIG.XHUGE { font-size : xx-large }
00081
00082 H1 { }
00083 H2 { }
00084 H3 { }
00085 H4 { }
00086 H5 { }
00087
00088 DIV.displaymath { }
00089 TD.eqno { }
00090
00091 body {
00092 color: #000000;
00093 background-color: #ffffff; }
00094
00095 td.navigation { color: #ffffff;
00096 background-color: #3b80ff;
00097 font-weight: bold;
00098 font-family: avantgarde, sans-serif;
00099 font-size: 110%; }
00100
00101 pre {
00102 padding: 7pt;
00103 white-space: pre;
00104 width: 100%;
00105 }
00106
00107 pre.code {
00108 background-color: #eeeeee;
00109 border: thin solid black;
00110 padding: 1em;
00111 margin-left: 2em;
00112 margin-right: 2em; }
00113
00114 div.slab_code_box1 {
00115 border: solid;
00116 border-width: thin;
00117 /* width: 50%;*/
00118 padding: 1.5em;
00119
00120 margin-left: 5%; margin-right: 5%;
00121 background: url(http://www.python.org/images/python-logo.gif) top right no-repeat;
00122
00123 /* margin: 1em;*/
00124 /* padding: 3em;*/
00125
00126 /* font: Impact;*/
00127 }
00128
00129 div.slab_code_box2 {
00130 border: solid;
00131 border-width: thin;
00132 padding: 1.5em;
00133 background: #FFFFCC;
00134 margin-top: 4em;
00135 /* margin: 1em;*/
00136 /* padding: 3em;*/
00137
00138 /* font: Impact;*/
00139 }
00140
00141 .sourcecodebutton
00142 {
00143 width: 32px;
00144 height: 32px;
00145 content: url(../icons/tool.png);
00146 }
00147
00148 .sconsbutton
00149 {
00150 width: 32px;
00151 height: 32px;
00152 content: url(../icons/SCons-Bricks32.png);
00153 margin-left: 1%; margin-right: 1%;
00154 }
00155
00156 .pythonbutton
00157 {
00158 width: 32px;
00159 height: 32px;
00160 margin-left: 1%; margin-right: 1%;
00161 content: url(../icons/python-logo32.gif);
00162 }
00163 .matlabbutton
00164 {
00165 width: 32px;
00166 height: 32px;
00167 margin-left: 1%; margin-right: 1%;
00168 content: url(../icons/matlab_logo32.png);
00169 }
00170
00171
00172 .pdfbutton
00173 {
00174 width: 32px;
00175 height: 32px;
00176 background-position: top;
00177 margin-left: 50%;
00178 background: url(../icons/pdf.png) no-repeat;
00179 }
00180
00181 .pdfbutton:hover
00182 {
00183 background-position: bottom;
00184 }
00185
00186
00187 slab_source_body {
00188 margin-left: 10%; margin-right: 10%;
00189 /* font: Impact;*/
00190 /* color: black; background: white;*/
00191 }
00192
00193 repro_number {
00194 font-weight: bold;
00195 color: #CC0000;
00196 }
00197
00198 repro_op {
00199 color: #0000C0;
00200 }
00201
00202 repro_string {
00203 font-style: italic;
00204 color: green;
00205 }
00206
00207 repro_comment {
00208 color: gray;
00209 }
00210 repro_name
00211 {
00212 color: #000000;
00213 /* font-style: italic;*/
00214 }
00215
00216 repro_error {
00217 color: #FF8080;
00218 }
00219 repro_keyword {
00220 font-weight: bold;
00221 color: blue;
00222 }
00223
00224 repro_text {
00225 color: #000000;
00226 }
00227
00228 '''
00229
00230
00231
00232
00233
00234 def l2hdefault_init(target, source, env):
00235
00236 html_folder = splitext(str(target[0]))[0]
00237 l2h_init_fname = 'l2h_init-'+html_folder
00238 open( l2h_init_fname, 'w').write( l2h_init_txt )
00239
00240 return 0
00241
00242
00243
00244
00245
00246 def l2hdefault_style(target, source, env):
00247 html_folder = splitext(str(target[0]))[0]
00248 fname_base = splitext(str(source[0]))[0]
00249
00250 l2h_style_fname = fname_base+'.css'
00251 open( join(html_folder, l2h_style_fname) , 'w').write( l2h_style_txt )
00252
00253 return 0
00254
00255