public function __construct($themeDir, $outputDir, $themeConfig, $config, Documentation $documentation) { $this->outputDir = $outputDir; $this->themeConfig = $themeConfig; $this->themeDir = $themeDir; $this->options = $themeConfig["options"]; $this->projectConfig = $config; $this->documentation = $documentation; $themeInfosPath = $this->getThemePath("theme.json"); if ($themeInfosPath) { $themeInfos = json_decode(file_get_contents($themeInfosPath), true); if (!$themeInfos) { throw new Exception("Cant parse file {$themeInfosPath}"); } else { $this->themeInfos = $themeInfos; if (isset($themeInfos["extends"])) { $extThemePath = $documentation->findThemePathByName($themeInfos["extends"]); if (!$extThemePath) { throw new Exception("Unable to find extended theme " . $themeInfos["extends"]); } $this->extendedTheme = new Theme($extThemePath, $outputDir, $themeConfig, $config, $documentation); } } } }
public function getOutputFile() { return \Zephir\Documentation::namespaceUrl($this->namespaceHelper->getFullNamespace()); }
/** * Generate a HTML API * * @param CommandInterface $command * @param bool $fromGenerate */ public function api(CommandInterface $command, $fromGenerate = false) { if (!$fromGenerate) { $this->generate($command); } $documentator = new Documentation($this->files, $this->config, $this->logger, $command); $this->logger->output('Generating API into ' . $documentator->getOutputDirectory()); $documentator->build(); }
public function getOutputFile() { return \Zephir\Documentation::sourceUrl($this->class); }
/** * Generate an url relative to the current directory * * @param string $url the url we want to reach * @return string the relative path to the url */ public function url($url) { if (is_string($url)) { if ($url[0] == "/") { return $this->getPathToRoot() . ltrim($url, "/"); } elseif (is_string($url)) { return $url; } } elseif ($url instanceof ClassDefinition) { return $this->url(Documentation::classUrl($url)); } elseif ($url instanceof CompilerFile) { return $this->url(Documentation::classUrl($url->getClassDefinition())); } return ""; }