michelf/php-markdown
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The PHP library package michelf/php-markdown is a utility for web writers. It facilitates the conversion of easy-to-read and write plain text content into structurally valid XHTML or HTML. This package encompasses two primary components; the PHP Markdown parser and PHP Markdown Extra which embodies additional features. It is a PHP replica of the original Markdown program authored in Perl by John Gruber.
To effectively utilize the michelf/php-markdown, you can install it using Composer with the command $ composer require michelf/php-markdown
. Once installed, enable autoloading by including the Composer's generated vendor file vendor/autoload.php
. With the class autoloading in place, you can use PHP Markdown and PHP Markdown Extra in your project like in the examples below:
For PHP Markdown:
use Michelf\Markdown;
$my_html = Markdown::defaultTransform($my_text);
For PHP Markdown Extra:
use Michelf\MarkdownExtra;
$my_html = MarkdownExtra::defaultTransform($my_text);
In case autoloading is not available, the parser can still be accessed by including the Michelf/Markdown.inc.php
or Michelf/MarkdownExtra.inc.php
.
The complete documentation of the michelf/php-markdown, including the PHP Markdown syntax and Markdown Extra additions, are hosted by their respective authors; John Gruber and Michel Fortin. The documentation for the Markdown syntax can be accessed at John Gruber’s Daring Fireball while the Markdown Extra syntax additions are available on Michel Fortin's website. For additional details about parser configuration, refer to the project’s configuration section.