From 568a5cea4833a3316f3741dcd32699334f770d26 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 28 Jan 2006 17:09:31 +0000 Subject: Rename "tools" to "buildscripts". --- tools/texbuilder/build.php | 233 --------------------------------------------- 1 file changed, 233 deletions(-) delete mode 100644 tools/texbuilder/build.php (limited to 'tools/texbuilder/build.php') diff --git a/tools/texbuilder/build.php b/tools/texbuilder/build.php deleted file mode 100644 index 1866f868..00000000 --- a/tools/texbuilder/build.php +++ /dev/null @@ -1,233 +0,0 @@ -]*>/', '', $html); - $html = preg_replace('/<\/?p>/m', '', $html); - - //escape { and } - $html = preg_replace('/([^\s]+){([^}]*)}([^\s]+)/', '$1\\\{$2\\\}$3', $html); - - //codes - $html = str_replace('$', '\$', $html); - $html = preg_replace('/]*>/', '`1`', $html); - $html = preg_replace('/<\/com:TTextHighlighter>/', '`2`', $html); - $html = preg_replace_callback('/(`1`)([^`]*)(`2`)/m', 'escape_verbatim', $html); - $html = preg_replace_callback('/(
)([^<]*)(<\/div>)/', 'escape_verbatim', $html); - - $html = preg_replace_callback('/"?[^\\/]*\/>/', 'include_image', $html); - - //runbar - $html = preg_replace('//', - 'Try, \texttt{http://../quickstart/index.php?page=$1}', $html); - - //text modifiers - $html = preg_replace('/([^<]*)<\/b>/', '\textbf{$1}', $html); - $html = preg_replace('/([^<]*)<\/i>/', '\emph{$1}', $html); - $html = preg_replace('/([^<]*)<\/tt>/', '\texttt{$1}', $html); - - //links - $html = preg_replace_callback('/]+href="([^"]*)"[^>]*>([^<]*)<\/a>/', - 'make_link', $html); - //anchor - $html = preg_replace_callback('/]+name="([^"]*)"[^>]*><\/a>/', 'anchor', $html); - - //item lists - $html = preg_replace('/
    /', '\begin{itemize}', $html); - $html = preg_replace('/<\/ol>/', '\end{itemize}', $html); - $html = preg_replace('/
      /', '\begin{enumerate}', $html); - $html = preg_replace('/<\/ul>/', '\end{enumerate}', $html); - $html = preg_replace('/
    • /', '\item ', $html); - $html = preg_replace('/<\/li>/', '', $html); - - //headings - $html = preg_replace('/

      ([^<]+)<\/h1>/', '\section{$1}', $html); - $html = preg_replace('/

      ([^<]+)<\/h2>/', '\subsection{$1}', $html); - $html = preg_replace('/

      ([^<]+)<\/h3>/', '\subsubsection{$1}', $html); - - - - $html = html_entity_decode($html); - - - return $html; -} - -function get_chapter_label($chapter) -{ - return '\hypertarget{'.str_replace(' ', '', $chapter).'}{}'; -} - -function get_section_label($section) -{ - $section = str_replace('.page', '', $section); - return '\hypertarget{'.str_replace('/', '.', $section).'}{}'; -} - -//--------------- BEGIN PROCESSING ------------------- - -$count = 1; -$current_path = ''; -echo "Compiling .page files to Latex files\n\n"; -foreach($pages as $chapter => $sections) -{ - $content = '\chapter{'.$chapter.'}'.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; - $content .= get_section_label($section); - $content .= parse_html($page,file_get_contents($page)); - } - - //var_dump($content); - file_put_contents("ch{$count}.tex", $content); - $count++; - echo "\n"; -} - -if($count > 1) -{ - echo "** Use Latex and pdfText to compile the main tex file. **\n"; -} - - -?> \ No newline at end of file -- cgit v1.2.3