dev-master
9999999-devA laravel style markdown generator using static method calls
MIT
The Requires
- php >=5.3.8
by Ryan Tablada
laravel markdown
Wallogit.com
2017 © Pedro Peláez
A laravel style markdown generator using static method calls
A lightweight Laravel style markdown creator in PHP for composer. The code structure follows the syntax listed at http://daringfireball.net/projects/markdown/syntax, (*1)
{
"require": {
"Rtablada/Markdown": "0.1.*"
}
All of the methods are static calls on the Rtablada\Markdown class., (*2)
Utilizes the composer autoloader., (*3)
use \Rtablada\Markdown\Markdown;, (*4)
Simple calls will return h1 elements:
Markdown::heading('Text') returns # Text, (*5)
A heading level can also be called as the first argument:
Markdown::heading( 2, 'Text') returns ## Text, (*6)
If multiple lines are passed to the heading method, only the first line is made a heading and all other text is left as is.
Markdown::heading("Text\nNew Line) returns # Text\nNew Line, (*7)
Block quotes support multiple lines where:
Markdown::bockquote("Text\nNew Line) returns > Text\n> New Line, (*8)
Unorderd lists can be made using an array of strings or a multiline string. It also accepts an optional marker option which allows the user to specify either an astrik or underscore (astriks are used by default)., (*9)
Markdown::ul(['first', 'second'], '_') and Markdown::ul("first\nsecond"], '_') both produce:
1. first\n2. second, (*10)
Ordered Lists work similar to unordered lists. The optional second argument accepts the start point for the ordered list., (*11)
Markdown::ol(['first', 'second']) and Markdown::ol("first\nsecond"], '1') both produce:
1. first\n2. second, (*12)
Code blocks create a tabbed in area which is translated as a multiline code block:, (*13)
Markdown::codeblock("first\nsecond")
produces:
\tfirst\n\tsecond', (*14)
Links can be created as quick links:, (*15)
Markdown::link('http:://google.com') : <http:://google.com>, (*16)
Or fully functioning markup links:, (*17)
Markdown::link('http:://google.com', 'Text', 'Title') : [Text](http:://google.com Title)>, (*18)
em can be created with the em method:, (*19)
Markdown::em('text') : *text*, (*20)
so can strong blocks:, (*21)
Markdown::em('text', '**') : **text**
Markdown::em('text', '_') : _text_, (*22)
In line code can be created:, (*23)
Markdown::code('{{ Form::open() }}', '**') : `{{ Form::open()`, (*24)
Images items will be made using:
Markdown::image('http://placehold.it/350x150', 'alt') : , (*25)
A laravel style markdown generator using static method calls
MIT
laravel markdown