]>
git.scottworley.com Git - paperdoorknob/blob - texify.py
1 # paperdoorknob: Print glowfic
3 # This program is free software: you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License as published by the
5 # Free Software Foundation, version 3.
8 from abc
import ABC
, abstractmethod
11 from bs4
.element
import Tag
16 def texify(self
, html
: Tag
) -> bytes:
17 raise NotImplementedError()
20 class PandocTexifier(Texifier
):
22 def __init__(self
, pandoc_path
: str) -> None:
23 self
._pandoc
_path
= pandoc_path
25 def texify(self
, html
: Tag
) -> bytes:
26 return subprocess
.run([self
._pandoc
_path
, '--from=html', '--to=latex'],
28 stdout
=subprocess
.PIPE
,