PHP code example of conde-nast-international / copilot-markdown-generator

1. Go to this page and download the library: Download conde-nast-international/copilot-markdown-generator 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/ */

    

conde-nast-international / copilot-markdown-generator example snippets


use CopilotTags\Text;

$tag = new Text("Hello world!");
$markdown = $tag->render();
echo $markdown;
// Hello world!

addcslashes($content, "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");

(new Text("Hello world!"))->render();
// "Hello world!"

(new Heading("Hello world!", 3))->render();
// "\n\n### Hello world!\n"

(new Paragraph("Hello world!"))->render();
// "\n\nHello world!\n\n"

(new InlineText("Hello world!", InlineTextDelimiter::EMPHASIS))->render();
// "*Hello world!*"

(new Link("Hello world!", "https://github.com/"))->render();
// "[Hello world!](https://github.com/)"
(new Link("Hello world!", "https://github.com/", array("rel"=>"nofollow")))->render();
// "[Hello world!](https://github.com/){: rel=\"nofollow\" }"

(new Blockquote("Hello world!"))->render();
// "\n> Hello world!\n"

(new ListTag(["First", "Second"]))->render();
// "\n\n* First\n* Second\n\n"
(new ListTag(["First", "Second"], TRUE))->render();
// "\n\n1. First\n2. Second\n\n"

(new Embed("https://github.com", EmbedSubtype::IFRAME))->render();
// "\n\n[#iframe: https://github.com]\n\n"
(new Embed("https://github.com", EmbedSubtype::IFRAME, "My caption."))->render();
// "\n\n[#iframe: https://github.com]|||My caption.|||\n\n"