feat: 完整数据版加入六种星座大运
Sthira、Drig、Shoola、Navamsha、Niryaana Shoola 与 K.N. Rao 的 Chara 从本盘算出。Lagna Kendradi 不上表。未推送。
This commit is contained in:
@@ -2185,6 +2185,18 @@ def _apply_local_report_conventions(markdown: str, *, language: str = "zh") -> s
|
||||
return text
|
||||
|
||||
|
||||
def _append_native_rashi_dashas(markdown: str, packet: dict) -> str:
|
||||
"""Full-data edition only. The parity reader and the consult card do not call this."""
|
||||
try:
|
||||
from rashi_dasha_report import render_rashi_dasha_chapter
|
||||
except ModuleNotFoundError: # pragma: no cover - package import compatibility
|
||||
from scripts.rashi_dasha_report import render_rashi_dasha_chapter
|
||||
chapter = render_rashi_dasha_chapter(packet if isinstance(packet, dict) else {})
|
||||
if not chapter.strip():
|
||||
return markdown
|
||||
return markdown.rstrip() + "\n\n" + chapter
|
||||
|
||||
|
||||
def _insert_opening_focus(markdown: str, focus: str) -> str:
|
||||
"""Put the current-period focus directly under the title."""
|
||||
first = next((line.strip() for line in focus.splitlines() if line.strip()), "")
|
||||
@@ -2221,7 +2233,10 @@ def render_full_data_markdown(packet: dict) -> str:
|
||||
count=1,
|
||||
flags=re.DOTALL,
|
||||
).strip()
|
||||
english_markdown = _insert_opening_focus(render_pl9_parity_markdown(packet), focus)
|
||||
english_markdown = _append_native_rashi_dashas(
|
||||
_insert_opening_focus(render_pl9_parity_markdown(packet), focus),
|
||||
packet,
|
||||
)
|
||||
if structured_appendix:
|
||||
english_markdown = (
|
||||
english_markdown.rstrip()
|
||||
@@ -2246,7 +2261,10 @@ def render_full_data_markdown(packet: dict) -> str:
|
||||
count=1,
|
||||
flags=re.DOTALL,
|
||||
).strip()
|
||||
zh_markdown = _insert_opening_focus(render_pl9_parity_markdown(packet), focus)
|
||||
zh_markdown = _append_native_rashi_dashas(
|
||||
_insert_opening_focus(render_pl9_parity_markdown(packet), focus),
|
||||
packet,
|
||||
)
|
||||
if zh_structured_appendix and "## 结构化资料附录" not in zh_markdown:
|
||||
zh_markdown = (
|
||||
zh_markdown.rstrip()
|
||||
|
||||
Reference in New Issue
Block a user