PHPackages                             dreitier/awesome-documentation-blade-directives - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dreitier/awesome-documentation-blade-directives

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dreitier/awesome-documentation-blade-directives
===============================================

Make better developer documentations

00PHP

Since Apr 9Pushed 5y ago2 watchersCompare

[ Source](https://github.com/dreitier/awesome-documentation-blade-directives)[ Packagist](https://packagist.org/packages/dreitier/awesome-documentation-blade-directives)[ RSS](/packages/dreitier-awesome-documentation-blade-directives/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Blade Directives for Awesome Documentation
==========================================

[](#blade-directives-for-awesome-documentation)

If you want to create awesome documentation for developers, this package is for you.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dreitier/awesome-documentation-blade-directives
```

Usage
-----

[](#usage)

### Highlighting source code

[](#highlighting-source-code)

This package uses [scrivo/highlight.php](https://github.com/scrivo/highlight.php) to create highlighted source code.

#### @highlightStyle

[](#highlightstyle)

Creates a `` with the given style and version if provided.

```
@highlightStyle("atelier-heath-dark" /* style, optional */, "9.12.0" /* version, optional */)
```

#### @highlight

[](#highlight)

Highlight a given source code file.

- `$path` can be something like 'view:$path\_in\_laravel\_views\_folder' or a custom prefixed path
- `$language` can be any supported language by highlight.js

```
@highlight('view:documentation/samples/flow.php' /* path */, 'php' /* language, optional */)
```

#### @beginHighlight / @endHighlight

[](#beginhighlight--endhighlight)

Highlight inline source code

```
@beginHighlight('php' /* language, optional */)
$a = 1;
$b = 2;
echo "$a + $b = " . ($a + $b);
@endHighlight
```

### Diffing files

[](#diffing-files)

This package uses [jfcherng/php-diff](https://github.com/jfcherng/php-diff) to create diffs between two strings.

#### @differStyle

[](#differstyle)

Create inline CSS style to apply for the diff result.

```
@differStyle
```

#### @diffEncodedJson

[](#diffencodedjson)

Renders a previously created JSON diff:

```
$jsonDiff = \Dreitier\Documentation\Blade\Facades\Differ::calculate('old', 'new', 'Json' /* default, optional */);
```

```
@diffEncodedJson($jsonDiff, $render = null, $rendererOptions = null, $mergeOptions = false)
```

#### @diffArray

[](#diffarray)

Renders a previously created array diff:

```
@diffArray($diff, $render = null, $rendererOptions = null, $mergeOptions = false)
```

#### Create a diff

[](#create-a-diff)

You can easily create a diff between two files by using the facade:

```
$encodedJson = \Dreitier\Documentation\Blade\Facades\Differ::calculateFiles('view:samples/v1.php', 'view:samples/v2.php', $renderer = 'Json', $differOptions = null, $mergeDifferOptions = false, $rendererOptions = null, $mergeRendererOptions = false)
```

As you can see, you can use the prefix format of the static content locator (see below) to easily reference files.

Configuration
-------------

[](#configuration)

#### Highlighting source code

[](#highlighting-source-code-1)

##### Setting highlight.js options

[](#setting-highlightjs-options)

You can configure the used highlight.js options by using the facade:

```
\Dreitier\Documentation\Blade\Facades\Highlighter::setHighlightJsVersion('9.12.1');
\Dreitier\Documentation\Blade\Facades\Highlighter::setHighlightJsStyle('atelier-heath-light');
```

##### Set default language

[](#set-default-language)

If you want to set another default language than PHP, you can use `setDefaultLanguage`:

```
\Dreitier\Documentation\Blade\Facades\Highlighter::setDefaultLanguage('java');
```

#### Diffing files

[](#diffing-files-1)

You can use the following methods to configure the default options of [jfcherng/php-diff](https://github.com/jfcherng/php-diff):

```
\Dreitier\Documentation\Blade\Facades\Differ::setDefaultRenderer($defaultRenderer);
\Dreitier\Documentation\Blade\Facades\Differ::setDefaultRendererOptions($defaultRendererOptions);
\Dreitier\Documentation\Blade\Facades\Differ::setDefaultDifferOptions($differOptions);
\Dreitier\Documentation\Blade\Facades\Differ::setDefaultCss($css);
```

#### Static content locator

[](#static-content-locator)

##### Register a new static content locator

[](#register-a-new-static-content-locator)

This one comes handy if you want to reference source code or samples from other places, like composer packages:

```
\Dreitier\Documentation\Blade\Facades\StaticContentLocator::register('my-composer-package', function($path) {
    return base_path('vendor/my-namespace/my-composer-package/samples') . '/' . $path;
});
```

```
@highlight('my-composer-package:subdir/sample_1.json', 'json')
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/97009eb0dd6ee67ba3b74d1a2020a2ce8dc05499bd235d3f5a678fb15019c2b1?d=identicon)[dreitier](/maintainers/dreitier)

---

Top Contributors

[![schakko](https://avatars.githubusercontent.com/u/359812?v=4)](https://github.com/schakko "schakko (3 commits)")

### Embed Badge

![Health badge](/badges/dreitier-awesome-documentation-blade-directives/health.svg)

```
[![Health](https://phpackages.com/badges/dreitier-awesome-documentation-blade-directives/health.svg)](https://phpackages.com/packages/dreitier-awesome-documentation-blade-directives)
```

###  Alternatives

[opensrs/osrs-toolkit-php

OpenSRS PHP Toolkit

7668.6k](/packages/opensrs-osrs-toolkit-php)[magiccart/lookbook

Pin product to banner easy.

1319.7k](/packages/magiccart-lookbook)[dem13n/discussion-cards

Output of discussions in form of cards

164.6k](/packages/dem13n-discussion-cards)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
