From 9d80a7d17fab5ed52ce5f0e71b78a1fd770a9787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 29 Sep 2024 10:36:45 +0200 Subject: [PATCH 1/4] Reword paragraph Because it was a single sentence without punctuation, it was hard to grasp that implementing the PrependExtensionInterface was optional. --- docs/developers/extensions/structure.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/developers/extensions/structure.rst b/docs/developers/extensions/structure.rst index d16539aa0..cda33d362 100644 --- a/docs/developers/extensions/structure.rst +++ b/docs/developers/extensions/structure.rst @@ -29,10 +29,10 @@ Create an extension =================== For the PHP package to be an extension you need a class -extending `\Symfony\Component\DependencyInjection\Extension\Extension` by -implementing the interface -`Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface` we -can also add our own configurations to our extension: +extending `\Symfony\Component\DependencyInjection\Extension\Extension`. +By implementing the interface +`Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface` +you can also configure the guides extension from your extension: .. literalinclude:: _YourExtension.php :language: php From 45fd5456b65df8e195555a088e20deefbac04758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 29 Sep 2024 10:37:42 +0200 Subject: [PATCH 2/4] Remove trailing whitespace --- docs/developers/extensions/structure.rst | 6 +++--- docs/developers/extensions/templates.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/developers/extensions/structure.rst b/docs/developers/extensions/structure.rst index cda33d362..5df822638 100644 --- a/docs/developers/extensions/structure.rst +++ b/docs/developers/extensions/structure.rst @@ -21,7 +21,7 @@ Each Composer package must have a file `composer.json`. See an example here: :lineos: The PHP sources can be found in the directory `src` then as is stated in line 8 -in the `composer.json`. +in the `composer.json`. .. _extension_symfony: @@ -39,8 +39,8 @@ you can also configure the guides extension from your extension: :caption: your-extension/DependencyInjection/YourExtension.php :lineos: -Lines 24 to 28 load a :ref:`Dependency Injection configuration ` -file. Lines 29 to 36 configure the directory overriding the default templates. +Lines 24 to 28 load a :ref:`Dependency Injection configuration ` +file. Lines 29 to 36 configure the directory overriding the default templates. Read chapter :ref:`extending_templates` to learn more about this. .. note:: diff --git a/docs/developers/extensions/templates.rst b/docs/developers/extensions/templates.rst index 23457761e..2d319210d 100644 --- a/docs/developers/extensions/templates.rst +++ b/docs/developers/extensions/templates.rst @@ -19,7 +19,7 @@ It is recommended to always extend an existing template so that the Twig files of the base templates can be used as fallback for non-defined specific template files. -In order to extend the default bootstrap theme, require the according base +In order to extend the default bootstrap theme, require the according base extension in your extension's `composer.json`: .. code-block:: json @@ -35,7 +35,7 @@ extension in your extension's `composer.json`: And then set `'extends' => 'bootstrap'` (line 32 in the first code-snippet). -To extend the base template (plain HTML) require `phpdocumentor/guides` in your +To extend the base template (plain HTML) require `phpdocumentor/guides` in your `composer.json`, and omit the key `extends`: From 241adf9c15c7d7714b8c050a1744af8af9fece49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 29 Sep 2024 10:39:53 +0200 Subject: [PATCH 3/4] Add missing src directory It is mentioned in composer.json --- docs/developers/extensions/structure.rst | 2 +- docs/developers/extensions/templates.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/developers/extensions/structure.rst b/docs/developers/extensions/structure.rst index 5df822638..98eb2a678 100644 --- a/docs/developers/extensions/structure.rst +++ b/docs/developers/extensions/structure.rst @@ -36,7 +36,7 @@ you can also configure the guides extension from your extension: .. literalinclude:: _YourExtension.php :language: php - :caption: your-extension/DependencyInjection/YourExtension.php + :caption: your-extension/src/DependencyInjection/YourExtension.php :lineos: Lines 24 to 28 load a :ref:`Dependency Injection configuration ` diff --git a/docs/developers/extensions/templates.rst b/docs/developers/extensions/templates.rst index 2d319210d..bfa877f79 100644 --- a/docs/developers/extensions/templates.rst +++ b/docs/developers/extensions/templates.rst @@ -11,7 +11,7 @@ Register the templates overrides in your extension's .. literalinclude:: _YourExtension.php :language: php - :caption: your-extension/DependencyInjection/YourExtension.php + :caption: your-extension/src/DependencyInjection/YourExtension.php :lineos: :emphasize-lines: 29-35 @@ -40,7 +40,7 @@ To extend the base template (plain HTML) require `phpdocumentor/guides` in your .. code-block:: php - :caption: your-extension/DependencyInjection/YourExtension.php + :caption: your-extension/src/DependencyInjection/YourExtension.php $container->prependExtensionConfig('guides', [ 'themes' => ['mytheme' => dirname(__DIR__, 3) . '/resources/template'], From 7cf5d1cd14bc7d21ff8a27dc4b5ad5b0e85d27c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 29 Sep 2024 19:34:58 +0200 Subject: [PATCH 4/4] Remove extra letter --- docs/components/guidesXml.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/components/guidesXml.rst b/docs/components/guidesXml.rst index e7fbde6f8..bda854c2f 100644 --- a/docs/components/guidesXml.rst +++ b/docs/components/guidesXml.rst @@ -46,7 +46,7 @@ Register the new configuration option in the :php:`TreeBuilder` at Using the tree builder is a topic of itself. Refer to the according symfony documentation. -If the configuration is a setting option to controll the applications workflow you can +If the configuration is a setting option to control the applications workflow you can save it in the :php:class:`phpDocumentor\Guides\Settings\ProjectSettings`. Examples of settings options would be `logPath`, `showProgressBar` or `theme`.