From 756756595bf61dbcf14ca36ef3e5bee2edc14a7e Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Thu, 7 Mar 2013 08:28:44 -0500 Subject: [PATCH] Updates to readme file. --- Readme.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Readme.md b/Readme.md index 1fe63f0..6d05303 100644 --- a/Readme.md +++ b/Readme.md @@ -33,8 +33,8 @@ Full documentation of Markdown's syntax is available on John's Markdown page: -Installation and Requirement ----------------------------- +Requirement +----------- This library package requires PHP 5.3 or later. @@ -49,29 +49,35 @@ releases defaults to 1 000 000, which is usually fine. Usage ----- -You can use PHP Markdown easily in your PHP program. This library package -is meant to be used with autoloading, so putting the 'Michelf' folder -in your include path should be enough for this to work: +This library package is meant to be used with class autoloading. For autoloading +to work, your project needs have setup a PSR-0-compatible autoloader. See the +included Readme.php file for a minimal autoloader setup. (If you don't want to +use autoloading you can do a classic `require_once` to manually include the +files prior use instead.) + +With class autoloading in place, putting the 'Michelf' folder in your +include path should be enough for this to work: use \Michelf\Markdown; $my_html = Markdown::defaultTransform($my_text); -PHP Markdown Extra is also available the same way: +Markdown Extra syntax is also available the same way: use \Michelf\MarkdownExtra; $my_html = MarkdownExtra::defaultTransform($my_text); If you wish to use PHP Markdown with another text filter function -built to parse HTML, you should filter the text *after* the Markdown +built to parse HTML, you should filter the text *after* the `transform` function call. This is an example with [PHP SmartyPants][psp]: use \Michelf\Markdown, \Michelf\SmartyPants; $my_html = Markdown::defaultTransform($my_text); $my_html = SmartyPants::defaultTransform($my_html); -All these examples are using the static `markdown` function found inside the -parser class. If you want to customize the parser, you can also instantiate -it directly and change some configuration variables: +All these examples are using the static `defaultTransform` static function +found inside the parser class. If you want to customize the parser +configuration, you can also instantiate it directly and change some +configuration variables: use \Michelf\MarkdownExtra; $parser = new MarkdownExtra;