Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed Jan 16, 2025
1 parent e88d8ed commit cd41241
Show file tree
Hide file tree
Showing 7 changed files with 458 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ venv.bak/

# mypy
.mypy_cache/

# example
example/site
3 changes: 3 additions & 0 deletions example/docs/full_bib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This is a full bibliography

\full_bibliography
24 changes: 24 additions & 0 deletions example/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This is an example of how to use the mkdocs-bibtex plugin

## Citation

Citation [@test]

## Non existing citation

This should fail on --strict mode

Citation [@nonexistent]

## Citation with affix

Citation [@test, see pp. 100]

## Citation with multiple affixes

Citation [see @test, pp. 100, 200]


## Bibliography

\bibliography
16 changes: 16 additions & 0 deletions example/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
site_name: Example Mkdocs-bibtex

plugins:
- bibtex:
bib_file: refs.bib
#csl_file: nature.csl
csl_file: springer-basic-author-date.csl
cite_inline: false

markdown_extensions:
- footnotes
- pymdownx.caret

nav:
- Index: index.md
- Bibliography: full_bib.md
132 changes: 132 additions & 0 deletions example/nature.csl
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
<info>
<title>Nature</title>
<id>http://www.zotero.org/styles/nature</id>
<link href="http://www.zotero.org/styles/nature" rel="self"/>
<link href="http://www.nature.com/nature/authors/gta/index.html#a5.4" rel="documentation"/>
<link href="http://www.nature.com/srep/publish/guidelines#references" rel="documentation"/>
<author>
<name>Michael Berkowitz</name>
<email>mberkowi@gmu.edu</email>
</author>
<category citation-format="numeric"/>
<category field="science"/>
<category field="generic-base"/>
<issn>0028-0836</issn>
<eissn>1476-4687</eissn>
<updated>2019-10-08T13:18:12+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<macro name="title">
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text variable="title" font-style="italic"/>
</if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="author">
<names variable="author">
<name sort-separator=", " delimiter=", " and="symbol" initialize-with=". " delimiter-precedes-last="never" name-as-sort-order="all"/>
<label form="short" prefix=", "/>
<et-al font-style="italic"/>
</names>
</macro>
<macro name="access">
<choose>
<if variable="volume"/>
<else-if variable="DOI">
<text variable="DOI" prefix="doi:"/>
</else-if>
</choose>
</macro>
<macro name="issuance">
<choose>
<if type="bill book graphic legal_case legislation motion_picture song thesis chapter paper-conference" match="any">
<group delimiter="; " suffix=".">
<group delimiter=", " prefix="(" suffix=")">
<text variable="publisher" form="long"/>
<date variable="issued">
<date-part name="year"/>
</date>
</group>
</group>
</if>
<else-if type="report webpage post post-weblog" match="any">
<group delimiter=" ">
<text variable="URL"/>
<date date-parts="year" form="text" variable="issued" prefix="(" suffix=")"/>
</group>
</else-if>
<else>
<date variable="issued" prefix="(" suffix=")">
<date-part name="year"/>
</date>
</else>
</choose>
</macro>
<macro name="container-title">
<choose>
<if type="article-journal">
<text variable="container-title" font-style="italic" form="short"/>
</if>
<else>
<text variable="container-title" font-style="italic"/>
</else>
</choose>
</macro>
<macro name="editor">
<choose>
<if type="chapter paper-conference" match="any">
<names variable="editor" prefix="(" suffix=")">
<label form="short" suffix=" "/>
<name and="symbol" delimiter-precedes-last="never" initialize-with=". " name-as-sort-order="all"/>
</names>
</if>
</choose>
</macro>
<macro name="volume">
<choose>
<if type="article-journal" match="any">
<text variable="volume" font-weight="bold" suffix=","/>
</if>
<else>
<group delimiter=" ">
<label variable="volume" form="short"/>
<text variable="volume"/>
</group>
</else>
</choose>
</macro>
<citation collapse="citation-number">
<sort>
<key variable="citation-number"/>
</sort>
<layout vertical-align="sup" delimiter=",">
<text variable="citation-number"/>
</layout>
</citation>
<bibliography et-al-min="6" et-al-use-first="1" second-field-align="flush" entry-spacing="0" line-spacing="2">
<layout suffix=".">
<text variable="citation-number" suffix="."/>
<group delimiter=" ">
<text macro="author" suffix="."/>
<text macro="title" suffix="."/>
<choose>
<if type="chapter paper-conference" match="any">
<text term="in"/>
</if>
</choose>
<text macro="container-title"/>
<text macro="editor"/>
<text macro="volume"/>
<text variable="page"/>
<text macro="issuance"/>
<text macro="access"/>
</group>
</layout>
</bibliography>
</style>
41 changes: 41 additions & 0 deletions example/refs.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@article{test,
title={Test Title},
author={Author, First and Author, Second},
journal={Testing Journal},
volume={1},
year={2019},
publisher={Test_Publisher}
}

@article{test2,
title={{Test Title (TT)}},
author={Author, First and Author, Second},
journal={Testing Journal (TJ)},
volume={1},
year={2019},
publisher={Test_Publisher (TP)}
}

@article{Bivort2016,
title = {Evidence for Selective Attention in the Insect Brain},
author = {De Bivort, Benjamin L. and Van Swinderen, Bruno},
year = {2016},
volume = {15},
pages = {1--7},
issn = {22145753},
doi = {10.1016/j.cois.2016.02.007},
abstract = {The capacity for selective attention appears to be required by any animal responding to an environment containing multiple objects, although this has been difficult to study in smaller animals such as insects. Clear operational characteristics of attention however make study of this crucial brain function accessible to any animal model. Whereas earlier approaches have relied on freely behaving paradigms placed in an ecologically relevant context, recent tethered preparations have focused on brain imaging and electrophysiology in virtual reality environments. Insight into brain activity during attention-like behavior has revealed key elements of attention in the insect brain. Surprisingly, a variety of brain structures appear to be involved, suggesting that even in the smallest brains attention might involve widespread coordination of neural activity.},
journal = {Current Opinion in Insect Science},
keywords = {attention,bees,drosophila,insects},
pmid = {27436727}
}

@article{test_citavi,
title={{Test Title (TT)}},
author={Author, First and Author, Second},
journal={Testing Journal (TJ)},
volume={1},
year={2019},
publisher={Test_Publisher (TP)},
url = {\url{https://doi.org/10.21577/0103-5053.20190253}}
}
Loading

0 comments on commit cd41241

Please sign in to comment.