notionary 0.1.21__tar.gz → 0.1.23__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.23}/PKG-INFO +1 -1
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/code_block_element.py +2 -1
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/prompts/element_prompt_content.py +5 -1
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/prompts/synthax_prompt_builder.py +18 -7
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/registry/block_element_registry.py +7 -1
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/content/page_content_manager.py +2 -1
- {notionary-0.1.21 → notionary-0.1.23}/notionary.egg-info/PKG-INFO +1 -1
- {notionary-0.1.21 → notionary-0.1.23}/setup.py +1 -1
- {notionary-0.1.21 → notionary-0.1.23}/LICENSE +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/README.md +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/__init__.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/database/database_discovery.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/database/database_info_service.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/database/models/page_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/database/notion_database.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/database/notion_database_factory.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/audio_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/bookmark_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/bulleted_list_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/callout_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/column_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/divider_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/embed_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/heading_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/image_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/mention_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/notion_block_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/numbered_list_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/paragraph_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/qoute_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/registry/block_element_registry_builder.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/table_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/text_inline_formatter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/todo_lists.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/toggle_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/elements/video_element.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/exceptions/database_exceptions.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/exceptions/page_creation_exception.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/notion_client.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/content/notion_page_content_chunker.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/markdown_to_notion_converter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/metadata/metadata_editor.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/metadata/notion_icon_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/metadata/notion_page_cover_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/notion_page.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/notion_page_factory.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/notion_to_markdown_converter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/database_property_service.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/page_property_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/property_formatter.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/property_operation_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/property_value_extractor.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/relations/notion_page_relation_manager.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/relations/notion_page_title_resolver.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/relations/page_database_relation.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/page/relations/relation_operation_result.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/util/logging_mixin.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary/util/page_id_utils.py +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary.egg-info/SOURCES.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary.egg-info/dependency_links.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary.egg-info/requires.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/notionary.egg-info/top_level.txt +0 -0
- {notionary-0.1.21 → notionary-0.1.23}/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
|
+
|
@@ -15,21 +15,30 @@ 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.
|
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.
|
33
42
|
"""
|
34
43
|
|
35
44
|
@staticmethod
|
@@ -58,8 +67,10 @@ and well-organized documents.
|
|
58
67
|
f"**Example:** {content['examples'][0]}" if content["examples"] else "",
|
59
68
|
f"**When to use:** {content['when_to_use']}",
|
60
69
|
]
|
70
|
+
|
71
|
+
if "avoid" in content and content["avoid"]:
|
72
|
+
doc_parts.append(f"**Avoid:** {content['avoid']}")
|
61
73
|
|
62
|
-
# Filter out any empty parts and join with newlines
|
63
74
|
return "\n".join([part for part in doc_parts if part])
|
64
75
|
|
65
76
|
@classmethod
|
@@ -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,6 +35,7 @@ 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
|
"""
|
39
40
|
try:
|
40
41
|
blocks = self._markdown_to_notion_converter.convert(markdown_text)
|
@@ -171,4 +172,4 @@ class PageContentManager(LoggingMixin):
|
|
171
172
|
|
172
173
|
async def get_text(self) -> str:
|
173
174
|
blocks = await self.get_page_blocks_with_children()
|
174
|
-
return self._notion_to_markdown_converter.convert(blocks)
|
175
|
+
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
|
{notionary-0.1.21 → notionary-0.1.23}/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.23}/notionary/page/properites/database_property_service.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.23}/notionary/page/properites/property_operation_result.py
RENAMED
File without changes
|
File without changes
|
{notionary-0.1.21 → notionary-0.1.23}/notionary/page/relations/notion_page_relation_manager.py
RENAMED
File without changes
|
{notionary-0.1.21 → notionary-0.1.23}/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
|