Get title string, handling both string and dict formats.
(title, lang: str = "en")
| 186 | |
| 187 | |
| 188 | def get_title_str(title, lang: str = "en") -> str: |
| 189 | """Get title string, handling both string and dict formats.""" |
| 190 | if isinstance(title, dict): |
| 191 | return title.get(lang, "") or title.get("en", "") |
| 192 | return str(title) if title else "" |
| 193 | |
| 194 | |
| 195 | def write_md(path: Path, content: str, dry_run: bool = False) -> bool: |
no test coverage detected