定制 blok/mushdown 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

blok/mushdown

Composer 安装命令:

composer require blok/mushdown

包简介

A Mustache + Shortcode + Markdown = Mushdown parser for your modern app

README 文档

README

Build Status Coverage Status Packagist Packagist Packagist

Mushdown, modern parser for modern app.

Installation

Install via composer

composer require blok/mushdown

Publish Configuration File

php artisan vendor:publish --provider="Blok\Mushdown\ServiceProvider" --tag="config"

Usage

How to register a shortcode ?

The shortcode methode works like Wordpress short code, you have 2 params the attributes and the content.

You can register a shortcode like that :


app('mushdown')->register('quote', function ($attr, $content = null) {
    return '<quote '.Html::attributes($attr).'>' . app('mushdown')->compile($content) . '</quote>';
});

echo mushdown(<<<EOT
# Heading

- list

[quote class="mt-2"]Test quote[/quote]

{{user.name}}

EOT, ['user' => ['name' => 'John']]);

will output :

<h1 id="heading">Heading</h1>
<ul>
<li>list</li>
</ul>
<p><quote  class="mt-2">Test quote</quote></p>
<p>test</p>

Order of processing

The Mushdown parser are in this order so it won't make normaly any issue or overlapse :

  1. Shortcode : In house implementation
  2. Mustache : https://github.com/bobthecow/mustache.php
  3. Markdown : https://github.com/spatie/laravel-markdown

Security

If you discover any security related issues, please email instead of using the issue tracker.

Credits

This package is bootstrapped with the help of blok/laravel-package-generator.

统计信息

  • 总下载量: 158
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固