diff --git a/README.md b/README.md index a8adeb8..2ad4f40 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Forcer un préfixe de sortie ici dans `work/output/spip-dev` : ### from:spip -Générer la documentation depuis le svn du core +Générer la documentation depuis le git du core autodoc from:spip autodoc from:spip --branche=4.0 diff --git a/templates/template/components/sidebar.html.twig b/phpdoc/template/components/sidebar.html.twig similarity index 100% rename from templates/template/components/sidebar.html.twig rename to phpdoc/template/components/sidebar.html.twig diff --git a/templates/template/components/sidebar_origin.html.twig b/phpdoc/template/components/sidebar_origin.html.twig similarity index 100% rename from templates/template/components/sidebar_origin.html.twig rename to phpdoc/template/components/sidebar_origin.html.twig diff --git a/templates/template/css/custom.css.twig b/phpdoc/template/css/custom.css.twig similarity index 100% rename from templates/template/css/custom.css.twig rename to phpdoc/template/css/custom.css.twig diff --git a/templates/template/css/variables.css.twig b/phpdoc/template/css/variables.css.twig similarity index 100% rename from templates/template/css/variables.css.twig rename to phpdoc/template/css/variables.css.twig diff --git a/templates/template/icons/constant.svg.twig b/phpdoc/template/icons/constant.svg.twig similarity index 100% rename from templates/template/icons/constant.svg.twig rename to phpdoc/template/icons/constant.svg.twig diff --git a/templates/template/icons/method.svg.twig b/phpdoc/template/icons/method.svg.twig similarity index 100% rename from templates/template/icons/method.svg.twig rename to phpdoc/template/icons/method.svg.twig diff --git a/src/Checkout.php b/src/Checkout.php index 0172c8b..1c052b4 100644 --- a/src/Checkout.php +++ b/src/Checkout.php @@ -48,7 +48,7 @@ class Checkout */ public function readGit(): Git { - // Ici, on a les bons fichiers SVN à jour + // Ici, on a les bons fichiers Git à jour // on récupère le numéro de dernière révision if ($res = $this->read()) { $res = trim($res[0]); diff --git a/src/Command/FromPlugin.php b/src/Command/FromPlugin.php index 8e8995a..cce4492 100644 --- a/src/Command/FromPlugin.php +++ b/src/Command/FromPlugin.php @@ -1,7 +1,7 @@ set('cwd_directory', getcwd()); $this->set('php', PHP_BINARY); + $this->set('cwd_directory', getcwd()); $this->set('phpdocumentor', $this->get('cwd_directory') . '/phpDocumentor.phar'); - $this->set('phpdocumentor_template_xml', dirname(__DIR__) . '/placeholders/phpdoc.xml'); $this->set('templates_directory', dirname(__DIR__) . '/templates'); + $this->set('phpdocumentor_config_directory', dirname(__DIR__) . '/phpdoc'); $this->set('var_directory', $this->get('cwd_directory') . '/var'); $this->set('config_directory', $this->get('var_directory') . '/config'); $this->set('cache_base_directory', $this->get('var_directory') . '/cache'); diff --git a/src/Stage/PhpDocumentorConfigStage.php b/src/Stage/PhpDocumentorConfigStage.php index b91a9ac..6780094 100644 --- a/src/Stage/PhpDocumentorConfigStage.php +++ b/src/Stage/PhpDocumentorConfigStage.php @@ -25,14 +25,6 @@ class PhpDocumentorConfigStage implements StageInterface throw new ContextException(sprintf('Key "%s" needs to be defined and instance of Package.', 'package')); } - if ( - !$context->has('phpdocumentor_template_xml') - or !$context->get('phpdocumentor_template_xml') - or !file_exists($context->get('phpdocumentor_template_xml')) - ) { - throw new ContextException(sprintf('Key "%s" needs to be defined with valid file.', 'phpdocumentor_template_xml')); - } - $fs = new Filesystem(); $package = $context->get('package'); $prefix = $package->get('prefix') ?: $context->get('default_prefix'); @@ -60,7 +52,7 @@ class PhpDocumentorConfigStage implements StageInterface // copy templates in config directory $fs->mirror( - $context->get('templates_directory'), + $context->get('phpdocumentor_config_directory'), $config_directory . '/.phpdoc', options: [ 'delete' => true, @@ -89,7 +81,8 @@ class PhpDocumentorConfigStage implements StageInterface '@URL_REPOSITORY@' => $repository, '@GUIDES_ENABLED@' => ($package->get('with_rst_documentation') ? 'true' : 'false'), ]; - $template = file_get_contents($context->get('phpdocumentor_template_xml')); + $phpdocumentor_template_xml = $context->get('templates_directory') . '/phpdoc.xml'; + $template = file_get_contents($phpdocumentor_template_xml); $config = str_replace(array_keys($replacements), $replacements, $template); $config_file = $config_directory . '/phpdoc_' . $prefix . '.xml'; file_put_contents($config_file, $config); diff --git a/placeholders/index.html b/templates/index.html similarity index 100% rename from placeholders/index.html rename to templates/index.html diff --git a/placeholders/phpdoc.xml b/templates/phpdoc.xml similarity index 100% rename from placeholders/phpdoc.xml rename to templates/phpdoc.xml