This Plugin should extend lektor with APA-styled citations using bibtex files. It was based on the known lektor-bibtex-support plugin by arunpersaud.
Project description
lektor-citation
An APA-styled citation plugin for the lektor static content management system (https://getlektor.com).
Preparations
Install the plugin by
lektor plugin add lektor-citation
or by copying this repository into the packages-folder of your lektor-project.
Create an citation.ini in its configs-folder:
[Bibtex]
file = Literature.bib
And put a Literature.bib BibTex-file into the project's assets-folder respectively.
Jinja_env
To get a formated output of your whole BibTex library you can either
- Use method citation_short_output in the template of your literature page. It creates an unordered list of entries.
<ul id="literatur">
{% for entry in citation_entries() %}
{{ citation_short_output(entry)|decode|safe }}
{% endfor %}
</ul>
- Use method citation_full_output instead. This creates a more complete html-output for every entry.
{% for entry in citation_entries() %}
{{ citation_full_output(entry)|decode|safe }}
{% endfor %}
produces
<h2>{title}</h2><h3>{authors} ({pubYear})</h3>
<p>{note}</p>
<dl class="literature">
<dt class="edition"></dt>
<dd>{edition}</dd>
<dt class="editors"></dt>
<dd>{editors}</dd>
<dt class="pages"></dt>
<dd>{pages}</dd>
<dt class="issbn"></dt>
<dd>{issbn}</dd>
<dt class="publisher"></dt>
<dd>{publisher}</dd>
</dl>
- You may also use the citation_entry method in combination with pybtex*s Entry-class. For example:
<ul>
{% for entry in citation_entries() %}
<li>{{ citation_entry(entry).fields['title'] |decode }}</li>
{% endfor %}
</ul>
This creates an unordered list of all the titles of your bibtex file. Of course you can also use citation_entry without a loop and put any id of your bibtex entries into it as parameter.
Limitations
It would be awesome if one could use s.th. like a cite(id)-function in the entire project to automatically convert it to proper links to the literature list.
Like e.g. <a href="/myproject/literature/#Stahl2015" class="litref">Stahl (2015)</a>
But as the only templates can make use of the functions this won't be possible for the markdown content of the page. Or maybe I just don't know how to implement this :shrug:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lektor_citation-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f7b5f2fb749b4cfa80a58881fdaf465667475d38111c559e3494833bf57435a |
|
MD5 | 4c87ddb1ee409cf403f65c527bf3c98c |
|
BLAKE2b-256 | 68a7421e487bc7d078b9e73628f3b41b58596aa9c65c551045b87ed3bb5d301e |