2017 © Pedro Peláez
 

library markdown

A laravel style markdown generator using static method calls

image

rtablada/markdown

A laravel style markdown generator using static method calls

  • Thursday, January 31, 2013
  • by rtablada
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Rtablada\Markdown

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)

Instalation

Using Composer:

{
    "require": {
        "Rtablada/Markdown": "0.1.*"
}

Use

All of the methods are static calls on the Rtablada\Markdown class., (*2)

Utilizes the composer autoloader., (*3)

use \Rtablada\Markdown\Markdown;, (*4)

Headings:

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)

Blockquotes

Block quotes support multiple lines where: Markdown::bockquote("Text\nNew Line) returns > Text\n> New Line, (*8)

Unordered Lists

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 List

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

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)

Emphasis

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

In line code can be created:, (*23)

Markdown::code('{{ Form::open() }}', '**') : `{{ Form::open()`, (*24)

Images

Images items will be made using: Markdown::image('http://placehold.it/350x150', 'alt') : ![alt](http://placehold.it/350x150), (*25)

The Versions

31/01 2013

dev-master

9999999-dev

A laravel style markdown generator using static method calls

  Sources   Download

MIT

The Requires

  • php >=5.3.8

 

laravel markdown