Verse chapter linking

This commit is contained in:
2023-01-21 01:46:58 -08:00
parent 98768d9399
commit f629835961
4 changed files with 25 additions and 11 deletions
+12 -3
View File
@@ -18,6 +18,9 @@ Search highlighting
Styles Styles
Bible Reading Plan Bible Reading Plan
Bible Reader Bible Reader
Rich: <hr> on each comma
find: handle ending with :
find: handle ending with ,
""" """
@@ -259,9 +262,10 @@ def return_dict_rich(ref, defs):
response = "" response = ""
for e in defs: for e in defs:
response += e + "<br><br>" response += e + "<br><br>"
# return (header.read() + response_html.read().format(passage = ref.capitalize(), text = response) + css.read())
return ( return (
response_html.read().format(passage=ref.capitalize(), text=response) response_html.read().format(
chapter=ref.split(":")[0], passage=ref.capitalize(), text=response
)
+ css.read() + css.read()
) )
@@ -353,7 +357,12 @@ def response_rich(scripture):
verse = str(scripture[idx_verse]) verse = str(scripture[idx_verse])
text = str(scripture[idx_text]) text = str(scripture[idx_text])
passage = bookname + " " + chapter + ":" + verse passage = bookname + " " + chapter + ":" + verse
return response_html.read().format(passage=passage, text=text) + css.read() return (
response_html.read().format(
chapter=passage.split(":")[0], passage=passage, text=text
)
+ css.read()
)
def response_single(scripture): def response_single(scripture):
+1 -6
View File
@@ -17,12 +17,7 @@ html{
<form action="/find"> <form action="/find">
<label for='kw'>Query</label><br> <label for='kw'>Query</label><br>
<input type="text" name="kw"><br><br> <input type="text" name="kw"><br><br>
<input type="hidden" name="view" value="rich"">
<label for='view'>View<label><br>
<input type="radio" name="view" value="rich" checked="checked">Rich<br>
<input type="radio" name="view" value="plain">Plain<br>
<input type="radio" name="view" value="json">JSON<br>
<input type="submit"> <input type="submit">
<form> <form>
+9 -2
View File
@@ -1,2 +1,9 @@
<h3>{passage}</h3> <p>
<p>{text}</p> <b>
<a href="/find?kw={chapter}&view=rich">
{passage}
</a>
</b>
<br>
{text}
</p>
+3
View File
@@ -3,5 +3,8 @@ html{
font-family: sans-serif; font-family: sans-serif;
font-size: 14pt; font-size: 14pt;
width: 768px; width: 768px;
}
a {
color: #547720
} }
</style> </style>