-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from mcmtroffaes/feature/bibliography-tags
Support bibliography key prefixes.
- Loading branch information
Showing
11 changed files
with
163 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- "3.4" | ||
- "3.3" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extensions = ['sphinxcontrib.bibtex'] | ||
exclude_patterns = ['_build'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Contents | ||
======== | ||
|
||
.. toctree:: | ||
|
||
doc0 | ||
doc1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
doc0 | ||
---- | ||
|
||
:cite:`tag0-2009:mandel` | ||
:cite:`tag0-2003:evensen` | ||
|
||
.. bibliography:: test.bib | ||
:labelprefix: A | ||
:keyprefix: tag0- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
doc1 | ||
---- | ||
|
||
:cite:`tag1-2009:mandel` | ||
|
||
.. bibliography:: test.bib | ||
:labelprefix: B | ||
:keyprefix: tag1- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@Misc{2009:mandel, | ||
author = {Jan Mandel}, | ||
title = {A Brief Tutorial on the Ensemble {K}alman Filter}, | ||
howpublished = {arXiv:0901.3725v1 [physics.ao-ph]}, | ||
month = jan, | ||
year = {2009}, | ||
OPTnote = {}, | ||
OPTannote = {}, | ||
archivePrefix = {arXiv}, | ||
eprint = {0901.3725}, | ||
primaryClass = {physics.ao-ph} | ||
} | ||
|
||
@Article{2003:evensen, | ||
author = {Geir Evensen}, | ||
title = {The Ensemble {K}alman Filter: theoretical formulation and practical implementation}, | ||
journal = {Ocean Dynamics}, | ||
year = {2003}, | ||
OPTkey = {}, | ||
volume = {53}, | ||
number = {4}, | ||
pages = {343--367}, | ||
OPTmonth = {}, | ||
OPTnote = {}, | ||
OPTannote = {}, | ||
doi = {10.1007/s10236-003-0036-9} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
test_issue87 | ||
~~~~~~~~~~~~ | ||
Test bibliography tags. | ||
""" | ||
|
||
import os.path | ||
import re | ||
|
||
from sphinx_testing.util import path, with_app | ||
|
||
srcdir = path(__file__).dirname().joinpath('issue87').abspath() | ||
|
||
|
||
def teardown_module(): | ||
(srcdir / '_build').rmtree(True) | ||
|
||
|
||
@with_app(srcdir=srcdir, warningiserror=True) | ||
def test_issue87(app, status, warning): | ||
app.builder.build_all() | ||
with open(os.path.join(app.outdir, "doc0.html")) as stream: | ||
output = stream.read() | ||
assert re.search( | ||
'class="reference internal" href="#tag0-2009-mandel"', output) | ||
assert re.search( | ||
'class="reference internal" href="#tag0-2003-evensen"', output) | ||
assert re.search('AMan09', output) | ||
assert re.search('AEve03', output) | ||
with open(os.path.join(app.outdir, "doc1.html")) as stream: | ||
output = stream.read() | ||
assert re.search( | ||
'class="reference internal" href="#tag1-2009-mandel"', output) | ||
assert not re.search( | ||
'class="reference internal" href="#tag1-2003-evensen"', output) | ||
assert re.search('BMan09', output) | ||
assert not re.search('BEve03', output) |