This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf/md_pdf/build/__init__.py
2017-04-04 22:04:25 +01:00

19 lines
653 B
Python

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
from md_pdf.build.pdf import export_pdf
import os
import logging
logger = logging.getLogger(__file__)
def build(config):
logger.debug("Starting Build...")
data = read_files(os.path.abspath(config['input']))
doc = build_document(data, config.get('bibliography'), config.get('context'))
if 'html' in config['output_formats']:
output_html(doc, os.path.abspath(config['output_dir']))
if 'pdf' in config['output_formats']:
render_cover(config)
export_pdf(doc, config)