| 1 |
|
| 2 |
import os |
| 3 |
import json |
| 4 |
|
| 5 |
from . import types, formatter |
| 6 |
|
| 7 |
|
| 8 |
DATA_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data') |
| 9 |
|
| 10 |
SCHEMA_PATH = os.path.join(DATA_PATH, 'schema', 'schemas', 'styles', 'csl.rng') |
| 11 |
LOCALES_PATH = os.path.join(DATA_PATH, 'locales') |
| 12 |
STYLES_PATH = os.path.join(DATA_PATH, 'styles') |
| 13 |
|
| 14 |
|
| 15 |
NAMES = ['author', 'collection_editor', 'composer', 'container_author', |
| 16 |
'editor', 'editorial_director', 'illustrator', 'interviewer', |
| 17 |
'original_author', 'recipient', 'translator'] |
| 18 |
|
| 19 |
DATES = ['accessed', 'container', 'event_date', 'issued', 'original_date', |
| 20 |
'submitted'] |
| 21 |
|
| 22 |
NUMBERS = ['chapter_number', 'collection_number', 'edition', 'issue', 'number', |
| 23 |
'number_of_pages', 'number_of_volumes', 'volume'] |
| 24 |
|
| 25 |
VARIABLES = (['abstract', 'annote', 'archive', 'archive_location', |
| 26 |
'archive_place', 'authority', 'call_number', 'citation_label', |
| 27 |
'citation_number', 'collection_title', 'container_title', |
| 28 |
'container_title_short', 'dimensions', 'DOI', 'event', |
| 29 |
'event_place', 'first_reference_note_number', 'genre', 'ISBN', |
| 30 |
'ISSN', 'jurisdiction', 'keyword', 'language', 'locator', |
| 31 |
'medium', 'note', 'original_publisher', |
| 32 |
'original_publisher_place', 'original_title', 'page', |
| 33 |
'page_first', 'PMCID', 'PMID', 'publisher', 'publisher_place', |
| 34 |
'references', 'section', 'source', 'status', 'title', |
| 35 |
'title_short', 'URL', 'version', 'year_suffix'] + |
| 36 |
NAMES + DATES + NUMBERS) |
| 37 |
|
| 38 |
with open(os.path.join(LOCALES_PATH, 'locales.json'), |
| 39 |
encoding='utf-8') as file: |
| 40 |
locales_json = json.load(file) |
| 41 |
PRIMARY_DIALECTS = locales_json['primary-dialects'] |
| 42 |
LANGUAGE_NAMES = locales_json['language-names'] |
| 43 |
|
| 44 |
|
| 45 |
from .frontend import CitationStylesStyle, CitationStylesBibliography |
| 46 |
from .source import Citation, CitationItem, Locator |
| 47 |
|
| 48 |
from . import _version |
| 49 |
__version__ = _version.get_versions()['version'] |