PHPackages                             jansuchanek/nshortcode - 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. jansuchanek/nshortcode

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

jansuchanek/nshortcode
======================

Universal shortcode parser for Nette — \[prefix:args\] syntax with registered handlers, Latte filter, DI extension

v1.1.0(1mo ago)01↓100%1MITPHPPHP &gt;=8.2CI failing

Since Mar 20Pushed 1mo agoCompare

[ Source](https://github.com/JanSuchanek/nshortcode)[ Packagist](https://packagist.org/packages/jansuchanek/nshortcode)[ RSS](/packages/jansuchanek-nshortcode/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (1)

NShortcode
==========

[](#nshortcode)

WordPress-style shortcode parser for Nette Framework — `[prefix:args]` syntax in content.

Features
--------

[](#features)

- ⌨️ **Shortcode Syntax** — `[gallery:id=5]`, `[youtube:dQw4w9WgXcQ]`
- 🔌 **Custom Handlers** — Register handlers for each shortcode prefix
- 📝 **Content Filter** — Process shortcodes in any text/HTML content
- ⚙️ **DI Extension** — Auto-discovers shortcode handlers

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

[](#installation)

```
composer require jansuchanek/nshortcode
```

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

[](#configuration)

```
extensions:
    shortcode: NShortcode\DI\NShortcodeExtension
```

Usage
-----

[](#usage)

Register a handler:

```
use NShortcode\ShortcodeHandlerInterface;

class YoutubeShortcode implements ShortcodeHandlerInterface
{
    public function getPrefix(): string
    {
        return 'youtube';
    }

    public function handle(string $args): string
    {
        return '';
    }
}
```

Process content:

```
$html = $shortcodeProcessor->process($page->getContent());
// [youtube:dQw4w9WgXcQ] →
```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Nette DI ^3.2

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance96

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/38ce2f53e74d810d50aca863e1a3b954f34f1629dd01a6a8c7d4d582e7459e63?d=identicon)[JanSuchanek](/maintainers/JanSuchanek)

---

Top Contributors

[![JanSuchanek](https://avatars.githubusercontent.com/u/310020?v=4)](https://github.com/JanSuchanek "JanSuchanek (5 commits)")

### Embed Badge

![Health badge](/badges/jansuchanek-nshortcode/health.svg)

```
[![Health](https://phpackages.com/badges/jansuchanek-nshortcode/health.svg)](https://phpackages.com/packages/jansuchanek-nshortcode)
```

###  Alternatives

[ipub/gravatar

Gravatar creator for Nette Framework

122.0k1](/packages/ipub-gravatar)

PHPackages © 2026

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