PHP code example of new-humans / markdown-article-library

1. Go to this page and download the library: Download new-humans/markdown-article-library 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/ */

    

new-humans / markdown-article-library example snippets

 php
use NewHumans\MarkdownArticleLibrary\ArticleLibrary;

// Instantiate the ArticleLibrary
$articleLibrary = new ArticleLibrary(__DIR__.'/articles');

// Instatiate the subject 'notes'
$articleLibrary->newSubject("notes");

// Instantiate the article 'grocery.md' to key 'grocery' within subject 'notes'
$articleLibrary->newArticle("notes", "grocery.md", "grocery");

// Output the article contents to client (HMTL or download)
echo $articleLibrary->readArticle("notes", "grocery");
// or $articleLibrary->downloadArticle("notes", "grocery");