All Projects → alsterholm → Laravel Markdown

alsterholm / Laravel Markdown

Licence: mit
A small, lightweight and easy-to-use Laravel package for handling markdown.

Projects that are alternatives of or similar to Laravel Markdown

Laravel Generator
laravel-generator / laravel代码生成器
Stars: ✭ 61 (-67.03%)
Mutual labels:  laravel, blade
Laravel Blog
基于Laravel5.8构建的轻量博客应用,支持Markdown,支持图片拖拽上传,界面简洁,SEO友好,支持百度链接自动和手动提交
Stars: ✭ 84 (-54.59%)
Mutual labels:  markdown, laravel
Laravel Tinymce Simple Imageupload
Simple image upload for TinyMCE in Laravel.
Stars: ✭ 66 (-64.32%)
Mutual labels:  laravel, blade
Blade Zondicons
A package to easily make use of Zondicons in your Laravel Blade views.
Stars: ✭ 40 (-78.38%)
Mutual labels:  laravel, blade
Jigsaw
Simple static sites with Laravel’s Blade.
Stars: ✭ 1,823 (+885.41%)
Mutual labels:  laravel, blade
Tailwindcss
A Tailwind CSS frontend preset for the Laravel Framework
Stars: ✭ 1,056 (+470.81%)
Mutual labels:  laravel, blade
Laravel Blade Snippets Vscode
Laravel blade snippets and syntax highlight support for Visual Studio Code
Stars: ✭ 80 (-56.76%)
Mutual labels:  laravel, blade
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+325.41%)
Mutual labels:  laravel, blade
Blade Extensions
Laravel Blade Extension Classes for Laravel 5
Stars: ✭ 136 (-26.49%)
Mutual labels:  laravel, blade
Wizard
Wizard是一款开源的文档管理工具,支持Markdown/Swagger/Table类型的文档。
Stars: ✭ 1,733 (+836.76%)
Mutual labels:  markdown, laravel
Laradown
Markdown parser for Laravel built on parsedown
Stars: ✭ 29 (-84.32%)
Mutual labels:  markdown, laravel
Sheets
Store & retrieve your static content in plain text files
Stars: ✭ 175 (-5.41%)
Mutual labels:  markdown, laravel
Beautymail
Send beautiful HTML emails with Laravel
Stars: ✭ 923 (+398.92%)
Mutual labels:  laravel, blade
Larawind
Larawind - Laravel 8.0+ Jetstream and Tailwind CSS Admin Theme
Stars: ✭ 55 (-70.27%)
Mutual labels:  laravel, blade
Laravel Blade Directives
A collection of nice Laravel Blade directives
Stars: ✭ 813 (+339.46%)
Mutual labels:  laravel, blade
Blade Icons
A package to easily make use of SVG icons in your Laravel Blade views.
Stars: ✭ 1,181 (+538.38%)
Mutual labels:  laravel, blade
Artisan View
👀 Manage your views in Laravel projects through artisan
Stars: ✭ 708 (+282.7%)
Mutual labels:  laravel, blade
Blade Ui Kit
A set of renderless components to utilise in your Laravel Blade views.
Stars: ✭ 763 (+312.43%)
Mutual labels:  laravel, blade
Tall Dashboard
Tailwind CSS + AlpineJS + Laravel + Livewire dashboard (WIP)
Stars: ✭ 83 (-55.14%)
Mutual labels:  laravel, blade
Base
YASCMF 基础开发版(YASCMF/BASE)
Stars: ✭ 162 (-12.43%)
Mutual labels:  laravel, blade

⚠️ Important

This project is no longer maintained, will not received any updates and will not support future versions of Laravel.


Laravel-Markdown

Build Status

A small, lightweight and easy-to-use Laravel package for handling markdown. It comes with a facade, a helper function and a Blade directive to make life easier for you.

Laravel version Laravel-Markdown version
5.8, 6.* 3.1.1
5.7 3.0.1
5.6 3.0
5.5 2.0
5.3, 5.4 1.1
5.2 1.0

Installation

To install it, simply pull it down with Composer. Run the php artisan vendor:publish command to publish the configuration file.

composer require andreasindal/laravel-markdown:"3.0.1"

Laravel 5.5 and above use Package Auto-Discovery, so you do not have to manually add the MarkdownServiceProvider.

Usage

Blade-directive

The markdown parser may be used in your Blade templates by using the @markdown directive.

<article>
    <h1>{{ $post->title }}</h1>

    <section class="content">
        @markdown($post->body)
    </section>
</article>

You can also use a block-style syntax:

@markdown
# Hello world

This *text* will be **parsed** to [HTML](http://laravel.com).
@endmarkdown

Facade

If you registered the Markdown facade as shown above, you can easily parse markdown using it.

$markdown = "# Hello";

$html = Markdown::parse($markdown) // <h1>Hello</h1>

Helper-functions

$html = markdown('# Hello'); // <h1>Hello</h1>
$html = markdown_capture(function () {
    echo "# Hello";
    echo "\n\n";
    echo "So **cool**!"
});

// <h1>Hello</h1>
// <p>So <b>cool</b>!</p>

Of course, you could also resolve the parser from the service container and use it yourself.

$parser = app('Indal\Markdown\Parser');
$html = $parser->parse('# Hello'); // <h1>Hello</h1>

Drivers (NEW!)

Laravel-Markdown allows you to add custom markdown drivers. In order to use a custom markdown driver, you need to create a class that implements the Indal\Markdown\Drivers\MarkdownDriver interface. The interface contains two methods: text and line. text is used to convert a block of markdown to HTML, while line is used to convert a single line.

Laravel-Markdown ships with a ParsedownDriver using the Parsedown-package by @erusev.

Credits

License

Licensed under MIT. For more information, see the LICENSE-file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].