Giter VIP home page Giter VIP logo

grav-plugin-shortcode-citation's Introduction

Pronouns: they/them

I'm a Coventry-based web developer specialising in Grav-based websites, themes and plugins.

Grav Plugins:

  • Embed Fontawesome: Dynamically inlines SVG icons.
  • Markdown Fontawesome: Provides access to icons via :emoji: syntax.
  • Markdown Typography: Provides unicode replacements for typographic characters.
  • File Browser: Safely provide visitors with access to a hosted folder via a familiar browser interface.
  • Shortcode Citations: Add citations to your posts with a simple shortcode syntax.
  • Glossary: Provide a glossary of terms to your users, and dynamically provide unabbreviated meaning for specified abbreviations.

Coming soon...

  • Analytics: Server-side analytics for your Grav website.
  • Bulma Forms: Bulma compatible templates for the Grav Form plugin.
  • Bulma Shortcodes: Shortcodes for useful Bulma elements and components.
  • ProseMirror Editor: Integrates a less developer-focused WYSIWYM editor.

grav-plugin-shortcode-citation's People

Contributors

n-parsons avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

grav-plugin-shortcode-citation's Issues

Page config won't be used, if page config is changed in "GUI"/Normal mode

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:

  1. Change the fields definition in blueprints/default.yaml (from "shortcode-citation" to "shortcode_citation").
  2. Change the TWIG template templates/partials/citations.html.twig (line 4 from "{% set page_config = page.header.shortcode_citation %}" to "{% set page_config = page.header.shortcode-citation %}"

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.

Bibliography not shown on the page

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.

reference list crashes

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

Anchor for citation not working as expected

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:

2019-07-24_10-11-09

2019-07-24_10-09-21

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

Citation numbers and links break in blog listings

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:

  • The citation anchor links will be to missing IDs (and printing a reference list here would result in a list of errors - the references don't exist in the header of the parent page!).
  • Instead of resetting between child pages, the reference number continue to increase and deviate from the numbers in the child pages.

Here are a few options for ideal behaviour, in order of preference:

  1. Keep the citation number, and update the link to point to the reference in the child page.
  2. Keep the citation number, but remove the link.
  3. Remove the citation from the summary, along with any preceding whitespace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.