PHP code example of marko / docs-markdown

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

    

marko / docs-markdown example snippets


use Marko\DocsMarkdown\MarkdownRepository;

$repo = $container->get(MarkdownRepository::class);

foreach ($repo->all() as $doc) {
    echo $doc->path;    // Relative path, e.g. "getting-started/installation.md"
    echo $doc->title;   // Extracted from first H1
    echo $doc->content; // Raw Markdown content
}

$doc = $repo->find('getting-started/installation');