From 85b0283791fd7222c80005cd4c979707182308eb Mon Sep 17 00:00:00 2001 From: Tyler Date: Sat, 14 Jan 2023 20:32:32 -0800 Subject: [PATCH] interactive navigation headers --- app.py | 7 +++++-- html/header.html | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 html/header.html diff --git a/app.py b/app.py index 826db4c..ba59a97 100644 --- a/app.py +++ b/app.py @@ -178,12 +178,13 @@ def return_dict_plain(ref, defs): return ref.capitalize() + "

" + response def return_dict_rich(ref, defs): + header = open('html/header.html', 'r') css = open('styles/human_readable.css', 'r') response_html = open('html/response.html', 'r') response = '' for e in defs: response += e + "

" - return (response_html.read().format(passage = ref.capitalize(), text = response) + css.read()) + return (header.read() + response_html.read().format(passage = ref.capitalize(), text = response) + css.read()) @app.get("/show") def show(): @@ -276,7 +277,8 @@ def response_single(scripture): if arg_view == "plain": return(response_text(scripture)) elif arg_view == "rich": - return(response_rich(scripture)) + header = open('html/header.html', 'r') + return(header.read() + response_rich(scripture)) else: response = response_dict(scripture) return jsonify(response) @@ -289,6 +291,7 @@ def response_multi(scriptures): for scripture in scriptures: response.append(response_text(scripture)) elif arg_view == "rich": + response.append(open('html/header.html', 'r').read()) for scripture in scriptures: response.append(response_rich(scripture)) else: diff --git a/html/header.html b/html/header.html new file mode 100644 index 0000000..428dc70 --- /dev/null +++ b/html/header.html @@ -0,0 +1,9 @@ + +
+Home +Bible Search +Bible Verses +Bible Define +Random Verse +Verse of the Day +