: This article describes how to configure Apache to support the markdown format. For more information about PHP tutorials, see.
Markdown is a markup language that can be written in a common text editor. through simple markup syntax, Markdown can make the common text content have a certain format.
Markdown has a series of derivative versions used to extend Markdown functions (such as tables, memos, embedded HTML, and so on). These functions are not available in the original Markdown, and they allow Markdown to be converted into more formats, for example, LaTeX and Docbook. The Markdown enhanced edition is famous for its Markdown Extra, MultiMarkdown, and Maruku. These derivative versions are either based on tools, such as Pandoc; or based on websites such as GitHub and Wikipedia, which are syntactically compatible, but with some modifications to syntax and rendering effects.
How can we support this awesome markup language? next we will introduce how to support markdown on the Apache server.
Parsedown is a PHP Markdown parser, which is fast and concise.
Plug-In homepage:
Http://parsedown.org/
Parsedown syntax is very simple.
$ Parsedown = new Parsedown ();
Echo $ Parsedown-> text ('Hello _ Parsedown _! '); # Prints:
HelloParsedown!
On the home page, Apache needs to be configured to support PHP and then download parsedown.
Add configuration in httpd. conf
Action markdown/handler. php
AddHandler markdown. md
Add in handler. php
Require ('parsedown/parsedown. php ');
$ File = realpath ($ _ SERVER ['path _ TRANSLATED ']);
$ Parsedown = new Parsedown ();
Echo $ Parsedown-> text (file_get_contents ($ file ));
Others can add some style display as needed.
The above introduces the support for markdown format for Apache configuration, including content, and hope to be helpful to friends who are interested in PHP tutorials.