docs(notion-writer): fix plan — circular import, columns loop, error hint
Pre-flight review fixes: lazy import in md_translate to break the notion_writer<->md_translate cycle; clean columns state machine; markdown deletion hint in explain_api_error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -674,7 +674,8 @@ from __future__ import annotations
|
|||||||
import re
|
import re
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from notion_writer import extract_notion_id, format_id_with_dashes
|
# NOTE: `notion_writer` is imported lazily inside _translate_mentions to avoid
|
||||||
|
# a circular import (notion_writer imports this module at its top level).
|
||||||
|
|
||||||
# Skill alert type -> (emoji, Notion enhanced-markdown background color)
|
# Skill alert type -> (emoji, Notion enhanced-markdown background color)
|
||||||
CALLOUT_MAP = {
|
CALLOUT_MAP = {
|
||||||
@@ -689,6 +690,8 @@ _MENTION_RE = re.compile(r'@\[([^\]]+)\]\(([^)\s]+)\)')
|
|||||||
|
|
||||||
|
|
||||||
def _translate_mentions(text: str) -> str:
|
def _translate_mentions(text: str) -> str:
|
||||||
|
from notion_writer import extract_notion_id, format_id_with_dashes # lazy: breaks import cycle
|
||||||
|
|
||||||
def repl(m: "re.Match") -> str:
|
def repl(m: "re.Match") -> str:
|
||||||
title, target = m.group(1), m.group(2)
|
title, target = m.group(1), m.group(2)
|
||||||
page_id = extract_notion_id(target)
|
page_id = extract_notion_id(target)
|
||||||
|
|||||||
Reference in New Issue
Block a user