Home

Awesome

MDEditor

MDEditor-Logo

A free and opensource MarkDown editor, with the support of exporting HTML and PDF.

Installation

Automatic installation and running in GNU/Linux:

Installing Requirements:

Installing Project:

git clone https://github.com/TadavomnisT/MDEditor.git
cd MDEditor
chmod +x start_gui.sh

Running GUI:

./start_gui.sh

Installing and running manually:

sudo apt install php
sudo apt install php-mbstring
git clone https://github.com/TadavomnisT/MDEditor.git
cd MDEditor
php -S 127.0.0.1:8989

Then open the url http://127.0.0.1:8989/ with a browser.

Just include MDEditor.php and use it:

require_once "MDEditor.php";
$mde = new MDEditor;

Screenshots

image image

image image

Library API

Please refer to ./test directory for more examples.

<?php

require_once "MDEditor.php";
$mde = new MDEditor;

$mde->setDocumentStyle("light");
$html = $mde->md2html( "./tests/sample.md" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html", $html);
$pdf = $mde->html2pdf( "./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".pdf", $pdf);

$mde->setDocumentStyle("dark_black");
$html = $mde->md2html( "./tests/sample.md" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html", $html);
$pdf = $mde->html2pdf( "./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".pdf", $pdf);

$mde->setDocumentStyle("toggle_darkmodeblack_dark");
$html = $mde->md2html( "./tests/sample.md" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html", $html);
$pdf = $mde->html2pdf( "./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".pdf", $pdf);

$mde->setDocumentWidth(960);

$mde->setDocumentStyle("toggle_darkmodegray_white");
$html = $mde->md2html( "./tests/sample.md" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html", $html);
$pdf = $mde->html2pdf( "./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".html" );
file_put_contents("./tests/test_" . $mde->getDocumentStyle() . $mde->getDocumentWidth() . ".pdf", $pdf);
?>

Todo-List

Available document styles

Available document styles:
light
light_960px
dark_black
dark_black_960px
dark_gray
dark_gray_960px
toggle_darkmodeblack_white
toggle_darkmodeblack_white_960px
toggle_darkmodegray_white
toggle_darkmodegray_white_960px
toggle_darkmodeblack_dark
toggle_darkmodeblack_dark_960px
toggle_darkmodegray_dark
toggle_darkmodegray_dark_960px

Acknowledgements

This project is powered by:

Inspiration:

Contributors:

License: