예제 #1
0
파일: Page2Tex.php 프로젝트: Nurudeen/prado
 function setCurrentPage($current)
 {
     self::$header_count = self::$header_count + 1000;
     $this->_current_page = $current;
 }
예제 #2
0
파일: build.php 프로젝트: Nurudeen/prado
// TBD: subsections in Control Reference
$pdflatexExec = "C:/Wei/miktex/texmf/MiKTeX/bin/pdflatex.exe";
$pdfTex = "{$pdflatexExec} -interaction=nonstopmode -max-print-line=120 %s";
$mainTexFile = dirname(__FILE__) . '/sqlmap.tex';
//page root location
$base = realpath(dirname(__FILE__) . '/../../../demos/sqlmap/protected/pages/');
//-------------- END CONFIG ------------------
$pages = (include 'pages.php');
include '../../../../prado-3.0/buildscripts/texbuilder/Page2Tex.php';
// ---------------- Create the Tex files ---------
$count = 1;
$j = 1;
$current_path = '';
echo "Compiling .page files to Latex files\n\n";
$parser = new Page2Tex($base, dirname(__FILE__));
foreach ($pages as $chapter => $sections) {
    $content = '\\chapter{' . $chapter . '}' . $parser->get_chapter_label($chapter);
    echo "Creating ch{$count}.txt => Chapter {$count}: {$chapter}\n";
    echo str_repeat('-', 60) . "\n";
    foreach ($sections as $section) {
        echo "    Adding {$section}\n";
        $page = $base . '/' . $section;
        $current_path = $page;
        $parser->setCurrentPage($current_path);
        //add id to <h1>, <h2>, <3>
        $tmp_content = $parser->set_header_id(file_get_contents($page), $j++);
        //		file_put_contents($page, $tmp_content);
        $content .= $parser->get_section_label($section);
        $file_content = file_get_contents($page);
        $tex = $content .= $parser->parse_html($page, $file_content);