+""" + + for section in sections_list: + sorted_words = sorted( + section_words[section].items(), key=lambda x: get_sort_key(x[0]) + ) + section_id = section.replace(" ", "_").replace(",", "").replace(".", "") + + # Calculate number of rows for column-based layout + # Aim for about 20-30 rows per column for readability + num_words = len(sorted_words) + num_rows = max(20, (num_words + 3) // 4) # Divide by 4 to get ~4 columns max + + html_content += f"""
+
{section} ({len(sorted_words)})
+
+""" + + for word, chapter in sorted_words: + formatted_word = format_word_for_html(word) + html_content += f'
{formatted_word}Ch. {chapter}
\n' + + html_content += """
+
+""" + + html_content += """