Changeset 1047 for trunk/buildscripts
- Timestamp:
- 05/09/2006 07:11:38 AM (3 years ago)
- Location:
- trunk/buildscripts/texbuilder
- Files:
-
- 2 modified
- 1 copied
-
build.php (modified) (5 diffs)
-
create_index.php (copied) (copied from branches/3.0/buildscripts/texbuilder/create_index.php)
-
prado3_quick_start.tex (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/texbuilder/build.php
r972 r1047 10 10 //page root location 11 11 $base = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/pages/'); 12 13 //search index data directory 14 $index_dir = realpath(dirname(__FILE__).'/../../demos/quickstart/protected/index/data/'); 15 12 16 13 17 //list page into chapters … … 95 99 'Advanced/Performance.page'); 96 100 101 $pages['Client-side Scripting'] = array( 102 'Advanced/Scripts.page', 103 'Advanced/Scripts1.page', 104 'Advanced/Scripts2.page', 105 'Advanced/Scripts3.page'); 97 106 98 107 //-------------- END CONFIG ------------------ … … 274 283 } 275 284 285 286 function set_header_id($content, $count) 287 { 288 global $header_count; 289 $header_count = $count*100; 290 $content = preg_replace_callback('/<h1>/', "h1", $content); 291 $content = preg_replace_callback('/<h2>/', "h2", $content); 292 $content = preg_replace_callback('/<h3>/', "h3", $content); 293 return $content; 294 } 295 296 function h1($matches) 297 { 298 global $header_count; 299 return "<h1 id=\"".(++$header_count)."\">"; 300 } 301 302 function h2($matches) 303 { 304 global $header_count; 305 return "<h2 id=\"".(++$header_count)."\">"; 306 } 307 308 function h3($matches) 309 { 310 global $header_count; 311 return "<h3 id=\"".(++$header_count)."\">"; 312 } 313 314 $header_count = 0; 315 276 316 //--------------- BEGIN PROCESSING ------------------- 317 318 319 //--------------- Indexer ------------------- 320 321 require_once('create_index.php'); 322 $indexer = new quickstart_index($index_dir); 277 323 278 324 // ---------------- Create the Tex files --------- 279 325 $count = 1; 326 $j = 1; 280 327 $current_path = ''; 281 328 echo "Compiling .page files to Latex files\n\n"; 329 282 330 foreach($pages as $chapter => $sections) 283 331 { … … 290 338 $page = $base.'/'.$section; 291 339 $current_path = $page; 340 341 //add id to <h1>, <h2>, <3> 342 $content = set_header_id(file_get_contents($page),$j++); 343 file_put_contents($page, $content); 344 292 345 $content .= get_section_label($section); 293 $content .= parse_html($page,file_get_contents($page)); 346 $file_content = file_get_contents($page); 347 $tex = parse_html($page,$file_content); 348 $content .= $tex; 349 $indexer->add($file_content,$section, filemtime($page)); 294 350 } 295 351 … … 300 356 } 301 357 358 $indexer->commit(); 302 359 303 360 if($argc <= 1 && $count > 1) -
trunk/buildscripts/texbuilder/prado3_quick_start.tex
r844 r1047 115 115 \include{ch8} 116 116 \include{ch9} 117 \include{ch10} 118 \include{ch11} 119 \include{ch12} 120 \include{ch13} 117 121 118 122 \end{document}
