Download the PHP package bnomei/kirby3-storybook without Composer

On this page you can find all versions of the php package bnomei/kirby3-storybook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kirby3-storybook

Kirby 3 Storybook

Release Downloads Build Status Coverage Status Maintainability Twitter

Kirby 3 Plugin to generate Storybook stories from snippets and templates.

screenshot

Commercial Usage


Support open source!

This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?

Be kind. Share a little. Thanks.

‐ Bruno
 

M O N E Y
Github sponsor Patreon Buy Me a Coffee Paypal dontation Hire me

Install

Plugin

Using composer:

You need to install the CLI with composer since this plugin depends on the CLI to be available either globally or locally.

Storybook

Please refer to the official docs on how to install Storybook if in doubt.

TIP: I used storybook@^7.0.0-beta.12 for my tests.

TIP: I used vue3 for my tests, but you can stick to vue if you want to keep it consistent to other Kirby components.

Usage

Creating stories

The plugin can load data for your Snippet/Template files. You can use three different ways for Snippets and two for Templates. Check out the tests in this repository to see some examples.

Snippet stories

Let's assume a snippet named example.php in either site/snippets or registered via a plugin extension. Add any of these files into the same folder as the snippet.

Template stories

Let's assume a template named blog.php in either site/templates or registered via a plugin extension. Add any of these files into the same folder as the template.

Storybook and the plugins file watcher

You need to run two tasks. First start Storybook.

TIP: Make sure you can run storybook after installation at least once without errors. Then remove the demo files or copy them to a different location in case you need them for reference (like I usually do).

In a different shell run the file watcher.

The file watcher provided by this plugin needs the Kirby CLI and has various options for interval, displaying errors, running only once and a file pattern match. See help for details.

Some examples:

Generated Files

The plugin will use the file watcher to monitor your Snippet/Template files and their story config files (aka *.stories.yml|json). If any of these files changes it will generate or overwrite the corresponding files in your Storybook stories folder. Creating subfolders as needed to match Kirbys extension registry (like snippets/blocks). It will NOT remove any files. There are three files created for each story.

Adding your CSS and JS assets

You could add the reference your a single css file manually with <style src="./../../app.css"></style> and import all your scripts to each vue SFC. But my suggested method out of 6 would be to import your assets in the ./storybook/preview.js and/or .storybook/main.js that storybook created. See example below:

./storybook/preview.js

./storybook/main.js

Settings

bnomei.storybook. Default Description
cli callback detect if is cli and only then inject values
folder callback logic to find you Storybook stories folder, adjust if needed
stories.json callback if KQL exists allow loading from json files
stories.yml true allow loading from yml files
stories.ignore [] array of string, if matches any file will not be rendered

Dependencies

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


All versions of kirby3-storybook with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
getkirby/composer-installer Version ^1.2
symfony/deprecation-contracts Version ^3.0.1
symfony/finder Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bnomei/kirby3-storybook contains the following files

Loading the files please wait ....