From 3943632efd2593c9b223dcb034d7e26c2600f413 Mon Sep 17 00:00:00 2001 From: MGatner Date: Tue, 1 Jun 2021 16:52:52 +0000 Subject: [PATCH] Tweak formatting --- user_guide_src/source/libraries/publisher.rst | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/user_guide_src/source/libraries/publisher.rst b/user_guide_src/source/libraries/publisher.rst index 57abcfcd6925..fe6413922272 100644 --- a/user_guide_src/source/libraries/publisher.rst +++ b/user_guide_src/source/libraries/publisher.rst @@ -160,51 +160,51 @@ Asset Dependencies Example You want to integrate the frontend library "Bootstrap" into your project, but the frequent updates makes it a hassle to keep up with. You can create a publication definition in your project to sync frontend assets by adding extending -``Publisher`` in your project. So **app/Publishers/BootstrapPublisher.php** might look like this:: - - namespace App\Publishers; - - use CodeIgniter\Publisher\Publisher; - - class BootstrapPublisher extends Publisher - { - /** - * Tell Publisher where to get the files. - * Since we will use Composer to download - * them we point to the "vendor" directory. - * - * @var string - */ - protected $source = 'vendor/twbs/bootstrap/'; - - /** - * FCPATH is always the default destination, - * but we may want them to go in a sub-folder - * to keep things organized. - * - * @var string - */ - protected $destination = FCPATH . 'bootstrap'; - - /** - * Use the "publish" method to indicate that this - * class is ready to be discovered and automated. - * - * @return boolean - */ - public function publish(): bool - { - return $this - // Add all the files relative to $source - ->addPath('dist') - - // Indicate we only want the minimized versions - ->retainPattern('*.min.*) - - // Merge-and-replace to retain the original directory structure - ->merge(true); - } - } +``Publisher`` in your project. So **app/Publishers/BootstrapPublisher.php** might look like this :: + + namespace App\Publishers; + + use CodeIgniter\Publisher\Publisher; + + class BootstrapPublisher extends Publisher + { + /** + * Tell Publisher where to get the files. + * Since we will use Composer to download + * them we point to the "vendor" directory. + * + * @var string + */ + protected $source = 'vendor/twbs/bootstrap/'; + + /** + * FCPATH is always the default destination, + * but we may want them to go in a sub-folder + * to keep things organized. + * + * @var string + */ + protected $destination = FCPATH . 'bootstrap'; + + /** + * Use the "publish" method to indicate that this + * class is ready to be discovered and automated. + * + * @return boolean + */ + public function publish(): bool + { + return $this + // Add all the files relative to $source + ->addPath('dist') + + // Indicate we only want the minimized versions + ->retainPattern('*.min.*) + + // Merge-and-replace to retain the original directory structure + ->merge(true); + } + } Now add the dependency via Composer and call ``spark publish`` to run the publication::