diff --git a/md_pdf/build/__init__.py b/md_pdf/build/__init__.py index 11c8fb8..2c77bc5 100644 --- a/md_pdf/build/__init__.py +++ b/md_pdf/build/__init__.py @@ -1,4 +1,3 @@ -from md_pdf.consts import WORKING_DIR from md_pdf.build.md import read_files from md_pdf.build.pandoc import build_document, output_html from md_pdf.build.cover import render_cover diff --git a/md_pdf/build/md.py b/md_pdf/build/md.py index ea55c9f..49be8be 100644 --- a/md_pdf/build/md.py +++ b/md_pdf/build/md.py @@ -1,5 +1,6 @@ import glob + def get_files_content(filenames): for filename in filenames: with open(filename) as f: diff --git a/md_pdf/build/pandoc.py b/md_pdf/build/pandoc.py index 2853457..44b825f 100644 --- a/md_pdf/build/pandoc.py +++ b/md_pdf/build/pandoc.py @@ -6,6 +6,7 @@ from md_pdf.consts import PROJECT_DIR, CSL_DIR CSL_FILE = os.path.join(PROJECT_DIR, 'assets', 'harverd.csl') + def fix_references_title(content): soup = BeautifulSoup(content, 'html.parser') reference_element = soup.find('div', class_='references') @@ -33,7 +34,10 @@ def build_document(files_content, bibliography): ] filters.append('pandoc-citeproc') - html = pypandoc.convert_text(files_content, 'html', format='md', + html = pypandoc.convert_text( + files_content, + 'html', + format='md', extra_args=args, filters=filters ) diff --git a/md_pdf/config/validate.py b/md_pdf/config/validate.py index 8660401..0b97d6b 100644 --- a/md_pdf/config/validate.py +++ b/md_pdf/config/validate.py @@ -56,5 +56,3 @@ def validate_config(config): validate_bibliography ]: validator(config) - -