Small further cleaning
This commit is contained in:
parent
e48dec20a3
commit
e3772d63a3
1 changed files with 1 additions and 5 deletions
|
@ -27,8 +27,7 @@ def _replace_content(src: Path, dst: Path):
|
||||||
|
|
||||||
|
|
||||||
def _write_file(path: Path, content: str):
|
def _write_file(path: Path, content: str):
|
||||||
os.makedirs(output_path.parent, exist_ok=True)
|
os.makedirs(path.parent, exist_ok=True)
|
||||||
|
|
||||||
with open(path, "w", encoding="utf-8") as f:
|
with open(path, "w", encoding="utf-8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
|
@ -55,9 +54,6 @@ def generate(config: Config):
|
||||||
source_dir = source.parent.relative_to(config.source_dir)
|
source_dir = source.parent.relative_to(config.source_dir)
|
||||||
output_path = config.build_dir / source_dir / (str(source.stem) + ".html")
|
output_path = config.build_dir / source_dir / (str(source.stem) + ".html")
|
||||||
|
|
||||||
with open(md_file, "r", encoding="utf-8") as f:
|
|
||||||
md_src = f.read()
|
|
||||||
|
|
||||||
content = _read_file(source)
|
content = _read_file(source)
|
||||||
output = parser.render(content)
|
output = parser.render(content)
|
||||||
_write_file(output_path, header + output + footer)
|
_write_file(output_path, header + output + footer)
|
||||||
|
|
Loading…
Reference in a new issue