2017 © Pedro Peláez
 

library oh-snap

A pretty formatter for BooBoo.

image

mzdr/oh-snap

A pretty formatter for BooBoo.

  • Tuesday, May 1, 2018
  • by mzdr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • CSS
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 43 % Grown

The README.md

Screenshot, (*1)

💥 Oh Snap!

A pretty formatter for BooBoo., (*2)



, (*3)

Installation

It is recommended that you install this library using Composer., (*4)

composer require mzdr/oh-snap

Don’t forget to check out the official documentation of BooBoo on how to use and install it., (*5)


, (*6)

Usage

```php ['default'], // Path to custom template file. 'template' => null, // If set to true, code preview will not contain the // whole file but the amount of lines defined in excerptSize. 'excerptOnly' => false, // Amount of lines the code preview should have… 'excerptSize' => 20, // Optional header/footer content to show. May be a path // to a file that should be required. Output will not be // sanitized in any way. 'header' => null, 'footer' => null ]; $booboo = new BooBoo([new PrettyFormatter($options)]); $booboo->register(); throw new RuntimeException('Oh snap! 🙈'); ```
## Customizing You may customize the formatter in **3** different ways.
, (*7)

**Fully** 🤓
If you want **full** control over the output of the formatter, you’ll probably need to use a custom template. This is preferably a `.php` file since it’s going to be `require()'d` and it’s output will be returned to BooBoo. Just keep in mind, if you do so, you are going to start from scratch. Check out the [default template] for inspiration. 🌟
**Partially** 💄
If you just want to **repaint** the default template this is the way to go. You either can use a completely new CSS file _or_ append one. ```php ['default', 'path/to/your.css', 'a { color: pink; }'], // Using different stylesheet… 'theme' => ['path/to/your.css'], // Using no styles at all? ¯\_(ツ)_/¯ 'theme' => [], ]; ```
**Slightly** ✍️
Maybe the `header` and/or `footer` options are just enough? They will be placed inside the respective elements (e.g. `
= $header ?>
`) of the default template, or your custom template if you implement it. You may pass any string you like, including HTML. Perfect for just a little branding.


, (*8)

License

This project is licensed under MIT license., (*9)

The Versions

01/05 2018

dev-master

9999999-dev https://github.com/mzdr/oh-snap

A pretty formatter for BooBoo.

  Sources   Download

MIT

The Requires

 

by Sebastian Prein

01/05 2018

1.0.0

1.0.0.0 https://github.com/mzdr/oh-snap

A pretty formatter for BooBoo.

  Sources   Download

MIT

The Requires

 

by Sebastian Prein