All Projects → olliecodes → laravel-etched-blade

olliecodes / laravel-etched-blade

Licence: MIT license
A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Programming Languages

PHP
23972 projects - #3 most used programming language
Blade
752 projects
HTML
75241 projects

Projects that are alternatives of or similar to laravel-etched-blade

Tui.editor
🍞📝 Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
Stars: ✭ 14,016 (+73668.42%)
Mutual labels:  commonmark
koino
CommonMark + GFM compatible Markdown parser and renderer
Stars: ✭ 81 (+326.32%)
Mutual labels:  commonmark
clj-pdf-markdown
Library for rendering markdown to clj-pdf data-structure syntax.
Stars: ✭ 20 (+5.26%)
Mutual labels:  commonmark
Markdownui
Render Markdown text in SwiftUI
Stars: ✭ 207 (+989.47%)
Mutual labels:  commonmark
Markdownlint
A Node.js style checker and lint tool for Markdown/CommonMark files.
Stars: ✭ 2,828 (+14784.21%)
Mutual labels:  commonmark
motion-markdown-it
Ruby/RubyMotion version of Markdown-it (CommonMark compliant parser and extendable)
Stars: ✭ 42 (+121.05%)
Mutual labels:  commonmark
Commonmark
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
Stars: ✭ 2,128 (+11100%)
Mutual labels:  commonmark
markdom
A markdown parser for laravel for making beautiful html
Stars: ✭ 42 (+121.05%)
Mutual labels:  commonmark
Lute
🎼 一款对中文语境优化的 Markdown 引擎,支持 Go 和 JavaScript。A structured Markdown engine that supports Go and JavaScript.
Stars: ✭ 222 (+1068.42%)
Mutual labels:  commonmark
markdown-toolbar
A clone of GitHub's markdown toolbar
Stars: ✭ 19 (+0%)
Mutual labels:  commonmark
Lute
🎼 一款结构化的 Markdown 引擎,支持 Go 和 JavaScript。
Stars: ✭ 211 (+1010.53%)
Mutual labels:  commonmark
Commonmark.py
Python CommonMark parser
Stars: ✭ 215 (+1031.58%)
Mutual labels:  commonmark
markdig.wpf
A WPF library for xoofx/markdig https://github.com/xoofx/markdig
Stars: ✭ 133 (+600%)
Mutual labels:  commonmark
Vditor
♏ 一款浏览器端的 Markdown 编辑器,支持所见即所得(富文本)、即时渲染(类似 Typora)和分屏预览模式。An In-browser Markdown editor, support WYSIWYG (Rich Text), Instant Rendering (Typora-like) and Split View modes.
Stars: ✭ 3,773 (+19757.89%)
Mutual labels:  commonmark
paka.cmark
Lightweight CFFI-based Python bindings to cmark library (CommonMark implementation in C).
Stars: ✭ 23 (+21.05%)
Mutual labels:  commonmark
Markdown
CommonMark-compliant markdown parser and renderer in Go. This repository has moved to https://gitlab.com/golang-commonmark/markdown
Stars: ✭ 180 (+847.37%)
Mutual labels:  commonmark
markdown
The first generation of Markdown rendering for R (born in 2012). Now R Markdown usually means the *r*markdown package instead of *markdown*. The repo for the former is at https://github.com/rstudio/rmarkdown
Stars: ✭ 64 (+236.84%)
Mutual labels:  commonmark
front-matter
The most featured front matter (yaml, json, neon, toml) parser and dumper for PHP.
Stars: ✭ 23 (+21.05%)
Mutual labels:  commonmark
swift-markdownkit
A framework for parsing and transforming text in Markdown format written in Swift 5 for macOS, iOS, and Linux. The supported syntax is based on the CommonMark specification. The framework defines an abstract syntax for Markdown, provides a parser for parsing strings into abstract syntax trees, and comes with generators for creating HTML and attr…
Stars: ✭ 64 (+236.84%)
Mutual labels:  commonmark
markdown-it-github-headings
Add anchors and links to headings just like Github does
Stars: ✭ 22 (+15.79%)
Mutual labels:  commonmark

A Laravel package that uses blade templates to parse and convert markdown to HTML

Packagist Version Packagist PHP Version Support GitHub codecov Build Status

Install

Install via composer.

$ composer require olliecodes/laravel-etched-blade

Once installed you'll want to publish the config.

$ php artisan vendor:publish --provider="OllieCodes\Etched\EtchedServiceProvider" --tag=config

If you want to modify the default themes you can publish those too.

$ php artisan vendor:publish --provider="OllieCodes\Etched\EtchedServiceProvider" --tag=views

Requirements

This package requires the following;

  • PHP >= 7.3 (Including 8).
  • illuminate/view >= 8.0 < 9.0 - The view component from Laravel.
  • league/commonmark >= 1.6 < 2.0 - The PHP league commonmark library, used for parsing the Markdown.
  • webuni/front-matter >= 1.2 < 2.0 - The front matter parser.

Usage

To render markdown in your blade files you can either do it inline;

@etched
# I am a heading

This is some content

 - I am a list
   - So am I but more
   - I'm the same
 - I'm less than those two
@endetched

Or by including a markdown file (.md)

@include('markdown.content.article-1')

The above references the file markdown/content/article-1.md, and the file will be rendered by etched the same way that blade files normally are.

Themes

You can control the theme used for the rendered markdown in several ways.

Provide it as an argument on the directive.

@etched('simple')
...
@endetched

As an argument when including.

@include('markdown-file', ['theme' => 'simple'])

Or in the front-matter of the markdown.

---
theme: simple
---

I am some content

If no theme is provided the value of etched.defaults.theme is used instead. If multiple are provided, the value from the front-matter will take precedence.

Advanced

All markdown rendering is handled by the OllieCodes\Etched\Etched::render() method.

You can use this method on an instance of Etched

app(\OllieCodes\Etched\Etched::class)->render($content, $theme);

Or using the facade.

\OllieCodes\Etched\Facades\Etched::render($content, $theme);

The second parameter $theme is optional and will default to the config value etched.defaults.theme. The theme will be overridden by the front-matter value if one is provided in the markdown content.

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].