(text: str)
| 2085 | |
| 2086 | def _prune_empty_daily_note_sections(text: str) -> str: |
| 2087 | lines = text.splitlines() |
| 2088 | output: List[str] = [] |
| 2089 | index = 0 |
| 2090 | while index < len(lines): |
| 2091 | line = lines[index] |
| 2092 | if line.startswith("# "): |
| 2093 | next_index = index + 1 |
| 2094 | while next_index < len(lines) and not lines[next_index].startswith("# "): |
| 2095 | next_index += 1 |
| 2096 | section_body = "\n".join(lines[index + 1 : next_index]).strip() |
| 2097 | if not section_body: |
| 2098 | index = next_index |
| 2099 | continue |
| 2100 | output.append(line) |
| 2101 | index += 1 |
| 2102 | return "\n".join(output).strip() |
| 2103 | |
| 2104 | |
| 2105 | def _sync_obsidian_daily_note( |
| 2106 | *, |
no outgoing calls
no test coverage detected