Exemple #1
0
 public static function setTheme($theme)
 {
     self::setTemplateDir();
     if (!is_dir(self::$_basepath . $theme)) {
         throw new Exception("此主题不存在, " . self::$_basepath . $theme);
     }
     self::$_theme = $theme;
 }
Exemple #2
0
 public function __construct($tplFile, JsDoc $jsDoc = null)
 {
     parent::__construct($tplFile);
     $this->addJsDoc($jsDoc);
 }
Exemple #3
0
            widget/gotop.iscroll.js
            widget/pageswipe.js
            widget/dialog.js
            widget/dialog.position.js
            widget/toolbar.js
            widget/button.js
            widget/button.input.js
            widget/more.js
            ');
JsDoc_Template::setTemplateDir($templateDir);
JsDoc_Template::setTheme('');
$navTemplate = new JsDoc_Template('nav.phtml');
$jsDocTemplate = new JsDoc_Template_Doc('doc.phtml', $zeptoDoc);
$jsDocTemplate->addJsDoc($gmuDoc);
$jsDocTemplate->assignVariable('NavPrefix', $navTemplate->render());
$template = new JsDoc_Template('index.phtml');
$template->assignVariable('title', 'GMU API 文档 ');
$template->assignVariable('docContent', $jsDocTemplate->render());
$template->assignVariable('searchEntries', $jsDocTemplate->getSearchEntries());
$template->assignVariable('themes', $themes);
$template->assignVariable('theme', 'blue');
$template->assignVariable('activeTheme', 'purple');
$content = $template->render();
if (!is_dir($outputDir)) {
    @mkdir($outputDir);
}
// 删除doc目录下所有文件
//todo 加配置项
if (true) {
    emptyDir($outputDir);
}