notionary 0.1.21__tar.gz → 0.1.22__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.21 → notionary-0.1.22}/PKG-INFO +1 -1
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/prompts/synthax_prompt_builder.py +10 -6
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/registry/block_element_registry.py +7 -1
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/content/page_content_manager.py +26 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary.egg-info/PKG-INFO +1 -1
- {notionary-0.1.21 → notionary-0.1.22}/setup.py +1 -1
- {notionary-0.1.21 → notionary-0.1.22}/LICENSE +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/README.md +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/__init__.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/database/database_discovery.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/database/database_info_service.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/database/models/page_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/database/notion_database.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/database/notion_database_factory.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/audio_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/bookmark_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/bulleted_list_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/callout_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/code_block_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/column_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/divider_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/embed_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/heading_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/image_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/mention_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/notion_block_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/numbered_list_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/paragraph_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/prompts/element_prompt_content.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/qoute_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/registry/block_element_registry_builder.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/table_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/text_inline_formatter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/todo_lists.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/toggle_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/elements/video_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/exceptions/database_exceptions.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/exceptions/page_creation_exception.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/notion_client.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/content/notion_page_content_chunker.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/markdown_to_notion_converter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/metadata/metadata_editor.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/metadata/notion_icon_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/metadata/notion_page_cover_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/notion_page.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/notion_page_factory.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/notion_to_markdown_converter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/database_property_service.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/page_property_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/property_formatter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/property_operation_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/property_value_extractor.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/relations/notion_page_relation_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/relations/notion_page_title_resolver.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/relations/page_database_relation.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/page/relations/relation_operation_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/util/logging_mixin.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary/util/page_id_utils.py +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary.egg-info/SOURCES.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary.egg-info/dependency_links.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary.egg-info/requires.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/notionary.egg-info/top_level.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.22}/setup.cfg +0 -0
@@ -15,21 +15,25 @@ Notion supports standard Markdown with some special extensions for creating rich
|
|
15
15
|
|
16
16
|
{element_docs}
|
17
17
|
|
18
|
-
|
18
|
+
CRITICAL USAGE GUIDELINES:
|
19
19
|
|
20
20
|
1. Do NOT start content with a level 1 heading (# Heading). In Notion, the page title is already displayed in the metadata, so starting with an H1 heading is redundant. Begin with H2 (## Heading) or lower for section headings.
|
21
21
|
|
22
|
-
2.
|
23
|
-
|
22
|
+
2. BACKTICK HANDLING - EXTREMELY IMPORTANT:
|
23
|
+
❌ NEVER wrap entire content or responses in triple backticks (```).
|
24
|
+
❌ DO NOT use triple backticks (```) for anything except CODE BLOCKS or DIAGRAMS.
|
25
|
+
❌ DO NOT use triple backticks to mark or highlight regular text or examples.
|
26
|
+
✅ USE triple backticks ONLY for actual programming code, pseudocode, or specialized notation.
|
27
|
+
✅ When showing Markdown syntax examples, use inline code formatting with single backticks.
|
24
28
|
|
25
29
|
3. Use inline formatting (bold, italic, etc.) across all content to enhance readability.
|
26
|
-
Proper typography is essential for creating scannable, well-structured documents.
|
30
|
+
Proper typography is essential for creating scannable, well-structured documents.
|
27
31
|
|
28
32
|
4. Notion's extensions to Markdown provide richer formatting options than standard Markdown
|
29
|
-
while maintaining the familiar Markdown syntax for basic elements.
|
33
|
+
while maintaining the familiar Markdown syntax for basic elements.
|
30
34
|
|
31
35
|
5. Always structure content with clear headings, lists, and paragraphs to create visually appealing
|
32
|
-
and well-organized documents.
|
36
|
+
and well-organized documents.
|
33
37
|
"""
|
34
38
|
|
35
39
|
@staticmethod
|
@@ -14,7 +14,7 @@ class BlockElementRegistry:
|
|
14
14
|
"""
|
15
15
|
Initialize a new registry instance.
|
16
16
|
"""
|
17
|
-
self._elements = []
|
17
|
+
self._elements: List[NotionBlockElement] = []
|
18
18
|
|
19
19
|
if elements:
|
20
20
|
for element in elements:
|
@@ -33,6 +33,12 @@ class BlockElementRegistry:
|
|
33
33
|
self._elements.remove(element_class)
|
34
34
|
return True
|
35
35
|
return False
|
36
|
+
|
37
|
+
def contains(self, element_class: Type[NotionBlockElement]) -> bool:
|
38
|
+
"""
|
39
|
+
Check if the registry contains the specified element class.
|
40
|
+
"""
|
41
|
+
return element_class in self._elements
|
36
42
|
|
37
43
|
def clear(self):
|
38
44
|
"""Clear the registry completely."""
|
@@ -35,7 +35,11 @@ class PageContentManager(LoggingMixin):
|
|
35
35
|
async def append_markdown(self, markdown_text: str) -> str:
|
36
36
|
"""
|
37
37
|
Append markdown text to a Notion page, automatically handling content length limits.
|
38
|
+
First strips out triple backtick markdown fences if they wrap the entire content.
|
38
39
|
"""
|
40
|
+
# Strip out triple backticks if they wrap the entire content
|
41
|
+
markdown_text = self._strip_wrapping_backticks(markdown_text)
|
42
|
+
|
39
43
|
try:
|
40
44
|
blocks = self._markdown_to_notion_converter.convert(markdown_text)
|
41
45
|
|
@@ -172,3 +176,25 @@ class PageContentManager(LoggingMixin):
|
|
172
176
|
async def get_text(self) -> str:
|
173
177
|
blocks = await self.get_page_blocks_with_children()
|
174
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
|
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
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.22}/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
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/database_property_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.22}/notionary/page/properites/property_operation_result.py
RENAMED
File without changes
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.22}/notionary/page/relations/notion_page_relation_manager.py
RENAMED
File without changes
|
{notionary-0.1.21 → notionary-0.1.22}/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
|