PHP code example of jedamzik / statamic-toc

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

    

jedamzik / statamic-toc example snippets


return [
    'collections' => [
        'posts' => 'content'
    ],
    ...
];

return [
    ...
    '

return [
    ...
    'anchorLinks' => true
];

Markdown::addExtension(function () {
    return new \Njed\Toc\Extensions\CommonMark\TitleAnchorIdExtension;
});

Markdown::extend('special', function ($parser) {
    return $parser
        ->withStatamicDefaults()
        ->addExtension(function () {
            return new \Njed\Toc\Extensions\CommonMark\TitleAnchorIdExtension;
        });
});
bash
php artisan vendor:publish