diff options
author | wei <> | 2007-05-07 04:17:37 +0000 |
---|---|---|
committer | wei <> | 2007-05-07 04:17:37 +0000 |
commit | eab6bb13b9efb3e1c6d725368368de4d74b00946 (patch) | |
tree | 57aa3462b6f18ad190527483e753dc148971bc63 /buildscripts | |
parent | e91ac8550a4e6dfa255874860f108935841c16f6 (diff) |
Update Active Record docs.
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/chmbuilder/ChmQuickstartBuilder.php | 16 | ||||
-rw-r--r-- | buildscripts/chmbuilder/build.php | 2 | ||||
-rw-r--r-- | buildscripts/chmbuilder/chm_style.css | 18 | ||||
-rw-r--r-- | buildscripts/phing/tasks/PradoQuickStartDocs.php | 85 | ||||
-rw-r--r-- | buildscripts/texbuilder/Page2Tex.php | 4 | ||||
-rw-r--r-- | buildscripts/texbuilder/quickstart/build.php | 2 |
6 files changed, 118 insertions, 9 deletions
diff --git a/buildscripts/chmbuilder/ChmQuickstartBuilder.php b/buildscripts/chmbuilder/ChmQuickstartBuilder.php index 678310a6..43b55d12 100644 --- a/buildscripts/chmbuilder/ChmQuickstartBuilder.php +++ b/buildscripts/chmbuilder/ChmQuickstartBuilder.php @@ -13,12 +13,12 @@ class ChmQuickstartBuilder public function __construct($base,$output)
{
$this->base = $base;
- $this->output_dir = $output.'/quickstart';
+ $this->output_dir = $output;
- if(!is_dir($this->output_dir))
+ if(!is_dir($this->output_dir) || !is_dir($this->output_dir.'/assets'))
{
- mkdir($this->output_dir);
- mkdir($this->output_dir.'/assets/');
+ @mkdir($this->output_dir);
+ @mkdir($this->output_dir.'/assets/');
copy(dirname(__FILE__).'/chm_style.css', $this->output_dir.'/assets/chm_style.css');
}
@@ -58,7 +58,7 @@ class ChmQuickstartBuilder file_put_contents($this->output_dir.'/'.$file, $html);
}
- protected function getApplicationContent()
+ public function getApplicationContent()
{
ob_start();
$this->initApp();
@@ -68,7 +68,7 @@ class ChmQuickstartBuilder return $content;
}
- protected function parseHtmlContent($content)
+ public function parseHtmlContent($content)
{
$html = preg_replace('/<input.*name="PRADO_PAGESTATE" [^>]+\/>/m', '', $content);
$html = str_replace('<div id="header">
@@ -89,6 +89,10 @@ Copyright © 2005-2007 <a href="http://www.pradosoft.com">PradoSoft</a>.</di $html = preg_replace('/(src|href)=("?)\//', '$1=$2assets/',$html);
$html = str_replace('http://www.pradosoft.com/docs/manual', '../manual/CHMdefaultConverter', $html);
$html = str_replace('target="_blank">View Source', '>View Source', $html);
+ $html = preg_replace('/action="[^"]+"/', '', $html);
+ $html = preg_replace('/<script[^>]+><\/script>/', '', $html); //remove js
+ $html = preg_replace('/href="C:[^"]+"/', 'href="#"', $html);
+
$html = preg_replace_callback('/href="\?page=ViewSource&(amp;){0,1}path=([a-zA-z0-9\.\/]+)"/',
array($this, 'update_source_url'), $html);
diff --git a/buildscripts/chmbuilder/build.php b/buildscripts/chmbuilder/build.php index a85d9763..aeef4ad5 100644 --- a/buildscripts/chmbuilder/build.php +++ b/buildscripts/chmbuilder/build.php @@ -53,7 +53,7 @@ else $pages['Control Reference : Standard Controls'][] = 'Controls/Standard.page';
- $quickstart= new ChmQuickstartBuilder($base,$output_dir);
+ $quickstart= new ChmQuickstartBuilder($base,$output_dir.'/quickstart');
$quickstart->buildDoc($pages);
//move class data to protected data directory for prado app.
diff --git a/buildscripts/chmbuilder/chm_style.css b/buildscripts/chmbuilder/chm_style.css index 344d3176..6b2ae955 100644 --- a/buildscripts/chmbuilder/chm_style.css +++ b/buildscripts/chmbuilder/chm_style.css @@ -627,3 +627,21 @@ table.tabular td {
color: red;
}
+
+div.last-modified
+{
+ font-size: 0.8em;
+ color: #999;
+ margin-top: 5em;
+ margin-bottom: -3em;
+}
+
+p.since-version, p.requires-version
+{
+ display: none;
+}
+
+div.languages
+{
+ display: none;
+}
\ No newline at end of file diff --git a/buildscripts/phing/tasks/PradoQuickStartDocs.php b/buildscripts/phing/tasks/PradoQuickStartDocs.php new file mode 100644 index 00000000..06c30a14 --- /dev/null +++ b/buildscripts/phing/tasks/PradoQuickStartDocs.php @@ -0,0 +1,85 @@ +<?php
+require_once 'phing/Task.php';
+
+require_once(dirname(__FILE__).'/../../chmbuilder/ChmQuickstartBuilder.php');
+include(dirname(__FILE__).'/../../../framework/PradoBase.php');
+class Prado extends PradoBase
+{
+ protected static $app;
+
+ public static function setApplication($application)
+ {
+ self::$app=$application;
+ }
+
+ public static function getApplication()
+ {
+ return self::$app;
+ }
+
+ public static function setPathOfAlias($alias,$path)
+ {
+ $aliases = self::getPathAliases();
+ if(!isset($aliases[$alias]))
+ parent::setPathOfAlias($alias,$path);
+ }
+}
+
+include(dirname(__FILE__).'/../../../framework/prado.php');
+
+/**
+ * Task to run phpDocumentor for PRADO API docs.
+ */
+class PradoQuickStartDocs extends Task
+{
+ private $base_dir;
+
+ private $destdir;
+
+ private $page;
+
+ /**
+ * Set the destination directory for the generated documentation
+ */
+ function setOutput(PhingFile $destdir)
+ {
+ $this->destdir = $destdir;
+ }
+
+ function setPages($page)
+ {
+ $this->page = $page;
+ }
+
+ /**
+ * Main entrypoint of the task
+ */
+ function main()
+ {
+ $output = $this->destdir->getAbsolutePath();
+ $base = dirname(__FILE__).'/../../../demos/quickstart/protected/';
+ error_reporting(0);
+ $quickstart= new ChmQuickstartBuilder($base,$output);
+
+ foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page)
+ {
+ $file = str_replace(array('/','.page'), array('_','.html'),$page);
+ $this->log("Parsing $page");
+ file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page));
+ $this->log("Writing $file");
+ }
+ }
+
+ protected function parsePage($quickstart, $page)
+ {
+ $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page);
+ $_GET['notheme'] = 'true';
+ $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent());
+ //hide prado specific content
+ $content = str_replace('<body>', '<style type="text/css">.prado-specific {display:none;}</style><body>', $content);
+ return $content;
+ }
+
+}
+
+?>
\ No newline at end of file diff --git a/buildscripts/texbuilder/Page2Tex.php b/buildscripts/texbuilder/Page2Tex.php index 7ee4a171..ad712183 100644 --- a/buildscripts/texbuilder/Page2Tex.php +++ b/buildscripts/texbuilder/Page2Tex.php @@ -174,7 +174,7 @@ class Page2Tex //text modifiers
$html = preg_replace('/<(b|strong)[^>]*>([^<]*)<\/(b|strong)>/', '\textbf{$2}', $html);
- $html = preg_replace('/<i[^>]*>([^<]*)+?<\/i>/', '\emph{$1}', $html);
+ $html = preg_replace('/<i [^>]*>([^<]*)+?<\/i>/', '\emph{$1}', $html);
$html = preg_replace_callback('/<tt>([^<]*)<\/tt>/', array($this,'texttt'), $html);
//links
@@ -213,6 +213,8 @@ class Page2Tex $html = preg_replace('/<!--(.*)-->/', '', $html);
$html = preg_replace('/<div class="last-modified">((.|\n)*?)<\/div>/', '', $html);
+ //since
+ $html = preg_replace('/<com:SinceVersion[^>]+>/', '', $html);
$html = html_entity_decode($html);
diff --git a/buildscripts/texbuilder/quickstart/build.php b/buildscripts/texbuilder/quickstart/build.php index 2cee7fee..81a12d4c 100644 --- a/buildscripts/texbuilder/quickstart/build.php +++ b/buildscripts/texbuilder/quickstart/build.php @@ -42,7 +42,7 @@ foreach($pages as $chapter => $sections) $content .= $parser->get_section_label($section);
$file_content = file_get_contents($page);
- $tex =
+ //$tex =
$content .= $parser->parse_html($page,$file_content);
}
|