SimpleMd4PHP

A Markdown site engine for PHP in one file. Put .md files next to index.php and they are served as HTML pages.

It supports:

Install

  1. Copy index.php and .htaccess to your web root (or to a subfolder). It needs Apache with mod_rewrite and PHP 7.4 or newer.
  2. Add your pages:
URLFile
/index.md (or README.md)
/aboutabout.md
/docs/docs/index.md (or docs/README.md)
not found404.md (optional)

Images and other static files are served directly. Write relative links like [About](about) or ![photo](img/photo.jpg).

Speed

Settings

The settings are at the top of index.php:

const SITE_NAME = 'SimpleMd4PHP';       // appended to page titles
const SITE_LANG = 'en';
const CACHE_DIR = __DIR__ . '/.cache';  // '' disables the HTML cache
const MD_BREAKS = false;                // true: every newline is a <br>
const MD_ANCHORS = true;                // heading ids + "#" permalinks

To change the look, edit the <style> block in render_page(). The page <title> comes from the first # Heading.

License

MIT