-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
45 lines (42 loc) · 1.49 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
use Kirby\Cms\App as Kirby;
require_once __DIR__ . '/lib/footnotes.php';
Kirby::plugin('sylvainjule/footnotes', [
'options' => array(
'wrapper' => 'div',
'back' => '↩',
'links' => true,
),
'fieldMethods' => [
'footnotes' => function($field) {
return Footnotes::convert($field->text());
},
'ft' => function($field) {
return $field->footnotes();
},
'collectFootnotes' => function($field) {
$start = count(Footnotes::$footnotes) + 1;
return Footnotes::convert($field->text(), false, true, false, true, $start);
},
'removeFootnotes' => function($field) {
return Footnotes::convert($field->text(), true);
},
'withoutFootnotes' => function($field) {
return Footnotes::convert($field->text(), false, true);
},
'onlyFootnotes' => function($field) {
return Footnotes::convert($field->text(), false, false, true);
},
],
'blocksMethods' => [
'collectFootnotes' => function() {
$start = count(Footnotes::$footnotes) + 1;
return Footnotes::convert($this->toHtml(), false, true, false, false, $start);
},
],
'snippets' => [
'footnotes_container' => __DIR__ . '/snippets/container.php',
'footnotes_entry' => __DIR__ . '/snippets/entry.php',
'footnotes_reference' => __DIR__ . '/snippets/reference.php'
]
]);