notionary 0.1.22__tar.gz → 0.1.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {notionary-0.1.22 → notionary-0.1.24}/PKG-INFO +1 -1
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/code_block_element.py +2 -1
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/prompts/element_prompt_content.py +5 -1
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/prompts/synthax_prompt_builder.py +8 -1
- {notionary-0.1.22 → notionary-0.1.24}/notionary/notion_client.py +1 -1
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/content/page_content_manager.py +10 -27
- {notionary-0.1.22 → notionary-0.1.24}/notionary.egg-info/PKG-INFO +1 -1
- {notionary-0.1.22 → notionary-0.1.24}/setup.py +1 -1
- {notionary-0.1.22 → notionary-0.1.24}/LICENSE +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/README.md +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/__init__.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/database/database_discovery.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/database/database_info_service.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/database/models/page_result.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/database/notion_database.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/database/notion_database_factory.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/audio_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/bookmark_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/bulleted_list_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/callout_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/column_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/divider_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/embed_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/heading_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/image_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/mention_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/notion_block_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/numbered_list_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/paragraph_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/qoute_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/registry/block_element_registry.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/registry/block_element_registry_builder.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/table_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/text_inline_formatter.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/todo_lists.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/toggle_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/elements/video_element.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/exceptions/database_exceptions.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/exceptions/page_creation_exception.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/content/notion_page_content_chunker.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/markdown_to_notion_converter.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/metadata/metadata_editor.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/metadata/notion_icon_manager.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/metadata/notion_page_cover_manager.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/notion_page.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/notion_page_factory.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/notion_to_markdown_converter.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/database_property_service.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/page_property_manager.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/property_formatter.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/property_operation_result.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/property_value_extractor.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/notion_page_relation_manager.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/notion_page_title_resolver.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/page_database_relation.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/relation_operation_result.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/util/logging_mixin.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary/util/page_id_utils.py +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary.egg-info/SOURCES.txt +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary.egg-info/dependency_links.txt +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary.egg-info/requires.txt +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/notionary.egg-info/top_level.txt +0 -0
- {notionary-0.1.22 → notionary-0.1.24}/setup.cfg +0 -0
@@ -155,4 +155,5 @@ class CodeBlockElement(NotionBlockElement):
|
|
155
155
|
'```json\n{"name": "Alice", "age": 30}\n```',
|
156
156
|
"```mermaid\nflowchart TD\n A --> B\n```",
|
157
157
|
],
|
158
|
-
|
158
|
+
"avoid": "NEVER EVER wrap markdown content with ```markdown. Markdown should be written directly without code block formatting. NEVER use ```markdown under any circumstances."
|
159
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import TypedDict, List
|
1
|
+
from typing import NotRequired, TypedDict, List
|
2
2
|
|
3
3
|
|
4
4
|
class ElementPromptContent(TypedDict):
|
@@ -18,3 +18,7 @@ class ElementPromptContent(TypedDict):
|
|
18
18
|
|
19
19
|
when_to_use: str
|
20
20
|
"""Guidelines explaining the appropriate scenarios for using this element."""
|
21
|
+
|
22
|
+
avoid: NotRequired[str]
|
23
|
+
"""Optional field listing scenarios when this element should be avoided."""
|
24
|
+
|
@@ -34,6 +34,11 @@ CRITICAL USAGE GUIDELINES:
|
|
34
34
|
|
35
35
|
5. Always structure content with clear headings, lists, and paragraphs to create visually appealing
|
36
36
|
and well-organized documents.
|
37
|
+
|
38
|
+
6. CONTENT FORMATTING - CRITICAL:
|
39
|
+
❌ DO NOT include introductory phrases like "I understand that..." or "Here's the content...".
|
40
|
+
✅ Provide ONLY the requested content directly without any prefacing text or meta-commentary.
|
41
|
+
✅ Generate just the content itself, formatted according to these guidelines.
|
37
42
|
"""
|
38
43
|
|
39
44
|
@staticmethod
|
@@ -62,8 +67,10 @@ CRITICAL USAGE GUIDELINES:
|
|
62
67
|
f"**Example:** {content['examples'][0]}" if content["examples"] else "",
|
63
68
|
f"**When to use:** {content['when_to_use']}",
|
64
69
|
]
|
70
|
+
|
71
|
+
if "avoid" in content and content["avoid"]:
|
72
|
+
doc_parts.append(f"**Avoid:** {content['avoid']}")
|
65
73
|
|
66
|
-
# Filter out any empty parts and join with newlines
|
67
74
|
return "\n".join([part for part in doc_parts if part])
|
68
75
|
|
69
76
|
@classmethod
|
@@ -32,16 +32,21 @@ class PageContentManager(LoggingMixin):
|
|
32
32
|
)
|
33
33
|
self._chunker = NotionPageContentChunker()
|
34
34
|
|
35
|
-
async def append_markdown(self, markdown_text: str) -> str:
|
35
|
+
async def append_markdown(self, markdown_text: str, append_divider: bool = False) -> str:
|
36
36
|
"""
|
37
37
|
Append markdown text to a Notion page, automatically handling content length limits.
|
38
38
|
First strips out triple backtick markdown fences if they wrap the entire content.
|
39
|
-
"""
|
40
|
-
# Strip out triple backticks if they wrap the entire content
|
41
|
-
markdown_text = self._strip_wrapping_backticks(markdown_text)
|
42
39
|
|
40
|
+
Args:
|
41
|
+
markdown_text: The markdown text to append
|
42
|
+
append_divider: If True, appends a divider after the markdown content (default: False)
|
43
|
+
"""
|
43
44
|
try:
|
44
45
|
blocks = self._markdown_to_notion_converter.convert(markdown_text)
|
46
|
+
|
47
|
+
if append_divider:
|
48
|
+
divider_block = {"type": "divider", "divider": {}}
|
49
|
+
blocks.append(divider_block)
|
45
50
|
|
46
51
|
fixed_blocks = self._chunker.fix_blocks_content_length(blocks)
|
47
52
|
|
@@ -175,26 +180,4 @@ class PageContentManager(LoggingMixin):
|
|
175
180
|
|
176
181
|
async def get_text(self) -> str:
|
177
182
|
blocks = await self.get_page_blocks_with_children()
|
178
|
-
return self._notion_to_markdown_converter.convert(blocks)
|
179
|
-
|
180
|
-
def _strip_wrapping_backticks(self, text: str) -> str:
|
181
|
-
"""
|
182
|
-
Strip out triple backticks if they wrap the entire content.
|
183
|
-
This prevents LLM-generated markdown fences from breaking the Notion import.
|
184
|
-
|
185
|
-
Args:
|
186
|
-
text: The markdown text that might be wrapped in backticks
|
187
|
-
|
188
|
-
Returns:
|
189
|
-
The text with wrapping backticks removed, if present
|
190
|
-
"""
|
191
|
-
lines = text.strip().split('\n')
|
192
|
-
|
193
|
-
if len(lines) >= 2:
|
194
|
-
first_line = lines[0].strip()
|
195
|
-
last_line = lines[-1].strip()
|
196
|
-
|
197
|
-
if first_line.startswith('```') and last_line == '```':
|
198
|
-
return '\n'.join(lines[1:-1])
|
199
|
-
|
200
|
-
return text
|
183
|
+
return self._notion_to_markdown_converter.convert(blocks)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{notionary-0.1.22 → notionary-0.1.24}/notionary/elements/registry/block_element_registry_builder.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/database_property_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{notionary-0.1.22 → notionary-0.1.24}/notionary/page/properites/property_operation_result.py
RENAMED
File without changes
|
File without changes
|
{notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/notion_page_relation_manager.py
RENAMED
File without changes
|
{notionary-0.1.22 → notionary-0.1.24}/notionary/page/relations/notion_page_title_resolver.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|