diff --git a/config/eoaconvert.cfg b/config/eoaconvert.cfg index 208fd96..8a859ed 100644 --- a/config/eoaconvert.cfg +++ b/config/eoaconvert.cfg @@ -14,3 +14,4 @@ TRALICS_PATH_EXEC: /Users/kthoden/bin/tralics-2.15.4 TRALICS_PATH_LIB: /Users/kthoden/EOAKram/dev/EOASkripts/config/ TEMPLATE_PATH: /Users/kthoden/EOAKram/dev/EOASkripts/data/aux/ SUPPORT_PATH: /Users/kthoden/EOAKram/dev/EOASkripts/data/dtd_files/ +CSL_FILE: /Users/kthoden/EOAKram/dev/eoa-csl/chicago-author-date-custom.csl \ No newline at end of file diff --git a/libeoaconvert.py b/libeoaconvert.py index 2013e66..27329fd 100644 --- a/libeoaconvert.py +++ b/libeoaconvert.py @@ -9,7 +9,6 @@ import configparser from lxml.html import soupparser - ################################## # Reading the configuration file # ################################## @@ -17,13 +16,14 @@ CONFIG = configparser.ConfigParser() CONFIG.read(CONFIG_FILE) - ###################### # Setting up logging # ###################### LOGFILE = CONFIG['General']['logfile'] LOGLEVEL = CONFIG['General']['loglevel'] +CSL_FILE = CONFIG['Auxiliaries']['CSL_FILE'] + logging.basicConfig(level=LOGLEVEL, format='%(asctime)s - %(levelname)s - %(message)s') @@ -172,7 +172,7 @@ def format_citations(used_citekeys, bibdata, language): # citation_formatter.write("@%s\n" % entry) citation_formatter.write("\n# References\n") - command = "pandoc -o tmp_files/formatted_citations.html -t html --filter=pandoc-citeproc --bibliography=%s --csl=/Users/kthoden/EOAKram/dev/eoa-csl/eoa.csl tmp_files/used_citations.md" % bibdata + command = "pandoc -o tmp_files/formatted_citations.html -t html --filter=pandoc-citeproc --bibliography=%s --csl=%s tmp_files/used_citations.md" % (CSL_FILE, bibdata) arguments = shlex.split(command) logging.info("Using external command pandoc with command %s" % command) subprocess.call(arguments)