A basic markdown handler for Apache that utilizes erusev/parsedown and erusev/parsedown-extra for rendering markdown files in Apache.
To install simply run composer install
in the root of the apache markdown handler's directory this will pull the dependencies into your install. After that configuring is pretty simple you just need to add the following lines to the htaccess file in the root of your www root or into the vhost entry. Once that's done simply verify it's working by hitting a markdown file somewhere on your server.
Action markdown /path/to/markdown-handler/handler.php
AddHandler markdown .md
There are 3 ways the browser title is decided from the markdown:
- Title meta data, you can define a title using the title meta data. For this to work the first line of your markdown must be like the following:
title: My Title
- If the first line of the rendered markdown is an
<h1>
tag the value of that tag will be used. - If none of the above find a title then the file name is used, all dashes and underscores in the name are replaced with spaces, the file extension is removed and then each word is set to it's proper case. Meaning
my-example-markdown.md
would becomeMy Example Markdown
as the browser title.