# Process selected links for link_title, link_page in selected_links: if link_page.exists(): # Add link to queue for future processing pages_to_visit.append(link_title) # Get the first paragraph as context context = link_page.summary.split('n')[0] if link_page.summary else "" links_data.append({ "from": current_title, "to": link_title, "context": context })