from flask import Flask import markdown from pathlib import Path app = Flask(__name__) CONTENT_DIR = Path(__file__).parent.parent / "content" @app.route("/hello") def hello_world(): return "
Could not find {filename}.md in {filePath}
", 404 # else: # return f"found {filename} in {filePath}
" # 4. Open, read, and convert the file with open(filePath, "r", encoding="utf-8") as f: textContent = f.read() htmlContent = markdown.markdown(textContent) return htmlContent