Download the PHP package ntzwbr/markdown without Composer

On this page you can find all versions of the php package ntzwbr/markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package markdown

A super fast, highly extensible markdown parser for PHP

Latest Stable Version Total Downloads Build Status Tested against HHVM Code Coverage

Markdown Grid Extension

A new Flavor to cebe/markdown inspired by https://github.com/dreikanter/markdown-grid

This is Markdown extension for grid building. It provides minimal and straightforward syntax to create multicolumn text layouts. By default the extension generates Twitter Bootstrap compatible HTML code but it is intended to be template-agnostic. It could be configured to use any other HTML/CSS framework (e.g. Skeleton) or custom design.

The Syntax

Markdown syntax extension is pretty simple. Page source example below defines a three-column page fragment:

Comma separated list of numbers after the row instruction is an optional definition for columns width. This example uses 12-column Twitter Bootstrap grid, so "5, 2, 5" corresponds to "41.5%, 17%, 41.5%" relatively to the total page width.

Usage

In your PHP project

To parse your markdown you need only two lines of code. The first one is to choose the markdown flavor as one of the following:

The next step is to call the parse()-method for parsing the text using the full markdown language or calling the parseParagraph()-method to parse only inline elements.

Here are some examples:

You may optionally set one of the following options on the parser object:

For all Markdown Flavors:

For GithubMarkdown:

The command line script

You can use it to render this readme:

bin/markdown README.md > README.html

Using github flavored markdown:

bin/markdown --flavor=gfm README.md > README.html

or convert the original markdown description to html using the unix pipe:

curl http://daringfireball.net/projects/markdown/syntax.text | bin/markdown > md.html

Here is the full Help output you will see when running bin/markdown --help:

PHP Markdown to HTML converter
------------------------------

by Carsten Brandt <[email protected]>

Usage:
    bin/markdown [--flavor=<flavor>] [file.md]

    --flavor  specifies the markdown flavor to use. If omitted the original markdown by John Gruber [1] will be used.
              Available flavors:

              gfm   - Github flavored markdown [2]
              extra - Markdown Extra [3]

    --help    shows this usage information.

    If no file is specified input will be read from STDIN.

Examples:

    Render a file with original markdown:

        bin/markdown README.md > README.html

    Render a file using gihtub flavored markdown:

        bin/markdown --flavor=gfm README.md > README.html

    Convert the original markdown description to html using STDIN:

        curl http://daringfireball.net/projects/markdown/syntax.text | bin/markdown > md.html

[1] http://daringfireball.net/projects/markdown/syntax
[2] https://help.github.com/articles/github-flavored-markdown
[3] http://michelf.ca/projects/php-markdown/extra/

Extending the language

Markdown consists of two types of language elements, I'll call them block and inline elements simlar to what you have in HTML with <div> and <span>. Block elements are normally spreads over several lines and are separated by blank lines. The most basic block element is a paragraph (<p>). Inline elements are elements that are added inside of block elements i.e. inside of text.

This markdown parser allows you to extend the markdown language by changing existing elements behavior and also adding new block and inline elements. You do this by extending from the parser class and adding/overriding class methods and properties. For the different element types there are different ways to extend them as you will see in the following sections.

Adding block elements

The markdown is parsed line by line to identify each non-empty line as one of the block element types. This job is performed by the indentifyLine() method which takes the array of lines and the number of the current line to identify as an argument. This method returns the name of the identified block element which will then be used to parse it. In the following example we will implement support for fenced code blocks which are part of the github flavored markdown.

                  "Fenced code block feature of github flavored markdown"

', 3) === 0) { return 'fencedCode'; } return parent::identifyLine($lines, $current); }

// ...

}

  1. "rendering" the element. After all blocks have been consumed, they are being rendered using the render{blockName}() method:

    You may also add code highlighting here. In general it would also be possible to render ouput in a different language than HTML for example LaTeX.

Adding inline elements

Adding inline elements is different from block elements as they are directly parsed in the text where they occur. An inline element is identified by a marker that marks the beginning of an inline element (e.g. [ will mark a possible beginning of a link or ` will mark inline code).

Inline markers are declared in the inlineMarkers()-method which returns a map from marker to parser method. That method will then be called when a marker is found in the text. As an argument it takes the text starting at the position of the marker. The parser method will return an array containing the text to append to the parsed markup and an offset of text it has parsed from the input markdown. All text up to this offset will be removed from the markdown before the next marker will be searched.

As an example, we will add support for the strikethrough feature of github flavored markdown:

Am I free to use this?

This library is open source and licensed under the MIT License. This means that you can do whatever you want with it as long as you mention my name and include the [license file][license]. Check the [license][] for details.


All versions of markdown with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
lib-pcre Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ntzwbr/markdown contains the following files

Loading the files please wait ....