Skip to content

Commit

Permalink
doc(bibliograpy): more scope examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Andrés committed Nov 3, 2024
1 parent c3b0981 commit 7ee17cf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bibliograpy/demo/alt_1_cosmoloj_bib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from bibliograpy.api import *


MAP_PROJECTIONS = Book.generic(cite_key='map_projections',
editor='UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON',
publisher='',
title='Map Projections - A Working Manual',
year='1987',
non_standard=NonStandard(url='https://pubs.usgs.gov/pp/1395/report.pdf'),
scope=SHARED_SCOPE)
12 changes: 12 additions & 0 deletions bibliograpy/demo/alt_2_cosmoloj_bib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from bibliograpy.api import *

SCOPE: dict[str, Reference] = {}


MAP_PROJECTIONS = Book.generic(cite_key='map_projections',
editor='UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON',
publisher='',
title='Map Projections - A Working Manual',
year='1987',
non_standard=NonStandard(url='https://pubs.usgs.gov/pp/1395/report.pdf'),
scope=SCOPE)
5 changes: 5 additions & 0 deletions bibliograpy/demo/preprocess_and_use.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ echo
echo "bibliograpy proprocessing"
echo "========================="
echo
# with explicit import of the shared API scope
bibliograpy process cosmoloj.bib -o cosmoloj_bib.py -S 'from bibliograpy.api import SHARED_SCOPE' -s SHARED_SCOPE
# only use implicitly imported shared API scope
bibliograpy process cosmoloj.bib -o alt_1_cosmoloj_bib.py -s SHARED_SCOPE
# define a local bibliograpy scope
bibliograpy process cosmoloj.bib -o alt_2_cosmoloj_bib.py -S 'SCOPE: dict[str, Reference] = {}' -s SCOPE

# use bibliography
echo
Expand Down

0 comments on commit 7ee17cf

Please sign in to comment.