n-parsons / grav-plugin-shortcode-citation Goto Github PK
View Code? Open in Web Editor NEWGrav plugin to add academic-style citations via shortcodes.
License: MIT License
Grav plugin to add academic-style citations via shortcodes.
License: MIT License
When a parent page (for example a blog listing) contains the content of child pages with citations in the summary, these citations act as though they are in the parent page.
This causes two problems:
Here are a few options for ideal behaviour, in order of preference:
Hi
If I change the config for Shortcode-Citation at page config by using the GUI/Normal mode (e.g. configure another text with "heading_text"), than this config haven't any effect.
The issue is based on saving the page config within section "shortcode-citation" (with dash) instead section "shortcode_citation" (with underscore). But, the TWIG template of Shortcode-Citation access the page config with an underscore.
There are two solutions:
From my point of view, the first option seems the better one: Page configs/YAML uses often variables with "underscore" instead "dashes", because "dash" has another meaning in YAML too.
Thanks so much @N-Parsons for this super-useful Plugin! It will be of great use to several of my open education-related projects.
One issue I seem to be having is the anchor for a citation leading to the reference list. I've added a citation with ID-1, and this is the HTML produced:
<a class="citation" href="#cite-1">[1]</a><br />
All good so far. But here is the HTML of the inserted list of References using the Shortcode:
<section class="references">
--
<h2>References</h2>
<ol>
<li id="2">
<span class="ref-title">"Another Test"</span>
</li>
</ol>
</section>
Am I missing something with my Shortcode? Here is what I have:
[cite=1 /]
[cite /]
BTW, I also notice only one of two citations seem to be listed, here is what I entered on the Page:
And here is the test page frontmatter:
references:
-
id: '1'
type: book
title: Test
-
id: '2'
type: book
title: 'Another Test'
Please let me know if I can help out more with testing etc.
Thanks very much,
Paul
Just found this plugin v0.2.0. Very promising. Just kicking the tires and can't create a reference list within a page.
I add the shortcode "[cite/]" (or any of the other variations) and the page completely crashes. The error I see is:
"Undefined variable: options"
Stack trace (huge) is below:
Whoops\Exception\ErrorException
…/user/plugins/shortcode-citation/shortcodes/CitationShortcode.php26
54
Grav\Common\Debugger deprecatedErrorHandler
…/user/plugins/shortcode-citation/shortcodes/CitationShortcode.php26
53
Grav\Plugin\Shortcodes\CitationShortcode Grav\Plugin\Shortcodes{closure}
…/user/plugins/shortcode-core/vendor/thunderer/shortcode/src/Processor/Processor.php138
52
Thunder\Shortcode\Processor\Processor processHandler
…/user/plugins/shortcode-core/vendor/thunderer/shortcode/src/Processor/Processor.php106
51
Thunder\Shortcode\Processor\Processor processIteration
…/user/plugins/shortcode-core/vendor/thunderer/shortcode/src/Processor/Processor.php53
50
Thunder\Shortcode\Processor\Processor process
…/user/plugins/shortcode-core/classes/plugin/ShortcodeManager.php270
49
Grav\Plugin\ShortcodeCore\ShortcodeManager processContent
…/user/plugins/shortcode-core/shortcode-core.php133
48
Grav\Plugin\ShortcodeCorePlugin processShortcodes
…/user/plugins/shortcode-core/shortcode-core.php107
47
Grav\Plugin\ShortcodeCorePlugin onPageContentProcessed
…/vendor/symfony/event-dispatcher/EventDispatcher.php264
46
Symfony\Component\EventDispatcher\EventDispatcher doDispatch
…/vendor/symfony/event-dispatcher/EventDispatcher.php239
45
Symfony\Component\EventDispatcher\EventDispatcher callListeners
…/vendor/symfony/event-dispatcher/EventDispatcher.php73
44
Symfony\Component\EventDispatcher\EventDispatcher dispatch
…/system/src/Grav/Common/Grav.php564
43
Grav\Common\Grav fireEvent
…/system/src/Grav/Common/Page/Page.php792
42
Grav\Common\Page\Page content
…/system/src/Grav/Common/Twig/Twig.php426
41
Grav\Common\Twig\Twig processSite
…/system/src/Grav/Common/Service/OutputServiceProvider.php36
40
Grav\Common\Service\OutputServiceProvider Grav\Common\Service{closure}
…/vendor/pimple/pimple/src/Pimple/Container.php118
39
Pimple\Container offsetGet
…/system/src/Grav/Common/Processors/RenderProcessor.php40
38
Grav\Common\Processors\RenderProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
37
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
36
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/DebuggerAssetsProcessor.php38
35
Grav\Common\Processors\DebuggerAssetsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
34
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
33
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/PagesProcessor.php98
32
Grav\Common\Processors\PagesProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
31
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
30
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/TwigProcessor.php38
29
Grav\Common\Processors\TwigProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
28
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
27
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/AssetsProcessor.php39
26
Grav\Common\Processors\AssetsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
25
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
24
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/SchedulerProcessor.php40
23
Grav\Common\Processors\SchedulerProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
22
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
21
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/BackupsProcessor.php39
20
Grav\Common\Processors\BackupsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
19
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
18
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/TasksProcessor.php69
17
Grav\Common\Processors\TasksProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
16
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
15
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/RequestProcessor.php63
14
Grav\Common\Processors\RequestProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
13
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
12
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/ThemesProcessor.php38
11
Grav\Common\Processors\ThemesProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
10
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
9
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/PluginsProcessor.php39
8
Grav\Common\Processors\PluginsProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
7
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
6
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Processors/InitializeProcessor.php130
5
Grav\Common\Processors\InitializeProcessor Grav\Common\Processors{closure}
…/system/src/Grav/Common/Debugger.php546
4
Grav\Common\Debugger profile
…/system/src/Grav/Common/Processors/InitializeProcessor.php131
3
Grav\Common\Processors\InitializeProcessor process
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
2
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
1
Grav\Framework\RequestHandler\RequestHandler handle
…/system/src/Grav/Common/Grav.php303
0
Grav\Common\Grav process
…/index.php58
Bibliography not shown on the page, even though I have filled in the mandatory ID number and title for each reference that should be listed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.