PHPackages                             krisanalfa/bono-markdown - 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. krisanalfa/bono-markdown

ActiveLibrary

krisanalfa/bono-markdown
========================

Markdown Support for Bono Based Project

0.0.2(11y ago)023MITPHP

Since Aug 12Pushed 11y agoCompare

[ Source](https://github.com/krisanalfa/bono-markdown)[ Packagist](https://packagist.org/packages/krisanalfa/bono-markdown)[ RSS](/packages/krisanalfa-bono-markdown/feed)WikiDiscussions master Synced yesterday

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

Markdown Support for Bono Based Project
=======================================

[](#markdown-support-for-bono-based-project)

This package will make you able to use markdown as Norm schema or input type markdown in your Bono Based Project.

> **Note:** This package required PHP &gt;5.4

Installation
============

[](#installation)

Add this package to your `composer.json` file

```
"require": {
    "krisanalfa/bono-markdown": "~0.0.1",
}
```

Register Bono Markdown provider to your Bono provider configuration:

```
'bono.providers' => [
    'Bono\\Markdown\\Provider\\MarkdownProvider' => [
        'gfm' => true, // activate Github Flavored Markdown
    ],
],
```

> **Note:** For another config options, see the Config section below.

Example Usage
=============

[](#example-usage)

```
$app = App::getInstance();
$markdown = '**Markdown is awesome**';

// render markdown syntax
echo $app->container['markdown']->render($markdown);

// render markdown form input
echo $app->container['markdown.form']->renderInput($markdown);
```

Input form use Bootstrap 3 as it's theme, if you want to override this one, you should use custom view, and render your own partial template there.

Options
=======

[](#options)

Below is complete example of available option for your Markdown configuration:

```
use App\MyCustomViewEngine;

'bono.providers' => [
    'Bono\\Markdown\\Provider\\MarkdownProvider' => [
        'gfm' => true, // default false
        'service' => true, // default false
        'endpoint' => '/md-parser', // default '/md'
        'requestKeyName' => 'entry', // default 'markdown',
        'view' => function () { // default is not set, fallback to Slim\View
            return new MyCustomViewEngine;
        },
        'partialTemplatePath' => 'templates/partials', // default is not set, using our own partials
    ],
],
```

#### Options –– `gfm`

[](#options--gfm)

Enable Github Flavored Markdown, default is `false`

#### Options –– `service`

[](#options--service)

If you want to enable web service that able to parse markdown set this to `true`, default is `false`

#### Options –– `endpoint`

[](#options--endpoint)

The endpoint URL of your web service, require `service` to `true`, default is `md`

#### Options –– `requestKeyName`

[](#options--requestkeyname)

The request key name for your web service, default is `markdown`

#### Options –– `view`

[](#options--view)

Your custom view engine, default is `Slim\View`

#### Options –– `partialTemplatePath`

[](#options--partialtemplatepath)

Your custom partial template, default is not set (using our own partials)

Norm Schema
===========

[](#norm-schema)

You can also use this package as Norm schema. Be caution, when you call `formatInput()` method, the method calls `$app->container['markdown.form']->renderInput($markdown)` method; the default partial still use `_markdown/form` and `Slim\View` view engine. So, if you want to override this behavior, you must set your own view in config file:

```
'bono.providers' => [
    'Bono\\Markdown\\Provider\\MarkdownProvider' => [
        'view' => function() {
            return new MyCustomViewEngine();
        }
    ],
],
```

> **Note:** Make sure your custom view is an extends from `Slim\View`

Web Service
===========

[](#web-service)

To enable this feature, you have to change your config, and set `service` to `true`. Access them via `POST`request. This is a simple javascript example to access your webservice:

```
$.ajax({
    url: 'http://yourdomain.com/md',
    data: {
        'markdown': '**Markdown is awesome**'
    },
    type: 'POST'
}).done(function(html) {
    $('div').html(html);
});
```

> **Note:** As you see, the given URL, `/md` is based on your `endpoint` configuration.

Another Hack
============

[](#another-hack)

Form input use `Slim\View` to fetch and load the view. If you want to change this default, you can use `$app->container['markdown.form']->setView($view)`.

```
$view = new MyCustomViewEngine();

$app->container['markdown.form']->setView($view); // after this, form should use your custom view engine
```

One more. The default partials to render is `_markdown/form`, if you want to render another partials, just pass a second argument in `Form::renderInput()` method. Example:

```
$app->container['markdown.form']->renderInput($markdown, '_partials/markdown');
```

For more information, see `Bono\Markdown\Helper\Form.php` file.

> **Note:** Your custom view should an extends from `Slim\View`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

4290d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5585ab7e83e92b16ebfde64d7d90ff330721bcb1fbfa193fb0ffe149a4b3a7d1?d=identicon)[krisanalfa](/maintainers/krisanalfa)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/krisanalfa-bono-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/krisanalfa-bono-markdown/health.svg)](https://phpackages.com/packages/krisanalfa-bono-markdown)
```

PHPackages © 2026

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