1. Go to this page and download the library: Download ckunkle/markdownwriter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ckunkle / markdownwriter example snippets
= new \MarkdownWriter\Writer();
$md->h1("Example Markdown")
->p("This class makes generating markdown using PHP quick and convenient")
->ol([
"Here is",
"An ordered list",
"With",
[
"Nested",
[
"Sublists"
],
],
])
->blockQuote("View the API documentation below to learn more features");
$md->italic("test");
$md->bold("test");
$md->superscript("test");
$md->subscript("test");
$md->code("test");
$md->strikethrough("test");
$md->link("test", "http://example.com");
$md->image("test", "path/to/file.png");
$md->write("A string of text");
$md->write(" Another string of text");
echo($md);
$md->block("A string of text");
$md->block("Another string of text");
echo($md);
$md->p("A string of text");
$md->p("Another string of text");
echo($md);
$md->write("A string of text");
$md->nl();
$md->nl();
$md->write("Another string of text");
echo($md);
//or pass an integer for multiple newlines
$md->write("A string of text");
$md->nl(2);
$md->write("Another string of text");
echo($md);
$md->blockQuote("Pass a string for simple block quote...");
$md->blockQuote([
"Or an array for",
"a multiline block quote",
]);
$md->blockQuote(function($md) {
$md->p("This blockquote uses a callback")
->p("This allows us to use the writer's functionality to create content")
->blockQuote([
"including",
"block quotes"
]);
});