# Helper formatting functions
def format_local_map(result):
html = (
f"
"
)
return html
def format_knowledge(result):
html = (
f"{result.get('title','Unknown')}
"
f"Type: {result.get('type','')}
"
f"Born: {result.get('born','')}
"
f"Died: {result.get('died','')}
"
)
return html
def format_images(result):
# Extract 'original' URL from each image dict.
urls = [item.get("original", "") for item in result]
return urls
def format_videos(result):
html = ""
for vid in result:
html += (
f"
"
f"
"
f"{vid.get('title','')}"
f"
"
)
html += "
"
return html
def format_links(result):
html = ""
for url in result:
# Use the final part of the URL as the title.
title = url.rstrip('/').split('/')[-1]
html += f"- {title}
"
html += "
"
return html