Permalink
Browse files

Adding CSL file to configuration

  • Loading branch information...
kthoden committed Feb 28, 2018
1 parent f626aa5 commit b8704ef95844dc98204b79960bae6ee40520ca12
Showing with 4 additions and 3 deletions.
  1. +1 −0 config/eoaconvert.cfg
  2. +3 −3 libeoaconvert.py
View
@@ -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
View
@@ -9,21 +9,21 @@
import configparser
from lxml.html import soupparser
-
##################################
# Reading the configuration file #
##################################
CONFIG_FILE = os.path.dirname(sys.argv[0]) + "/config/eoaconvert.cfg"
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)

0 comments on commit b8704ef

Please sign in to comment.