fixed names and function defs
This commit is contained in:
12
app/build.py
12
app/build.py
@@ -5,8 +5,8 @@ from pathlib import Path
|
||||
import os
|
||||
|
||||
|
||||
def html_file(filename: str, contentPath: Path): #renders markwown from filename
|
||||
filePath = contentPath / f"{filename}.md"
|
||||
def html_file(filename, contentPath): #renders markwown from filename
|
||||
filePath = Path(f"{contentPath}/{filename}.md")
|
||||
# 3. Protect against missing files
|
||||
if not filePath.is_file():
|
||||
return f"<h1>404</h1><p>Could not find {filename}.md in {filePath}</p>", 404
|
||||
@@ -44,9 +44,9 @@ def obsidian_vault(dest = "/vault"): # makes sure there is a vault in dest
|
||||
print("cloned vault!")
|
||||
return 1
|
||||
|
||||
def public_notes(src: str): # return a list of notes tagged with public from an obsidian directory
|
||||
def public_notes(privateVault = "/vault"): # return a list of notes tagged with public from an obsidian directory in privateVault
|
||||
# build vault object from source
|
||||
vault = Vault(src)
|
||||
vault = Vault(privateVault)
|
||||
if not(vault):
|
||||
print("could not find vault")
|
||||
raise NameError("vaultNotFound")
|
||||
@@ -55,7 +55,7 @@ def public_notes(src: str): # return a list of notes tagged with public from an
|
||||
return vault.get_notes_with_tag("public")
|
||||
|
||||
|
||||
def public_vault(dest: str, src: str = "/content"): # build the public vault in dest from an obsidian repo in src
|
||||
for note in public_notes(src):
|
||||
def public_vault(privateVault = "/vault", dest = "/content"): # build the public vault in dest from an obsidian repo in src
|
||||
for note in public_notes(privateVault):
|
||||
print(note.title)
|
||||
shutil.copy2(f"{note.path}", dest)
|
||||
|
||||
Reference in New Issue
Block a user