No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

DenDenMarkdown (でんでんマークダウン)

by Densho Channel

Densho-chan the spirit of ebook will help your creation!

Illustration (c) JCN Inc. & Garakuta.

based on:

PHP Markdown Lib by Michel Fortin

Markdown by John Gruber


This library is implementing some features that make writing EPUB content documents easier.

  • GFM style line break
  • Block titles(bridgehead) [deprecated]
  • Global Language Support
    • Japanese Ruby Annotation
    • Tate-Chu-Yoko
  • Twitter account autolink syntax
  • Footnotes with epub:type attribute
  • EPUB pagebreak syntax
  • Chunk file syntax


This library package requires PHP 5.5 or later.

Before PHP 5.5, pcre.backtrack_limit defaults to 100 000, which is too small in many situations. You might need to set it to higher values. Later PHP releases defaults to 1 000 000, which is usually fine.

This library also requires Composer to use dependent library PHP Markdown Extra. Before using this library, install Composer and execute composer install.


$parser = new Denshoch\DenDenMarkdown;
$parser->tarnsform('Hello wolrd!');
// => <p>Hello wolrd!</p>


You can pass Harusame options which automatically add special classes for Tate-Chu-Yoko and text orientation in vertical writing mode. It is disabled by default.

$options = array("autoTcy"=>true, "tcyDigit" => 3, "autoTextOrientation" => true);
$parser = new Denshoch\DenDenMarkdown($options);
// => <p><span class="tcy">10</span>円玉と<span class="tcy">100</span>円玉がある<span class="upright">♡</span></p>
// or
$parser = new Denshoch\DenDenMarkdown();
$parser->autoTcy = true;
$parser->tcyDigit = 3;
$parser->autoTextOrientation = true;
// => <p><span class="tcy">10</span>円玉と<span class="tcy">100</span>円玉がある<span class="upright">♡</span></p>
key type inital description
autoTcy boolean false Add .tcy class or not.
tcyDigit integer 2 max digits of number to add .tcy class.
autoTextOrientation boolean false Add .upright and .sideways class or not.


Description of EPUB Markdown syntax is available on Sorry, currently Japanese version only.


  • Thanks to Makoto Kitaichi for supporting.

Copyright and License

DenDen Markdown
Copyright (c) 2013 Densho Channel
All rights reserved.

based on:

PHP Markdown Lib Copyright (c) 2004-2013 Michel Fortin
All rights reserved.

Copyright (c) 2003-2005 John Gruber All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name "Markdown" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.