From f63456cbc8979f3693c2c6c2f36ade0c711168a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Wed, 21 Sep 2016 23:30:01 +0200 Subject: [PATCH] Add option to specify themes directory --- libs/Config.php | 5 +++++ libs/Console/DauxCommand.php | 4 ++++ libs/Console/Generate.php | 1 + libs/Console/Serve.php | 1 + 4 files changed, 11 insertions(+) diff --git a/libs/Config.php b/libs/Config.php index d589ddb..510bb32 100644 --- a/libs/Config.php +++ b/libs/Config.php @@ -73,6 +73,11 @@ class Config extends ArrayObject return $this['themes_directory']; } + public function setThemesDirectory($directory) + { + $this['themes_directory'] = $directory; + } + public function setThemesPath($themePath) { $this['themes_path'] = $themePath; diff --git a/libs/Console/DauxCommand.php b/libs/Console/DauxCommand.php index 7e370a0..ad607ce 100644 --- a/libs/Console/DauxCommand.php +++ b/libs/Console/DauxCommand.php @@ -20,6 +20,10 @@ class DauxCommand extends SymfonyCommand $daux->getParams()->setDocumentationDirectory($input->getOption('source')); } + if ($input->getOption('themes')) { + $daux->getParams()->setThemesDirectory($input->getOption('themes')); + } + $daux->initializeConfiguration($input->getOption('configuration')); if ($input->hasOption('delete') && $input->getOption('delete')) { diff --git a/libs/Console/Generate.php b/libs/Console/Generate.php index 51d6646..d3bc8b6 100755 --- a/libs/Console/Generate.php +++ b/libs/Console/Generate.php @@ -19,6 +19,7 @@ class Generate extends DauxCommand ->addOption('source', 's', InputOption::VALUE_REQUIRED, 'Where to take the documentation from') ->addOption('format', 'f', InputOption::VALUE_REQUIRED, 'Output format, html or confluence', 'html') ->addOption('processor', 'p', InputOption::VALUE_REQUIRED, 'Manipulations on the tree') + ->addOption('themes', 't', InputOption::VALUE_REQUIRED, 'Set a different themes directory') // Confluence format only ->addOption('delete', null, InputOption::VALUE_NONE, 'Delete pages not linked to a documentation page (confluence)') diff --git a/libs/Console/Serve.php b/libs/Console/Serve.php index e44c533..b782fa8 100755 --- a/libs/Console/Serve.php +++ b/libs/Console/Serve.php @@ -21,6 +21,7 @@ class Serve extends DauxCommand ->addOption('configuration', 'c', InputOption::VALUE_REQUIRED, 'Configuration file') ->addOption('source', 's', InputOption::VALUE_REQUIRED, 'Where to take the documentation from') ->addOption('processor', 'p', InputOption::VALUE_REQUIRED, 'Manipulations on the tree') + ->addOption('themes', 't', InputOption::VALUE_REQUIRED, 'Set a different themes directory') // Serve the current documentation ->addOption('serve', null, InputOption::VALUE_NONE, 'Serve the current directory')