PHP code example of czukowski / markdown-toc
1. Go to this page and download the library: Download czukowski/markdown-toc 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/ */
czukowski / markdown-toc example snippets
$markdown = new MyMarkdownWithTOC;
// Generate ToC from a single file:
$toc1 = $markdown->generateTableOfContents($source, 'index.md');
// Generate ToC from multiple files:
$toc2 = $markdown->generateTableOfContentsFromMultiple([
[$intro, 'intro.md'],
[$issues, 'issues.md'],
[$reference, 'reference.md'],
]);