fixed svg link
This commit is contained in:
parent
22d924c523
commit
a41f42002d
9
main.py
9
main.py
@ -13,10 +13,10 @@ def iter_svgs(vault_path, draws):
|
|||||||
for draw in draws:
|
for draw in draws:
|
||||||
svg = Path("assets/excalidraw_svg").joinpath(Path(draw).with_suffix(".svg").name)
|
svg = Path("assets/excalidraw_svg").joinpath(Path(draw).with_suffix(".svg").name)
|
||||||
if vault_path.joinpath(svg).is_file():
|
if vault_path.joinpath(svg).is_file():
|
||||||
print(svg)
|
print("[found]", svg)
|
||||||
yield draw, svg
|
yield draw, svg
|
||||||
else:
|
else:
|
||||||
eprint(svg)
|
eprint("[missing]:", svg)
|
||||||
yield draw, None
|
yield draw, None
|
||||||
|
|
||||||
|
|
||||||
@ -54,10 +54,7 @@ def main() -> None:
|
|||||||
if svg is None:
|
if svg is None:
|
||||||
replace_dict[f"[[{draw}]]"] = "<h1 style='color: #ff0000'>MISSING IMAGE</h1>"
|
replace_dict[f"[[{draw}]]"] = "<h1 style='color: #ff0000'>MISSING IMAGE</h1>"
|
||||||
else:
|
else:
|
||||||
replace_dict[f"[[{draw}]]"] = f"[[{svg}]]"
|
replace_dict[f"[[{draw}]]"] = f"![]({svg})]"
|
||||||
|
|
||||||
print(replace_dict)
|
|
||||||
print(pages)
|
|
||||||
|
|
||||||
for page in pages:
|
for page in pages:
|
||||||
with open(page) as f:
|
with open(page) as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user