PHP Markdown & Extra

Last update: Jan 18, 2022

PHP Markdown & Extra

An updated and stripped version of the original PHP Markdown by Michel Fortin. Works quite well with PSR-0 autoloaders and is Composer friendly.

This Project Has Been Deprecated

Thank you for your interest in contributing to this package. Unfortunately, I do not plan to continue maintaining this package.

The original purpose of this package was to provide a way to get a PSR-0 and Composer friendly port of Michel Fortin's PHP Markdown library on Packagist. Michel was originally uninterested in Composer and did not want to make changes and said I was free to fork and maintain a special Composer package.

In January of 2013 (or around then) Michel finally joined the Composer bandwagon. More details can be found here. This means that the major reason this port existed (to be a Composer friendly port) effectively went away. This corresponded with the 1.3 release of PHP Markdown.

Additionally, other versions of PHP Markdown parsers have come into existence and are quite nice.

Please feel free to continue to use it as-is but if you are starting a new project I would recommend finding another library. If you have a project already depending on this package, I would recommend planning to migrate to something that is better maintained.

Thanks for your support and using this library over the years.


Changes from the official PHP Markdown & Extra

The initial pass at updating PHP Markdown & Extra left the core of the code more or less intact but the changes to the organization and naming were quite substantial. This effectively makes this package a hard fork from Markdown 1.0.1n and MarkdownExtra 1.2.4.

Updated in the following ways:

  • Moved parser classes into their own files
  • Using PHP 5.3 namespaces
  • Following PSR-0 standards
  • Replaced @define configuration variables with class const variables
  • Integrated with Travis CI
  • Made Composer friendly

Stripped in the following ways:

  • No more embedded plugin code (WordPress, bBlog, etc.)
  • No more top level function calls (Markdown(), etc.)

Last synced with:

  • PHP Markdown v1.0.1o
  • PHP Markdown Extra v1.2.5

Requirements

  • PHP 5.3+

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on dflydev/markdown to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on version 1.0 of this package:

{
    "require": {
        "dflydev/markdown": "1.0.*"
    }
}

Usage

Simple usage for the standard Markdown (details) parser:

Hello World
$markdownParser->transformMarkdown("#Hello World");

Simple usage for the Markdown Extra (details) parser:

Hello World
$markdownParser->transformMarkdown("#Hello World");

License

This library is licensed under the New BSD License - see the LICENSE file for details.

Community

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.

Not Invented Here

The original PHP Markdown was quite excellent but was not as easy to use as it could be in more modern PHP applications. Having started to use Composer for a few newer applications that needed to transform Markdown, I decided to strip and update the original PHP Markdown so that it could be more easily managed by the likes of Composer.

All of the initial work done for this library (which I can only assume was quite substantial after having looked at the code) was done by Michel Fortin during the original port from Perl to PHP.

If you do not need to install PHP Markdown by way of Composer or need to leverage PSR-0 autoloading, I suggest you continue to use the official and likely more stable and well used original version of PHP Markdown

GitHub

https://github.com/dflydev/dflydev-markdown
You might also like...

Easily add routes to your Laravel app by creating Markdown or Blade files

Laravel Pages This package lets you create pages using Markdown or Blade without having to worry about creating routes or controllers yourself. Essent

Jul 6, 2022

Render colored Markdown contents on console terminal

Render colored  Markdown contents on console terminal

cli-markdown Render colored markdown contents on console terminal Preview run demo by php example/demo.php Features support auto render color on termi

Jan 27, 2022

Generate pseudo-static pages from markdown and HTML files for Flarum

Flarum Pages Generator This is not a Flarum extension. This package provides a Flarum extender that you can use in the local extend.php to define cust

Feb 21, 2022

markdown wiki/blog

markdown wiki/blog

Kwiki markdown wiki/blog Usage Place your markdown files in the /wiki directory. Categories are directories and subcategories are subdirectories. If y

May 29, 2022

Symfony 5 bundle to easily create dynamic subpages with Markdown. Useful for help sections and wikis.

MarkdownWikiBundle This bundle allows you to create rich subpages in a Symfony project using Markdown. Pages are stored in a file cache and sourced fr

Apr 26, 2022

Gruik ! An open-source markdown note-taking web app. [ABANDONED PROJECT]

What is Gruik ? It's a free & open-source note-taking service. A space where you can store notes, tutorials, code snippets... by writing them in markd

Mar 31, 2022

Docbook Tool for static documentation generation from Markdown files

Roave Docbook Tool Static HTML and PDF generator tool for generating documentation from Markdown files. Generates a deployable HTML file from Markdown

Aug 1, 2022

PHP Documentation system.

PHP Documentation system Simple but powerful Markdown docs. Features Search within Markdown files Customizable Twig templates (Note: default design is

Jun 8, 2022

Parser for Markdown and Markdown Extra derived from the original Markdown.pl by John Gruber.

PHP Markdown PHP Markdown Lib 1.9.0 - 1 Dec 2019 by Michel Fortin https://michelf.ca/ based on Markdown by John Gruber https://daringfireball.net/ Int

Aug 5, 2022

PHP Markdown & Extra

PHP Markdown & Extra An updated and stripped version of the original PHP Markdown by Michel Fortin. Works quite well with PSR-0 autoloaders and is Com

Jan 18, 2022

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

A package that uses blade templates to control how markdown is converted to HTML inside Laravel, as well as providing support for markdown files to Laravel views.

Install Install via composer. $ composer require olliecodes/laravel-etched-blade Once installed you'll want to publish the config. $ php artisan vendo

Jul 5, 2021

PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace

MODX Extra Publisher PHP CLI tool which allows publishing zipped MODX extra to modstore.pro marketplace. Installation global? local? To install packag

Aug 6, 2021

Tentative Extra Data Structures for php

Teds Introduction Teds is a another collection of data structures. (Tentative Extra Data Structures) Installation This extension requires php 8.0 or n

Aug 14, 2022

A simple PHP MVC framework without extra files and codes that you don't need

Welcome to (SPM) Simple PHP MVC, just what you need! This is a simple PHP MVC framework without extra files and codes that you don't need.

Aug 4, 2022

A drop-in library for certain database functionality in Laravel, that allows for extra features that may never make it into the main project.

Eloquence Eloquence is a package to extend Laravel's base Eloquent models and functionality. It provides a number of utilities and classes to work wit

Jul 13, 2022

Library extra fields for Laravel Orchid Platform

Library extra fields for Laravel Orchid Platform

Orchid Fields Extra library which add different fields in Laravel Orchid Platform Installation You may install into your project using the Composer pa

Jul 13, 2022

Extra RedBean ORM

RedBeanPHP 5 RedBeanPHP is an easy to use ORM tool for PHP. Automatically creates tables and columns as you go No configuration, just fire and forget

Nov 12, 2021

Updated project with extra Features like WISHLIST, List Orders, add Reviews, updated routing, resolved search bug is available for Premium

Updated project with extra Features like WISHLIST, List Orders, add Reviews, updated routing, resolved search bug is available for Premium Projects We

Nov 23, 2021
Comments
  • 1. Refactoring and coding improvement

    • better compliance with PSR-0 and PSR-1 accepted guidelines.
    • installation of PDC
    • better testing through PHPUnit fixtures and abstract parser testing
    • test fixes in commit 90c3e2b035c460ff329b28a5216a3aeb21a41c4a
    Reviewed by mauris at 2012-12-17 14:12
  • 2. [Request] Add support for fenced code block class and id names

    Michel's library supports class and id names. Can this package be updated so it supports this as well?

    The feature: http://michelf.ca/projects/php-markdown/extra/#fenced-code-blocks

    Probably needs this code: https://github.com/michelf/php-markdown/blob/lib/Michelf/Markdown.php#L2756-L2819

    Thanks for having a look!

    Reviewed by driesvints at 2013-10-08 10:50
Better Markdown Parser in PHP
Better Markdown Parser in PHP

Parsedown Better Markdown Parser in PHP - Demo. Features One File No Dependencies Super Fast Extensible GitHub flavored Tested in 5.3 to 7.3 Markdown

Aug 11, 2022
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.

league/commonmark league/commonmark is a highly-extensible PHP Markdown parser created by Colin O'Dell which supports the full CommonMark spec and Git

Aug 6, 2022
Convert HTML to Markdown with PHP

HTML To Markdown for PHP Library which converts HTML to Markdown for your sanity and convenience. Requires: PHP 7.2+ Lead Developer: @colinodell Origi

Aug 11, 2022
A PHP tool to generate templateable markdown documentation from the docblocks or type-hints of your codebase.

Roster Installation To install, simply require the package using composer: composer require

Sep 8, 2021
PHP Markdown Engine Support

PHP Markdown Version v1.x support all PHP version >=5.4 v2.x support all PHP version >=7.0 Cài đặt thư viện Thư viện này được cài đặt thông qua Compos

Jul 1, 2022
Rendering markdown from PHP code

JBZoo / Markdown Installing composer require jbzoo/markdown Usage Rendering Table <?php declare(strict_types=1); use JBZoo\Markdown\Table; echo (new

Dec 26, 2021
A simple regex-based Markdown parser in PHP

Slimdown A simple regex-based Markdown parser in PHP. Supports the following elements (and can be extended via Slimdown::add_rule()): Headers Links Bo

Jul 27, 2022
A super lightweight Markdown parser for PHP projects and applications.

A speedy Markdown parser for PHP applications. This is a super lightweight Markdown parser for PHP projects and applications. It has a rather verbose

May 31, 2022
PHP based Markdown documentation viewer

PHP based viewer for Markdown files, to view them with fenced code highlighting and navigation.

Mar 31, 2022
A highly configurable markdown renderer and Blade component for Laravel
A highly configurable markdown renderer and Blade component for Laravel

A highly configurable markdown renderer and Blade component for Laravel This package contains: a Blade component that can render markdown a highly con

Aug 13, 2022