pytex/PyTeX/format/simple_tex_formatter.py

26 lines
831 B
Python

from .formatting_config import FormattingConfig
from .tex_formatter import TexFormatter
from pathlib import Path
from typing import Optional, List, Tuple, Dict
class SimpleTeXFormatter(TexFormatter):
def open_output_stream(self, build_dir: Path):
out_file = build_dir / self.input_file.with_suffix('').name
if out_file.exists():
raise NotImplementedError
else:
self._output_file = out_file.open()
def close_output_stream(self):
self._output_file.close()
def future_config(self) -> List[Tuple[str, FormattingConfig]]:
return [] # TODO
def dependencies(self) -> List[str]:
return [] # sty / cls file does not depend on anything
@property
def output_files(self) -> List[str]:
return [self.input_file.with_suffix('').name]