Apache Configuration supports markdown format

Source: Internet
Author: User
    • Markdown

Markdown is a markup language that can be written using an ordinary text editor, which can have a certain format for normal text content with simple markup syntax.

Markdown has a series of derivative versions that extend the functionality of markdown (such as tables, footnotes, embedded HTML, and so on) that the original markdown does not yet have, allowing Markdown to be converted into more formats, such as Latex,docbook. Markdown enhanced version of the more famous have markdown Extra, Multimarkdown, Maruku and so on. These derivative versions are either based on tools such as Pandoc, or based on web sites, such as GitHub and Wikipedia, which are syntactically basic compatible, but have some changes in syntax and rendering effects.

Such a beautiful markup language how do we support her, below we describe how to support markdown under the Apache server.

    • Parsedown

Parsedown is a PHP markdown parser, which is very fast and concise.

Plugin homepage:

http://parsedown.org/

Parsedown syntax is very simple.

$Parsedown = New Parsedown ();

Echo $Parsedown - text ('Hello _parsedown_!' ); # Prints:

Hello Parsedown!

    • Apache Configuration

Home, Apache needs to be configured to support PHP and then download Parsedown.

Configuration Increase in httpd.conf

Action markdown/markdown/handler.php
AddHandler Markdown. MD

Increase in handler.php

Require (' parsedown/parsedown.php ');
$file = Realpath ($_server[' path_translated ');
$Parsedown = new Parsedown ();
echo $Parsedown->text (file_get_contents ($file));

Others can be displayed according to their needs by adding some style styles.

The above describes the Apache configuration support markdown format, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.