|
@ -130,6 +130,7 @@ def description(): |
|
|
|
|
|
|
|
|
#open json file, list filepaths in array and loop with thefile |
|
|
#open json file, list filepaths in array and loop with thefile |
|
|
textfile="" |
|
|
textfile="" |
|
|
|
|
|
textfiles=[] |
|
|
with open("static/"+jsonfilefordescription, 'r') as f: |
|
|
with open("static/"+jsonfilefordescription, 'r') as f: |
|
|
data_dict = json.load(f) |
|
|
data_dict = json.load(f) |
|
|
datafromjson = data_dict["files"] |
|
|
datafromjson = data_dict["files"] |
|
@ -139,12 +140,9 @@ def description(): |
|
|
if file.lower().endswith(('.html')): |
|
|
if file.lower().endswith(('.html')): |
|
|
with open("static/"+file,"r", encoding='utf-8') as f: |
|
|
with open("static/"+file,"r", encoding='utf-8') as f: |
|
|
textfile = f.read() |
|
|
textfile = f.read() |
|
|
# wordlinked = "<a href='/diverge?search="+word+"'>"+word+"</a>" |
|
|
|
|
|
# textfile = re.sub(word, wordlinked, textfile) |
|
|
|
|
|
textfile = Markup(textfile) |
|
|
textfile = Markup(textfile) |
|
|
|
|
|
textfiles.append(textfile) |
|
|
|
|
|
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfiles=textfiles, idno=idno) |
|
|
return render_template('description.html', datafromjson=datafromjson, itemid=itemid, textfile=textfile, idno=idno) |
|
|
|
|
|
|
|
|
|
|
|
@app.route('/diverge', methods=['GET']) |
|
|
@app.route('/diverge', methods=['GET']) |
|
|
def diverge(): |
|
|
def diverge(): |
|
|