awacke1 commited on
Commit
19f408b
ยท
verified ยท
1 Parent(s): f83c4d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +187 -205
app.py CHANGED
@@ -16,14 +16,12 @@ import unicodedata
16
  st.set_page_config(layout="wide", initial_sidebar_state="collapsed")
17
 
18
  def create_pdf_tab(default_markdown):
19
- # Dynamically load all .ttf fonts from the current directory
20
  font_files = glob.glob("*.ttf")
21
  if not font_files:
22
  st.error("No .ttf font files found in the current directory. Please add some, e.g., NotoEmoji-Regular.ttf.")
23
  return
24
  available_fonts = {os.path.splitext(os.path.basename(f))[0]: f for f in font_files}
25
 
26
- # Sidebar configuration
27
  with st.sidebar:
28
  selected_font_name = st.selectbox("Select Font", options=list(available_fonts.keys()), index=0 if "NotoEmoji-Regular" in available_fonts else 0)
29
  selected_font_path = available_fonts[selected_font_name]
@@ -42,56 +40,45 @@ def create_pdf_tab(default_markdown):
42
 
43
  st.download_button(label="Save Markdown", data=st.session_state.markdown_content, file_name="deities_guide.md", mime="text/markdown")
44
 
45
- # Register the selected font and a fallback font
46
  try:
47
  pdfmetrics.registerFont(TTFont(selected_font_name, selected_font_path))
48
- # Register a fallback font (e.g., Helvetica) for non-emoji text
49
- pdfmetrics.registerFont(TTFont("Helvetica", "Helvetica.ttf")) # Ensure Helvetica is available
50
  except Exception as e:
51
  st.error(f"Failed to register font {selected_font_name}: {e}")
52
  return
53
 
54
- # Emoji font application with fallback
55
  def apply_emoji_font(text, emoji_font):
56
  emoji_pattern = re.compile(
57
- r"([\U0001F300-\U0001F5FF" # Miscellaneous Symbols and Pictographs
58
- r"\U0001F600-\U0001F64F" # Emoticons
59
- r"\U0001F680-\U0001F6FF" # Transport and Map Symbols
60
- r"\U0001F700-\U0001F77F" # Alchemical Symbols
61
- r"\U0001F780-\U0001F7FF" # Geometric Shapes Extended
62
- r"\U0001F800-\U0001F8FF" # Supplemental Arrows-C
63
- r"\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs
64
- r"\U0001FA00-\U0001FA6F" # Chess Symbols
65
- r"\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A
66
- r"\u2600-\u26FF" # Miscellaneous Symbols (e.g., โšก U+26A1)
67
- r"\u2700-\u27BF]+" # Dingbats (e.g., โœ U+271D)
68
- r")"
69
  )
70
 
71
  def replace_emoji(match):
72
  emoji = match.group(1)
73
- # Normalize emoji to avoid multi-codepoint issues (e.g., combining characters)
74
  emoji = unicodedata.normalize('NFC', emoji)
75
- # Wrap emoji in font tag; if it doesnโ€™t render, itโ€™ll fall back to text
76
  return f'<font face="{emoji_font}">{emoji}</font>'
77
 
78
- # Split text into segments: emoji and non-emoji
79
  segments = []
80
  last_pos = 0
81
  for match in emoji_pattern.finditer(text):
82
  start, end = match.span()
83
- # Add non-emoji text with Helvetica
84
  if last_pos < start:
85
  segments.append(f'<font face="Helvetica">{text[last_pos:start]}</font>')
86
- # Add emoji with the selected font
87
  segments.append(replace_emoji(match))
88
  last_pos = end
89
- # Add remaining non-emoji text
90
  if last_pos < len(text):
91
  segments.append(f'<font face="Helvetica">{text[last_pos:]}</font>')
92
  return ''.join(segments)
93
 
94
- # Markdown to PDF content
95
  def markdown_to_pdf_content(markdown_text, plain_text_mode, auto_bold_numbers):
96
  lines = markdown_text.strip().split('\n')
97
  pdf_content = []
@@ -121,7 +108,6 @@ def create_pdf_tab(default_markdown):
121
  total_lines = len(pdf_content)
122
  return pdf_content, total_lines
123
 
124
- # Create PDF
125
  def create_pdf(markdown_text, base_font_size, plain_text_mode, num_columns, auto_bold_numbers):
126
  buffer = io.BytesIO()
127
  page_width = A4[0] * 2
@@ -136,7 +122,6 @@ def create_pdf_tab(default_markdown):
136
  item_font_size = base_font_size
137
  section_font_size = base_font_size * 1.1
138
 
139
- # Define styles with explicit font names
140
  section_style = ParagraphStyle(
141
  'SectionStyle', parent=styles['Heading2'], fontName="Helvetica-Bold",
142
  textColor=colors.darkblue, fontSize=section_font_size, leading=section_font_size * 1.2, spaceAfter=2
@@ -194,7 +179,6 @@ def create_pdf_tab(default_markdown):
194
  buffer.seek(0)
195
  return buffer.getvalue()
196
 
197
- # PDF to image
198
  def pdf_to_image(pdf_bytes):
199
  try:
200
  doc = fitz.open(stream=pdf_bytes, filetype="pdf")
@@ -209,7 +193,6 @@ def create_pdf_tab(default_markdown):
209
  st.error(f"Failed to render PDF preview: {e}")
210
  return None
211
 
212
- # Main logic
213
  with st.spinner("Generating PDF..."):
214
  pdf_bytes = create_pdf(st.session_state.markdown_content, base_font_size, plain_text_mode, num_columns, auto_bold_numbers)
215
 
@@ -224,182 +207,181 @@ def create_pdf_tab(default_markdown):
224
  with st.sidebar:
225
  st.download_button(label="Download PDF", data=pdf_bytes, file_name="deities_guide.pdf", mime="application/pdf")
226
 
227
- # Your default markdown content remains unchanged
228
- default_markdown = """# Deities Guide: Mythology and Moral Lessons ๐ŸŒŸ
229
-
230
- 1. ๐Ÿ“œ Introduction
231
- - Purpose: Explore deities, spirits, saints, and beings with their stories and morals.
232
- - Usage: Guide for learning and storytelling across traditions.
233
- - Themes: Justice, faith, hubris, redemption, cosmic order.
234
-
235
- 2. ๐Ÿ› ๏ธ Core Concepts of Divinity
236
- - Powers: Creation, omniscience, shapeshifting across entities.
237
- - Life Cycle: Mortality, immortality, transitions such as saints and avatars.
238
- - Communication: Omens, visions, miracles from gods and spirits.
239
-
240
- 3. โšก Standard Abilities
241
- - Creation: Gods and spirits shape worlds, such as Allah and Vishnu.
242
- - Influence: Saints and prophets intercede, for example, Muhammad and Paul.
243
- - Transformation: Angels and avatars shift forms, like Gabriel and Krishna.
244
- - Knowledge: Foresight or revelation, as seen with the Holy Spirit and Brahma.
245
- - Judgment: Divine authority, exemplified by Yahweh and Yama.
246
-
247
- 4. โณ Mortality and Immortality
248
- - Gods: Eternal, such as Allah and Shiva.
249
- - Spirits: Realm-bound, like jinn and devas.
250
- - Saints/Prophets: Mortal to divine, for instance, Moses and Rama.
251
- - Beings: Limbo states, such as cherubim and rakshasas.
252
- - Lessons: Faith and duty define transitions.
253
-
254
- 5. ๐ŸŒ  Ascension and Signs
255
- - Paths: Birth, deeds, revelation, as with Jesus and Arjuna.
256
- - Signs: Miracles and prophecies, like those in the Quran and Gita.
257
- - Morals: Obedience and devotion shape destiny.
258
-
259
- 6. ๐ŸŽฒ Storytelling and Games
260
- - Portrayal: Gods, spirits, and saints in narratives or RPGs.
261
- - Dynamics: Clerics, imams, and sadhus serve higher powers.
262
- - Balance: Power versus personality for depth.
263
-
264
- 7. ๐ŸŽฎ Dungeon Mastering Beings
265
- - Gods: Epic scope, such as Allah and Vishnu.
266
- - Spirits: Local influence, like jinn and apsaras.
267
- - Saints: Moral anchors, for example, St. Francis and Ali.
268
-
269
- 8. ๐Ÿ™ Devotee Relationships
270
- - Clerics: Serve gods, such as Krishnaโ€™s priests.
271
- - Mediums: Channel spirits, like jinn whisperers.
272
- - Faithful: Venerate saints and prophets, for instance, Fatimaโ€™s followers.
273
-
274
- 9. ๐Ÿฆ… American Indian Traditions
275
- - Coyote, Raven, White Buffalo Woman: Trickster kin and wise mother.
276
- - Relation: Siblings and guide teach balance.
277
- - Lesson: Chaos breeds wisdom.
278
-
279
- 10. โš”๏ธ Arthurian Legends
280
- - Merlin, Morgan le Fay, Arthur: Mentor, rival, son.
281
- - Relation: Family tests loyalty.
282
- - Lesson: Honor versus betrayal.
283
-
284
- 11. ๐Ÿ›๏ธ Babylonian Mythology
285
- - Marduk, Tiamat, Ishtar: Son, mother, lover.
286
- - Relation: Kinship drives order.
287
- - Lesson: Power reshapes chaos.
288
-
289
- 12. โœ๏ธ Christian Trinity
290
- - God (Yahweh), Jesus, Holy Spirit: Father, Son, Spirit.
291
- - Relation: Divine family redeems.
292
- - Lesson: Faith restores grace.
293
-
294
- 13. ๐Ÿ˜‡ Christian Saints & Angels
295
- - St. Michael, Gabriel, Mary: Warrior, messenger, mother.
296
- - Relation: Heavenly kin serve God.
297
- - Lesson: Duty upholds divine will.
298
-
299
- 14. ๐Ÿ€ Celtic Mythology
300
- - Lugh, Morrigan, Cernunnos: Son, mother, father.
301
- - Relation: Family governs cycles.
302
- - Lesson: Courage in fate.
303
-
304
- 15. ๐ŸŒ„ Central American Traditions
305
- - Quetzalcoatl, Tezcatlipoca, Huitzilopochtli: Brothers and war son.
306
- - Relation: Sibling rivalry creates.
307
- - Lesson: Sacrifice builds worlds.
308
-
309
- 16. ๐Ÿ‰ Chinese Mythology
310
- - Jade Emperor, Nuwa, Sun Wukong: Father, mother, rebel son.
311
- - Relation: Family enforces harmony.
312
- - Lesson: Duty curbs chaos.
313
-
314
- 17. ๐Ÿ™ Cthulhu Mythos
315
- - Cthulhu, Nyarlathotep, Yog-Sothoth: Elder kin.
316
- - Relation: Cosmic trio overwhelms.
317
- - Lesson: Insignificance humbles.
318
-
319
- 18. โ˜ฅ Egyptian Mythology
320
- - Ra, Osiris, Isis: Father, son, mother.
321
- - Relation: Family ensures renewal.
322
- - Lesson: Justice prevails.
323
-
324
- 19. โ„๏ธ Finnish Mythology
325
- - Vรคinรคmรถinen, Louhi, Ukko: Son, mother, father.
326
- - Relation: Kinship tests wisdom.
327
- - Lesson: Perseverance wins.
328
-
329
- 20. ๐Ÿ›๏ธ Greek Mythology
330
- - Zeus, Hera, Athena: Father, mother, daughter.
331
- - Relation: Family rules with tension.
332
- - Lesson: Hubris meets wisdom.
333
-
334
- 21. ๐Ÿ•‰๏ธ Hindu Trimurti
335
- - Brahma, Vishnu, Shiva: Creator, preserver, destroyer.
336
- - Relation: Divine trio cycles existence.
337
- - Lesson: Balance sustains life.
338
-
339
- 22. ๐ŸŒบ Hindu Avatars & Devis
340
- - Krishna, Rama, Durga: Sons and fierce mother.
341
- - Relation: Avatars and goddess protect dharma.
342
- - Lesson: Duty defeats evil.
343
-
344
- 23. ๐ŸŒธ Japanese Mythology
345
- - Amaterasu, Susanoo, Tsukuyomi: Sister, brothers.
346
- - Relation: Siblings balance cosmos.
347
- - Lesson: Harmony versus chaos.
348
-
349
- 24. ๐Ÿ—ก๏ธ Melnibonean Legends
350
- - Arioch, Xiombarg, Elric: Lords and mortal son.
351
- - Relation: Pact binds chaos.
352
- - Lesson: Power corrupts.
353
-
354
- 25. โ˜ช๏ธ Muslim Divine & Messengers
355
- - Allah, Muhammad, Gabriel: God, prophet, angel.
356
- - Relation: Messenger reveals divine will.
357
- - Lesson: Submission brings peace.
358
-
359
- 26. ๐Ÿ‘ป Muslim Spirits & Kin
360
- - Jinn, Iblis, Khidr: Spirits and guide defy or aid.
361
- - Relation: Supernatural kin test faith.
362
- - Lesson: Obedience versus rebellion.
363
-
364
- 27. ๐Ÿฐ Nehwon Legends
365
- - Death, Ningauble, Sheelba: Fateful trio.
366
- - Relation: Guides shape destiny.
367
- - Lesson: Cunning defies fate.
368
-
369
- 28. ๐Ÿง Nonhuman Traditions
370
- - Corellon, Moradin, Gruumsh: Elf, dwarf, orc fathers.
371
- - Relation: Rivals define purpose.
372
- - Lesson: Community endures.
373
-
374
- 29. แšฑ Norse Mythology
375
- - Odin, Frigg, Loki: Father, mother, trickster son.
376
- - Relation: Family faces doom.
377
- - Lesson: Sacrifice costs.
378
-
379
- 30. ๐Ÿ—ฟ Sumerian Mythology
380
- - Enki, Inanna, Anu: Son, daughter, father.
381
- - Relation: Kin wield knowledge.
382
- - Lesson: Ambition shapes.
383
-
384
- 31. ๐Ÿ“š Appendices
385
- - Planes: Realms of gods, spirits, saints, such as Paradise and Svarga.
386
- - Symbols: Rituals and artifacts of faith.
387
- - Charts: Domains and duties for devotees.
388
-
389
- 32. ๐ŸŒŒ Planes of Existence
390
- - Heaven/Paradise: Christian/Muslim abode.
391
- - Svarga: Hindu divine realm.
392
- - Underworld: Spirits linger, for example, Sheol and Naraka.
393
-
394
- 33. ๐Ÿ• Temple Trappings
395
- - Cross/Crescent: Christian/Muslim faith.
396
- - Mandalas: Hindu devotion.
397
- - Relics: Saintsโ€™ and prophetsโ€™ legacy.
398
-
399
- 34. ๐Ÿ“Š Clerical Chart
400
- - Gods: Domains, such as creation and mercy.
401
- - Spirits: Influence, like guidance and mischief.
402
- - Saints/Prophets: Virtues, for instance, justice and prophecy.
403
  """
404
 
405
  create_pdf_tab(default_markdown)
 
16
  st.set_page_config(layout="wide", initial_sidebar_state="collapsed")
17
 
18
  def create_pdf_tab(default_markdown):
 
19
  font_files = glob.glob("*.ttf")
20
  if not font_files:
21
  st.error("No .ttf font files found in the current directory. Please add some, e.g., NotoEmoji-Regular.ttf.")
22
  return
23
  available_fonts = {os.path.splitext(os.path.basename(f))[0]: f for f in font_files}
24
 
 
25
  with st.sidebar:
26
  selected_font_name = st.selectbox("Select Font", options=list(available_fonts.keys()), index=0 if "NotoEmoji-Regular" in available_fonts else 0)
27
  selected_font_path = available_fonts[selected_font_name]
 
40
 
41
  st.download_button(label="Save Markdown", data=st.session_state.markdown_content, file_name="deities_guide.md", mime="text/markdown")
42
 
 
43
  try:
44
  pdfmetrics.registerFont(TTFont(selected_font_name, selected_font_path))
45
+ pdfmetrics.registerFont(TTFont("Helvetica", "Helvetica.ttf"))
 
46
  except Exception as e:
47
  st.error(f"Failed to register font {selected_font_name}: {e}")
48
  return
49
 
 
50
  def apply_emoji_font(text, emoji_font):
51
  emoji_pattern = re.compile(
52
+ r"([\U0001F300-\U0001F5FF"
53
+ r"\U0001F600-\U0001F64F"
54
+ r"\U0001F680-\U0001F6FF"
55
+ r"\U0001F700-\U0001F77F"
56
+ r"\U0001F780-\U0001F7FF"
57
+ r"\U0001F800-\U0001F8FF"
58
+ r"\U0001F900-\U0001F9FF"
59
+ r"\U0001FA00-\U0001FA6F"
60
+ r"\U0001FA70-\U0001FAFF"
61
+ r"\u2600-\u26FF"
62
+ r"\u2700-\u27BF]+)"
 
63
  )
64
 
65
  def replace_emoji(match):
66
  emoji = match.group(1)
 
67
  emoji = unicodedata.normalize('NFC', emoji)
 
68
  return f'<font face="{emoji_font}">{emoji}</font>'
69
 
 
70
  segments = []
71
  last_pos = 0
72
  for match in emoji_pattern.finditer(text):
73
  start, end = match.span()
 
74
  if last_pos < start:
75
  segments.append(f'<font face="Helvetica">{text[last_pos:start]}</font>')
 
76
  segments.append(replace_emoji(match))
77
  last_pos = end
 
78
  if last_pos < len(text):
79
  segments.append(f'<font face="Helvetica">{text[last_pos:]}</font>')
80
  return ''.join(segments)
81
 
 
82
  def markdown_to_pdf_content(markdown_text, plain_text_mode, auto_bold_numbers):
83
  lines = markdown_text.strip().split('\n')
84
  pdf_content = []
 
108
  total_lines = len(pdf_content)
109
  return pdf_content, total_lines
110
 
 
111
  def create_pdf(markdown_text, base_font_size, plain_text_mode, num_columns, auto_bold_numbers):
112
  buffer = io.BytesIO()
113
  page_width = A4[0] * 2
 
122
  item_font_size = base_font_size
123
  section_font_size = base_font_size * 1.1
124
 
 
125
  section_style = ParagraphStyle(
126
  'SectionStyle', parent=styles['Heading2'], fontName="Helvetica-Bold",
127
  textColor=colors.darkblue, fontSize=section_font_size, leading=section_font_size * 1.2, spaceAfter=2
 
179
  buffer.seek(0)
180
  return buffer.getvalue()
181
 
 
182
  def pdf_to_image(pdf_bytes):
183
  try:
184
  doc = fitz.open(stream=pdf_bytes, filetype="pdf")
 
193
  st.error(f"Failed to render PDF preview: {e}")
194
  return None
195
 
 
196
  with st.spinner("Generating PDF..."):
197
  pdf_bytes = create_pdf(st.session_state.markdown_content, base_font_size, plain_text_mode, num_columns, auto_bold_numbers)
198
 
 
207
  with st.sidebar:
208
  st.download_button(label="Download PDF", data=pdf_bytes, file_name="deities_guide.pdf", mime="application/pdf")
209
 
210
+ default_markdown = """# Deities Guide: Mythology and Moral Lessons ๐ŸŒŸโœจ
211
+
212
+ 1. ๐Ÿ“œ **Introduction**
213
+ - **Purpose**: Explore deities, spirits, saints, and beings with their epic stories and morals! ๐ŸŒ๐Ÿ“–
214
+ - **Usage**: A guide for learning and storytelling across traditions. ๐ŸŽญโœ๏ธ
215
+ - **Themes**: Justice โš–๏ธ, faith ๐Ÿ™, hubris ๐Ÿ˜ค, redemption ๐ŸŒˆ, cosmic order ๐ŸŒŒ.
216
+
217
+ 2. ๐Ÿ› ๏ธ **Core Concepts of Divinity**
218
+ - **Powers**: Creation ๐ŸŒ, omniscience ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ, shapeshifting ๐Ÿฆ‹ across entities.
219
+ - **Life Cycle**: Mortality ๐Ÿ’€, immortality โœจ, transitions like saints and avatars ๐ŸŒŸ.
220
+ - **Communication**: Omens ๐ŸŒฉ๏ธ, visions ๐Ÿ‘๏ธ, miracles โœจ from gods and spirits.
221
+
222
+ 3. โšก **Standard Abilities**
223
+ - **Creation**: Gods and spirits shape worlds, e.g., Allah ๐ŸŒ and Vishnu ๐ŸŒ€.
224
+ - **Influence**: Saints and prophets intercede, like Muhammad ๐Ÿ•Œ and Paul โœ๏ธ.
225
+ - **Transformation**: Angels and avatars shift forms, e.g., Gabriel ๐Ÿ˜‡ and Krishna ๐Ÿฆš.
226
+ - **Knowledge**: Foresight ๐Ÿ”ฎ or revelation ๐Ÿ“œ, as with the Holy Spirit ๐Ÿ•Š๏ธ and Brahma ๐Ÿง .
227
+ - **Judgment**: Divine authority ๐Ÿ‘‘, e.g., Yahweh โš–๏ธ and Yama ๐Ÿ’€.
228
+
229
+ 4. โณ **Mortality and Immortality**
230
+ - **Gods**: Eternal โฐ, like Allah ๐ŸŒŸ and Shiva ๐Ÿ•‰๏ธ.
231
+ - **Spirits**: Realm-bound ๐ŸŒ , e.g., jinn ๐Ÿ”ฅ and devas โœจ.
232
+ - **Saints/Prophets**: Mortal to divine ๐ŸŒโžก๏ธ๐ŸŒŒ, e.g., Moses ๐Ÿ“œ and Rama ๐Ÿน.
233
+ - **Beings**: Limbo states โ“, like cherubim ๐Ÿ˜‡ and rakshasas ๐Ÿ‘น.
234
+ - **Lessons**: Faith ๐Ÿ™ and duty โš™๏ธ define transitions.
235
+
236
+ 5. ๐ŸŒ  **Ascension and Signs**
237
+ - **Paths**: Birth ๐Ÿ‘ถ, deeds ๐Ÿ›ก๏ธ, revelation ๐Ÿ“–, as with Jesus โœ๏ธ and Arjuna ๐Ÿน.
238
+ - **Signs**: Miracles โœจ and prophecies ๐Ÿ”ฎ, like those in the Quran ๐Ÿ“˜ and Gita ๐Ÿ“š.
239
+ - **Morals**: Obedience ๐ŸงŽ and devotion โค๏ธ shape destiny ๐ŸŒŸ.
240
+
241
+ 6. ๐ŸŽฒ **Storytelling and Games**
242
+ - **Portrayal**: Gods, spirits, and saints in narratives or RPGs ๐ŸŽฎ๐Ÿ“œ.
243
+ - **Dynamics**: Clerics โ›ช, imams ๐Ÿ•Œ, and sadhus ๐Ÿง˜ serve higher powers.
244
+ - **Balance**: Power ๐Ÿ’ช vs. personality ๐Ÿ˜Š for depth.
245
+
246
+ 7. ๐ŸŽฎ **Dungeon Mastering Beings**
247
+ - **Gods**: Epic scope ๐ŸŒŒ, e.g., Allah โœจ and Vishnu ๐ŸŒ€.
248
+ - **Spirits**: Local influence ๐Ÿž๏ธ, like jinn ๐Ÿ”ฅ and apsaras ๐Ÿ’ƒ.
249
+ - **Saints**: Moral anchors โš“, e.g., St. Francis ๐Ÿพ and Ali โš”๏ธ.
250
+
251
+ 8. ๐Ÿ™ **Devotee Relationships**
252
+ - **Clerics**: Serve gods, e.g., Krishnaโ€™s priests ๐Ÿฆš.
253
+ - **Mediums**: Channel spirits, like jinn whisperers ๐Ÿ”ฅ๐Ÿ‘๏ธ.
254
+ - **Faithful**: Venerate saints and prophets, e.g., Fatimaโ€™s followers ๐ŸŒน.
255
+
256
+ 9. ๐Ÿฆ… **American Indian Traditions**
257
+ - **Coyote, Raven, White Buffalo Woman**: Trickster kin ๐ŸฆŠ๐Ÿฆ and wise mother ๐Ÿƒ.
258
+ - **Relation**: Siblings and guide teach balance โš–๏ธ.
259
+ - **Lesson**: Chaos ๐ŸŒช๏ธ breeds wisdom ๐Ÿง .
260
+
261
+ 10. โš”๏ธ **Arthurian Legends**
262
+ - **Merlin, Morgan le Fay, Arthur**: Mentor ๐Ÿง™, rival ๐Ÿง™โ€โ™€๏ธ, son ๐Ÿ‘‘.
263
+ - **Relation**: Family tests loyalty ๐Ÿค.
264
+ - **Lesson**: Honor ๐Ÿ›ก๏ธ vs. betrayal ๐Ÿ—ก๏ธ.
265
+
266
+ 11. ๐Ÿ›๏ธ **Babylonian Mythology**
267
+ - **Marduk, Tiamat, Ishtar**: Son โš”๏ธ, mother ๐ŸŒŠ, lover โค๏ธ.
268
+ - **Relation**: Kinship drives order ๐Ÿฐ.
269
+ - **Lesson**: Power ๐Ÿ’ช reshapes chaos ๐ŸŒช๏ธ.
270
+
271
+ 12. โœ๏ธ **Christian Trinity**
272
+ - **God (Yahweh), Jesus, Holy Spirit**: Father ๐Ÿ‘‘, Son โœ๏ธ, Spirit ๐Ÿ•Š๏ธ.
273
+ - **Relation**: Divine family redeems ๐ŸŒˆ.
274
+ - **Lesson**: Faith ๐Ÿ™ restores grace โœจ.
275
+
276
+ 13. ๐Ÿ˜‡ **Christian Saints & Angels**
277
+ - **St. Michael, Gabriel, Mary**: Warrior โš”๏ธ, messenger ๐Ÿ“œ, mother ๐ŸŒน.
278
+ - **Relation**: Heavenly kin serve God ๐Ÿ‘‘.
279
+ - **Lesson**: Duty โš™๏ธ upholds divine will ๐ŸŒŸ.
280
+
281
+ 14. ๐Ÿ€ **Celtic Mythology**
282
+ - **Lugh, Morrigan, Cernunnos**: Son โ˜€๏ธ, mother ๐Ÿฆ‡, father ๐ŸฆŒ.
283
+ - **Relation**: Family governs cycles ๐ŸŒ.
284
+ - **Lesson**: Courage ๐Ÿ’ช in fate ๐ŸŽฒ.
285
+
286
+ 15. ๐ŸŒ„ **Central American Traditions**
287
+ - **Quetzalcoatl, Tezcatlipoca, Huitzilopochtli**: Brothers ๐Ÿ๐Ÿ† and war son โš”๏ธ.
288
+ - **Relation**: Sibling rivalry creates ๐ŸŒ.
289
+ - **Lesson**: Sacrifice ๐Ÿฉธ builds worlds ๐Ÿฐ.
290
+
291
+ 16. ๐Ÿ‰ **Chinese Mythology**
292
+ - **Jade Emperor, Nuwa, Sun Wukong**: Father ๐Ÿ‘‘, mother ๐Ÿ, rebel son ๐Ÿ’.
293
+ - **Relation**: Family enforces harmony ๐ŸŽถ.
294
+ - **Lesson**: Duty โš™๏ธ curbs chaos ๐ŸŒช๏ธ.
295
+
296
+ 17. ๐Ÿ™ **Cthulhu Mythos**
297
+ - **Cthulhu, Nyarlathotep, Yog-Sothoth**: Elder kin ๐Ÿ™๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ๐ŸŒŒ.
298
+ - **Relation**: Cosmic trio overwhelms ๐Ÿ˜ฑ.
299
+ - **Lesson**: Insignificance ๐ŸŒŒ humbles ๐Ÿ™‡.
300
+
301
+ 18. โ˜ฅ **Egyptian Mythology**
302
+ - **Ra, Osiris, Isis**: Father โ˜€๏ธ, son โšฐ๏ธ, mother ๐ŸŒŸ.
303
+ - **Relation**: Family ensures renewal ๐Ÿ”„.
304
+ - **Lesson**: Justice โš–๏ธ prevails.
305
+
306
+ 19. โ„๏ธ **Finnish Mythology**
307
+ - **Vรคinรคmรถinen, Louhi, Ukko**: Son ๐ŸŽถ, mother โ„๏ธ, father โšก.
308
+ - **Relation**: Kinship tests wisdom ๐Ÿง .
309
+ - **Lesson**: Perseverance ๐Ÿ‹๏ธ wins.
310
+
311
+ 20. ๐Ÿ›๏ธ **Greek Mythology**
312
+ - **Zeus, Hera, Athena**: Father โšก, mother ๐Ÿ‘‘, daughter ๐Ÿฆ‡.
313
+ - **Relation**: Family rules with tension โš”๏ธ.
314
+ - **Lesson**: Hubris ๐Ÿ˜ค meets wisdom ๐Ÿง .
315
+
316
+ 21. ๐Ÿ•‰๏ธ **Hindu Trimurti**
317
+ - **Brahma, Vishnu, Shiva**: Creator ๐ŸŒ€, preserver ๐Ÿ›ก๏ธ, destroyer ๐Ÿ”ฅ.
318
+ - **Relation**: Divine trio cycles existence ๐Ÿ”„.
319
+ - **Lesson**: Balance โš–๏ธ sustains life ๐ŸŒ.
320
+
321
+ 22. ๐ŸŒบ **Hindu Avatars & Devis**
322
+ - **Krishna, Rama, Durga**: Sons ๐Ÿฆš๐Ÿน and fierce mother ๐Ÿ—ก๏ธ.
323
+ - **Relation**: Avatars and goddess protect dharma โš–๏ธ.
324
+ - **Lesson**: Duty โš™๏ธ defeats evil ๐Ÿ‘น.
325
+
326
+ 23. ๐ŸŒธ **Japanese Mythology**
327
+ - **Amaterasu, Susanoo, Tsukuyomi**: Sister โ˜€๏ธ, brothers ๐ŸŒŠ๐ŸŒ™.
328
+ - **Relation**: Siblings balance cosmos ๐ŸŒŒ.
329
+ - **Lesson**: Harmony ๐ŸŽถ vs. chaos ๐ŸŒช๏ธ.
330
+
331
+ 24. ๐Ÿ—ก๏ธ **Melnibonean Legends**
332
+ - **Arioch, Xiombarg, Elric**: Lords ๐Ÿ‘‘ and mortal son โš”๏ธ.
333
+ - **Relation**: Pact binds chaos ๐ŸŒช๏ธ.
334
+ - **Lesson**: Power ๐Ÿ’ช corrupts ๐Ÿ˜ˆ.
335
+
336
+ 25. โ˜ช๏ธ **Muslim Divine & Messengers**
337
+ - **Allah, Muhammad, Gabriel**: God ๐ŸŒŸ, prophet ๐Ÿ•Œ, angel ๐Ÿ˜‡.
338
+ - **Relation**: Messenger reveals divine will ๐Ÿ“œ.
339
+ - **Lesson**: Submission ๐Ÿ™‡ brings peace โ˜ฎ๏ธ.
340
+
341
+ 26. ๐Ÿ‘ป **Muslim Spirits & Kin**
342
+ - **Jinn, Iblis, Khidr**: Spirits ๐Ÿ”ฅ๐Ÿ˜ˆ and guide ๐ŸŒฟ defy or aid.
343
+ - **Relation**: Supernatural kin test faith ๐Ÿ™.
344
+ - **Lesson**: Obedience ๐ŸงŽ vs. rebellion ๐Ÿ˜ก.
345
+
346
+ 27. ๐Ÿฐ **Nehwon Legends**
347
+ - **Death, Ningauble, Sheelba**: Fateful trio ๐Ÿ’€๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ๐ŸŒฟ.
348
+ - **Relation**: Guides shape destiny ๐ŸŽฒ.
349
+ - **Lesson**: Cunning ๐Ÿง  defies fate โšฐ๏ธ.
350
+
351
+ 28. ๐Ÿง **Nonhuman Traditions**
352
+ - **Corellon, Moradin, Gruumsh**: Elf ๐Ÿง, dwarf โ›๏ธ, orc ๐Ÿ—ก๏ธ fathers.
353
+ - **Relation**: Rivals define purpose โš”๏ธ.
354
+ - **Lesson**: Community ๐Ÿค endures.
355
+
356
+ 29. แšฑ **Norse Mythology**
357
+ - **Odin, Frigg, Loki**: Father ๐Ÿ‘๏ธ, mother ๐Ÿ‘‘, trickster son ๐ŸฆŠ.
358
+ - **Relation**: Family faces doom โšก.
359
+ - **Lesson**: Sacrifice ๐Ÿฉธ costs.
360
+
361
+ 30. ๐Ÿ—ฟ **Sumerian Mythology**
362
+ - **Enki, Inanna, Anu**: Son ๐ŸŒŠ, daughter โค๏ธ, father ๐ŸŒŒ.
363
+ - **Relation**: Kin wield knowledge ๐Ÿง .
364
+ - **Lesson**: Ambition ๐ŸŒŸ shapes.
365
+
366
+ 31. ๐Ÿ“š **Appendices**
367
+ - **Planes**: Realms of gods, spirits, saints, e.g., Paradise ๐ŸŒˆ and Svarga โœจ.
368
+ - **Symbols**: Rituals ๐Ÿ•‰๏ธ and artifacts ๐Ÿ—ฟ of faith.
369
+ - **Charts**: Domains and duties for devotees ๐Ÿ“Š.
370
+
371
+ 32. ๐ŸŒŒ **Planes of Existence**
372
+ - **Heaven/Paradise**: Christian/Muslim abode ๐ŸŒŸ.
373
+ - **Svarga**: Hindu divine realm โœจ.
374
+ - **Underworld**: Spirits linger, e.g., Sheol โšฐ๏ธ and Naraka ๐Ÿ”ฅ.
375
+
376
+ 33. ๐Ÿ• **Temple Trappings**
377
+ - **Cross/Crescent**: Christian/Muslim faith โœ๏ธโ˜ช๏ธ.
378
+ - **Mandalas**: Hindu devotion ๐ŸŒ€.
379
+ - **Relics**: Saintsโ€™ and prophetsโ€™ legacy ๐Ÿ—๏ธ.
380
+
381
+ 34. ๐Ÿ“Š **Clerical Chart**
382
+ - **Gods**: Domains, e.g., creation ๐ŸŒ and mercy โค๏ธ.
383
+ - **Spirits**: Influence, like guidance ๐ŸŒฟ and mischief ๐Ÿ˜ˆ.
384
+ - **Saints/Prophets**: Virtues, e.g., justice โš–๏ธ and prophecy ๐Ÿ”ฎ.
 
385
  """
386
 
387
  create_pdf_tab(default_markdown)