PHP code example of goldnead / statamic-bard-footnotes

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

    

goldnead / statamic-bard-footnotes example snippets


use Goldnead\BardFootnotes\Footnotes;

// list of ['number' => 1, 'text' => 'Smith, p. 12', 'url' => 'https://…']
$sources = Footnotes::sources($entry->content);

return Inertia::render('Article', [
    'content' => $entry->content, // rendered HTML: the augment pass numbers and links
    'sources' => $sources,
]);

use Goldnead\BardFootnotes\Footnotes;
use Statamic\Fieldtypes\Bard\Augmentor;

$numbered = Footnotes::number($entry->content->raw()); // the whole field, once

foreach ($stretchesBetweenSets($numbered) as $part) {
    $html .= (new Augmentor($bardFieldtype))->convertToHtml($part);
}
bash
php artisan vendor:publish --tag=bard-footnotes-views