notionary 0.2.21__py3-none-any.whl → 0.2.23__py3-none-any.whl
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/blocks/_bootstrap.py +9 -1
- notionary/blocks/audio/audio_element.py +53 -28
- notionary/blocks/audio/audio_markdown_node.py +10 -4
- notionary/blocks/base_block_element.py +15 -3
- notionary/blocks/bookmark/bookmark_element.py +39 -36
- notionary/blocks/bookmark/bookmark_markdown_node.py +16 -17
- notionary/blocks/breadcrumbs/breadcrumb_element.py +2 -2
- notionary/blocks/bulleted_list/bulleted_list_element.py +21 -4
- notionary/blocks/callout/callout_element.py +20 -4
- notionary/blocks/child_database/__init__.py +11 -4
- notionary/blocks/child_database/child_database_element.py +59 -0
- notionary/blocks/child_database/child_database_models.py +7 -14
- notionary/blocks/child_page/child_page_element.py +94 -0
- notionary/blocks/client.py +0 -1
- notionary/blocks/code/code_element.py +51 -2
- notionary/blocks/code/code_markdown_node.py +52 -1
- notionary/blocks/column/column_element.py +9 -3
- notionary/blocks/column/column_list_element.py +18 -3
- notionary/blocks/divider/divider_element.py +3 -11
- notionary/blocks/embed/embed_element.py +27 -6
- notionary/blocks/equation/equation_element.py +94 -41
- notionary/blocks/equation/equation_element_markdown_node.py +8 -9
- notionary/blocks/file/file_element.py +56 -37
- notionary/blocks/file/file_element_markdown_node.py +9 -7
- notionary/blocks/guards.py +22 -0
- notionary/blocks/heading/heading_element.py +23 -4
- notionary/blocks/image_block/image_element.py +43 -38
- notionary/blocks/image_block/image_markdown_node.py +10 -5
- notionary/blocks/mixins/captions/__init__.py +4 -0
- notionary/blocks/mixins/captions/caption_markdown_node_mixin.py +31 -0
- notionary/blocks/mixins/captions/caption_mixin.py +92 -0
- notionary/blocks/models.py +3 -1
- notionary/blocks/numbered_list/numbered_list_element.py +21 -4
- notionary/blocks/paragraph/paragraph_element.py +21 -5
- notionary/blocks/pdf/pdf_element.py +47 -41
- notionary/blocks/pdf/pdf_markdown_node.py +9 -7
- notionary/blocks/quote/quote_element.py +26 -9
- notionary/blocks/quote/quote_markdown_node.py +2 -2
- notionary/blocks/registry/block_registry.py +1 -46
- notionary/blocks/registry/block_registry_builder.py +8 -0
- notionary/blocks/rich_text/rich_text_models.py +62 -29
- notionary/blocks/rich_text/text_inline_formatter.py +432 -101
- notionary/blocks/syntax_prompt_builder.py +137 -0
- notionary/blocks/table/table_element.py +110 -9
- notionary/blocks/table_of_contents/table_of_contents_element.py +19 -2
- notionary/blocks/todo/todo_element.py +21 -4
- notionary/blocks/toggle/toggle_element.py +19 -3
- notionary/blocks/toggle/toggle_markdown_node.py +1 -1
- notionary/blocks/toggleable_heading/toggleable_heading_element.py +19 -4
- notionary/blocks/types.py +69 -0
- notionary/blocks/video/video_element.py +44 -39
- notionary/blocks/video/video_markdown_node.py +10 -5
- notionary/comments/__init__.py +26 -0
- notionary/comments/client.py +211 -0
- notionary/comments/models.py +129 -0
- notionary/database/client.py +23 -0
- notionary/file_upload/models.py +2 -2
- notionary/markdown/markdown_builder.py +34 -27
- notionary/page/client.py +21 -6
- notionary/page/notion_page.py +77 -2
- notionary/page/page_content_deleting_service.py +117 -0
- notionary/page/page_content_writer.py +89 -113
- notionary/page/page_context.py +64 -0
- notionary/page/reader/handler/__init__.py +2 -0
- notionary/page/reader/handler/base_block_renderer.py +4 -4
- notionary/page/reader/handler/block_rendering_context.py +5 -0
- notionary/page/reader/handler/line_renderer.py +16 -3
- notionary/page/reader/handler/numbered_list_renderer.py +85 -0
- notionary/page/reader/page_content_retriever.py +17 -5
- notionary/page/writer/handler/__init__.py +2 -0
- notionary/page/writer/handler/code_handler.py +12 -40
- notionary/page/writer/handler/column_handler.py +12 -12
- notionary/page/writer/handler/column_list_handler.py +13 -13
- notionary/page/writer/handler/equation_handler.py +74 -0
- notionary/page/writer/handler/line_handler.py +4 -4
- notionary/page/writer/handler/regular_line_handler.py +31 -37
- notionary/page/writer/handler/table_handler.py +8 -72
- notionary/page/writer/handler/toggle_handler.py +14 -12
- notionary/page/writer/handler/toggleable_heading_handler.py +22 -16
- notionary/page/writer/markdown_to_notion_converter.py +28 -9
- notionary/page/writer/markdown_to_notion_converter_context.py +30 -0
- notionary/page/writer/markdown_to_notion_formatting_post_processor.py +73 -0
- notionary/page/writer/markdown_to_notion_post_processor.py +0 -0
- notionary/page/writer/markdown_to_notion_text_length_post_processor.py +0 -0
- notionary/page/writer/notion_text_length_processor.py +150 -0
- notionary/shared/__init__.py +5 -0
- notionary/shared/name_to_id_resolver.py +203 -0
- notionary/telemetry/service.py +0 -1
- notionary/user/notion_user_manager.py +22 -95
- notionary/util/concurrency_limiter.py +0 -0
- notionary/workspace.py +4 -4
- notionary-0.2.23.dist-info/METADATA +235 -0
- {notionary-0.2.21.dist-info → notionary-0.2.23.dist-info}/RECORD +96 -77
- notionary/page/markdown_whitespace_processor.py +0 -80
- notionary/page/notion_text_length_utils.py +0 -119
- notionary/user/notion_user_provider.py +0 -1
- notionary-0.2.21.dist-info/METADATA +0 -229
- /notionary/page/reader/handler/{context.py → equation_renderer.py} +0 -0
- {notionary-0.2.21.dist-info → notionary-0.2.23.dist-info}/LICENSE +0 -0
- {notionary-0.2.21.dist-info → notionary-0.2.23.dist-info}/WHEEL +0 -0
@@ -1,116 +1,126 @@
|
|
1
1
|
notionary/__init__.py,sha256=u6I31uJ8E_lqg17QIzylzz-mnvnLc4hmVuBGvnDwFgI,607
|
2
2
|
notionary/base_notion_client.py,sha256=EKExy91oeVHdknK-XU2IkKB6SJgN96ZfbblRK05wnV4,7071
|
3
3
|
notionary/blocks/__init__.py,sha256=CGaDCEmUepqnjkcm7X1OKdxAhtbcIZAu3fxJeySyu6o,76
|
4
|
-
notionary/blocks/_bootstrap.py,sha256=
|
4
|
+
notionary/blocks/_bootstrap.py,sha256=8xs6EDSPdGNr7NsrxmH2pg1dvVjfbghX5N74tRALKog,9450
|
5
5
|
notionary/blocks/audio/__init__.py,sha256=3158rsK4MIO_vBQV0kfZWIOKd5Cout72bdJljP-f7KM,368
|
6
|
-
notionary/blocks/audio/audio_element.py,sha256=
|
7
|
-
notionary/blocks/audio/audio_markdown_node.py,sha256=
|
6
|
+
notionary/blocks/audio/audio_element.py,sha256=owVZmgsEulL7NBexp0smMBONXj8uVVesup7970vLfOg,4615
|
7
|
+
notionary/blocks/audio/audio_markdown_node.py,sha256=xYaKYJq7OZ3ky5BxActwFYESNoPBtw3VjCjmEeD9ep0,1140
|
8
8
|
notionary/blocks/audio/audio_models.py,sha256=ts281Wgjh0FQBK4a6IKKNGPcG0U18T1euCgo83-JSg4,229
|
9
|
-
notionary/blocks/base_block_element.py,sha256=
|
9
|
+
notionary/blocks/base_block_element.py,sha256=r9W3EHIwQ2A824x2MlFGTfQpZjMvfB-fUVTI2x3peyc,1546
|
10
10
|
notionary/blocks/bookmark/__init__.py,sha256=ofLnuXlG-y0C3ex-noLA92iXUFjiej5CyrxVXG_1db4,447
|
11
|
-
notionary/blocks/bookmark/bookmark_element.py,sha256=
|
12
|
-
notionary/blocks/bookmark/bookmark_markdown_node.py,sha256=
|
11
|
+
notionary/blocks/bookmark/bookmark_element.py,sha256=y6wkdRor3cn9n5gE1pFnH6bc5B43YYqrwWHTXrC0GPs,3399
|
12
|
+
notionary/blocks/bookmark/bookmark_markdown_node.py,sha256=5DCTQ8AlGLiJUUl4Z0WGEGF4IrJ127f3KNGFm2ZD-ug,1383
|
13
13
|
notionary/blocks/bookmark/bookmark_models.py,sha256=kJTitF93xd0YITvP_FuwpjnBUNLeDMr7fDAXV8MAJrk,375
|
14
14
|
notionary/blocks/breadcrumbs/__init__.py,sha256=vw7--1u5TAcX4l3J0eu98HbxG6wxsnPrkt7YouT_ESA,498
|
15
|
-
notionary/blocks/breadcrumbs/breadcrumb_element.py,sha256=
|
15
|
+
notionary/blocks/breadcrumbs/breadcrumb_element.py,sha256=cVZHiMqaYL4EGphnX1OCh3Inf93TFwFosB-1PGCS2do,1268
|
16
16
|
notionary/blocks/breadcrumbs/breadcrumb_markdown_node.py,sha256=tbcQOzMHx-dQGa5UAE2jowzPM_wItsb76bCGU4YIKw4,745
|
17
17
|
notionary/blocks/breadcrumbs/breadcrumb_models.py,sha256=-XGIIMYiQuGe5iXmW-1Y9Y9Yca0w6u3HbiD1SBue8sI,237
|
18
18
|
notionary/blocks/bulleted_list/__init__.py,sha256=2EvFm2h-X6KUHGQhQiOYBqh-DvZbL0qT453eokd8eyw,549
|
19
|
-
notionary/blocks/bulleted_list/bulleted_list_element.py,sha256=
|
19
|
+
notionary/blocks/bulleted_list/bulleted_list_element.py,sha256=YY2kOCgFinD7Mk6Ns9KLxm4KlNtlZoT87zcrEpq97HM,3095
|
20
20
|
notionary/blocks/bulleted_list/bulleted_list_markdown_node.py,sha256=1MmGbQAbkeV3vwPlqC4ItcR-Abw8JymYWyGLEV2-HfI,827
|
21
21
|
notionary/blocks/bulleted_list/bulleted_list_models.py,sha256=2rOHv8KIfTcx0z4JtK968BnLc4lkCrF8So-e5QL_FEY,561
|
22
22
|
notionary/blocks/callout/__init__.py,sha256=iDLuJ4szAOY4tCL0NK_bqCzlTC109o51c1cGgDoruZg,431
|
23
|
-
notionary/blocks/callout/callout_element.py,sha256=
|
23
|
+
notionary/blocks/callout/callout_element.py,sha256=6Ss1jv1cqAM4GuNGvuy7dCFjpp-dLavf-wXevn3IEmw,3575
|
24
24
|
notionary/blocks/callout/callout_markdown_node.py,sha256=TMd2wQ0BfoQ0mgHSy5MrqCvpJvovSw7zsLrXnRrJoQs,948
|
25
25
|
notionary/blocks/callout/callout_models.py,sha256=KabWhRCkW1KmTGqt23QTc5iCeVczIzRHIVevEagcKE0,860
|
26
|
-
notionary/blocks/child_database/__init__.py,sha256=
|
27
|
-
notionary/blocks/child_database/
|
26
|
+
notionary/blocks/child_database/__init__.py,sha256=FzjjHOS9Je2oXuxLK9S9Oq56-EDEZRTJBfDzkacFpY0,368
|
27
|
+
notionary/blocks/child_database/child_database_element.py,sha256=1pxtoB_XTIWorYp984TpsPMZy8A5IdQ15nJALyzme-c,2279
|
28
|
+
notionary/blocks/child_database/child_database_models.py,sha256=SP6S9tKTetKNdCkYY3QCxeXd2lq1DyfdNvDhKlhD22Q,264
|
28
29
|
notionary/blocks/child_page/__init__.py,sha256=qaHvJqF8Bfzj0NVE1Q5uN_4o3Jl4RuNYspMZ6E7bUuk,182
|
30
|
+
notionary/blocks/child_page/child_page_element.py,sha256=iZIJ91CQ9ZztivtSNKKA8-OD6YIGZvGsxeuD8vZ1PLg,3389
|
29
31
|
notionary/blocks/child_page/child_page_models.py,sha256=LZhziu2nf-8FopcaQi6dJKOJ3lgY6Pc2S-ace6jPeqQ,240
|
30
|
-
notionary/blocks/client.py,sha256=
|
32
|
+
notionary/blocks/client.py,sha256=9rhfWM3LNxYrB0bez2RKLGE2gVnBaJbrQa1qu6FSKVE,8692
|
31
33
|
notionary/blocks/code/__init__.py,sha256=8mTDHndNb4kzDByETe2gG7-YHMrt18cf_gmV60JXHOc,345
|
32
|
-
notionary/blocks/code/code_element.py,sha256
|
33
|
-
notionary/blocks/code/code_markdown_node.py,sha256=
|
34
|
+
notionary/blocks/code/code_element.py,sha256=-8b63RxD7qJzOkMMF_eLo-z9TdsI33r0JUJc5cyFAzs,5661
|
35
|
+
notionary/blocks/code/code_markdown_node.py,sha256=r25-n8FkV2alrAionnaZIPVGYLnmEw0zeJ_5HpBTWh8,3050
|
34
36
|
notionary/blocks/code/code_models.py,sha256=hK-Ka9whQO-xWASr0sbhRcz-FUc5VY5Pjqa8LPW041o,2178
|
35
37
|
notionary/blocks/column/__init__.py,sha256=KFza6GKRjVa59ktp0euAVSq1oblK_KXSqAfrOIiT9ps,838
|
36
|
-
notionary/blocks/column/column_element.py,sha256=
|
37
|
-
notionary/blocks/column/column_list_element.py,sha256=
|
38
|
+
notionary/blocks/column/column_element.py,sha256=1BtZ5EWq1QpUEAh-OEpvZOTZfeFFDyDKCZCSo8nskJw,2338
|
39
|
+
notionary/blocks/column/column_list_element.py,sha256=gyAZ_Q79g5sEp24IbHHXZvyX8BRmN1jo6ahoVxXxR4E,2398
|
38
40
|
notionary/blocks/column/column_list_markdown_node.py,sha256=RXwPz-d-vfAb39HZapaXiomuY8eKkUuBBEm7rPyLHl0,1396
|
39
41
|
notionary/blocks/column/column_markdown_node.py,sha256=Nc7QReXOWZ0CIuUpgE9dhME4bINo18P1luC6bL0bpPA,1632
|
40
42
|
notionary/blocks/column/column_models.py,sha256=Dv1jBWmuFjjSqyOajkh05jmxEwxF9b-LuDA4Sgw8RJI,664
|
41
43
|
notionary/blocks/divider/__init__.py,sha256=GX3D_Oksg65Dam4lRGdrOGWuZec35ghuYuvF9HDt_y8,431
|
42
|
-
notionary/blocks/divider/divider_element.py,sha256=
|
44
|
+
notionary/blocks/divider/divider_element.py,sha256=MHPctdc5-EwxTrcoA4EjEgiFzWnDZqHziKBoz6xZMrQ,1395
|
43
45
|
notionary/blocks/divider/divider_markdown_node.py,sha256=XMa4txNnzeJPheNKke4poD5t36DE0Fqj963-QZ3gh8M,583
|
44
46
|
notionary/blocks/divider/divider_models.py,sha256=A7jUBYZnE_yRLTZi-sr9sbDCrWNhAdriFNzCpDEBwGU,219
|
45
47
|
notionary/blocks/embed/__init__.py,sha256=EgWphqJaJdt3CMjILKEjVexDSTz1KU0NE2rMDNZaCQ0,399
|
46
|
-
notionary/blocks/embed/embed_element.py,sha256=
|
48
|
+
notionary/blocks/embed/embed_element.py,sha256=xzDBA4OS2O4OASXRoy2oFO5WEm3hF4dVEryokGm8bwk,3594
|
47
49
|
notionary/blocks/embed/embed_markdown_node.py,sha256=8pcLAT4Il1e50wIdCSL11Leq6fnGLOlwNAuKTFY-i98,908
|
48
50
|
notionary/blocks/embed/embed_models.py,sha256=utXtHlIIK5QA24ZJW7l0XfDtrt12DureH1DugOi9mNw,366
|
49
51
|
notionary/blocks/equation/__init__.py,sha256=XP4BgCG-CFXoNI9oUBofg7j2ygZasqdJWhVbJG98kyc,455
|
50
|
-
notionary/blocks/equation/equation_element.py,sha256=
|
51
|
-
notionary/blocks/equation/equation_element_markdown_node.py,sha256=
|
52
|
+
notionary/blocks/equation/equation_element.py,sha256=EME_KVHjdO9e7xnuFxlmkbzRcL1b8LrEikYzXXZGNMM,4750
|
53
|
+
notionary/blocks/equation/equation_element_markdown_node.py,sha256=9Hj6S5uNMWbbHWdKRskLZyCvl8Q8B2HpDS__aZsXDmc,911
|
52
54
|
notionary/blocks/equation/equation_models.py,sha256=WIpnqHmwh2rpNTVvt6eFNzkhHejW8XMWDQbwtLIcxKw,245
|
53
55
|
notionary/blocks/file/__init__.py,sha256=kYPp8iJ-EDWi1BX5E-OkgV_QacQ8ysKn__whyXXEWIw,577
|
54
|
-
notionary/blocks/file/file_element.py,sha256=
|
55
|
-
notionary/blocks/file/file_element_markdown_node.py,sha256=
|
56
|
+
notionary/blocks/file/file_element.py,sha256=ShjPjsUolIrBJyTHm_QORq_aNanQwJQ0ZFNj-0wfuaA,4394
|
57
|
+
notionary/blocks/file/file_element_markdown_node.py,sha256=YJoMkmlbcz7FsysnDMTc7EGubJKdRr8u1zyUnaUtgsU,1148
|
56
58
|
notionary/blocks/file/file_element_models.py,sha256=1eia1-OamnF52AUYtC3Ru-xi6HHsnjw9hcuslkHKXuI,850
|
59
|
+
notionary/blocks/guards.py,sha256=WaZLfPWUcoPwLzhBUQ5vvVM07dZpCXnw2ObtF1mM62c,586
|
57
60
|
notionary/blocks/heading/__init__.py,sha256=dg2hCVsqWv84hvtb6HAb4m1i8b0jyLXokPIYwe5NwZ8,557
|
58
|
-
notionary/blocks/heading/heading_element.py,sha256=
|
61
|
+
notionary/blocks/heading/heading_element.py,sha256=Hdnlzj94AoYCMYZuVOl91tREn1S6hwolA4vWwMtAFWk,3894
|
59
62
|
notionary/blocks/heading/heading_markdown_node.py,sha256=I8_9fg_CsZ-iTMA6PV6V8DBxwa5BDcMfF6NS70iKCbo,881
|
60
63
|
notionary/blocks/heading/heading_models.py,sha256=nOEnb66tYt_653PIt-AqjGaOgefFOK6hKG09epCKSSc,794
|
61
64
|
notionary/blocks/image_block/__init__.py,sha256=ACOCt1hVFzGm_l9Vb0GVATN7PZNBg7jFp1FymrAi8lw,386
|
62
|
-
notionary/blocks/image_block/image_element.py,sha256=
|
63
|
-
notionary/blocks/image_block/image_markdown_node.py,sha256=
|
65
|
+
notionary/blocks/image_block/image_element.py,sha256=02Xkvg4IYZhx5Bb8RBQQAfg7I1fwkrFPGwTW-aMAcus,3610
|
66
|
+
notionary/blocks/image_block/image_markdown_node.py,sha256=KpE2FFetUZh96ppuXkpOfauchgT5eWxqZQmfRotK-qY,1280
|
64
67
|
notionary/blocks/image_block/image_models.py,sha256=vmuGwgq3uP9ojb-6IOdjsEqIKI-9uTa5_0BCMkzJV_A,229
|
65
|
-
notionary/blocks/
|
68
|
+
notionary/blocks/mixins/captions/__init__.py,sha256=hGq6UOBiSgnaWB9UXgvtuG2sLPNgs5GAaz-8vrBmh2Q,166
|
69
|
+
notionary/blocks/mixins/captions/caption_markdown_node_mixin.py,sha256=uaT_k7cfJgDhvdAavPmRJJHeEcwVECe21dcawcffHVE,1021
|
70
|
+
notionary/blocks/mixins/captions/caption_mixin.py,sha256=6H69_bkUWSy2vNdW01kEJuOyIopZYoL3fMQ3T7xe6XI,3342
|
71
|
+
notionary/blocks/models.py,sha256=cwUgc3wjrKA6MiEnZzCpHS35Y54jPHlIrKRPUNjZm0s,5835
|
66
72
|
notionary/blocks/numbered_list/__init__.py,sha256=NcHMDTveGoYccNo6SYBgPdrIX_ZEAh37jOVpvWFKa4s,549
|
67
|
-
notionary/blocks/numbered_list/numbered_list_element.py,sha256=
|
73
|
+
notionary/blocks/numbered_list/numbered_list_element.py,sha256=ZPoLYCj0xJXeWdjeJImuTeVWd1fqeByLzMj29V4Yf1Y,2755
|
68
74
|
notionary/blocks/numbered_list/numbered_list_markdown_node.py,sha256=Lf2QyBQql1JGPKrI-55ywpMcNGvoQDgKQelK5XNrSZU,785
|
69
75
|
notionary/blocks/numbered_list/numbered_list_models.py,sha256=dx2abI0GawwfjGnOKKUCtM5kzMs_fSFiHOZM3vOM3d4,587
|
70
76
|
notionary/blocks/paragraph/__init__.py,sha256=GjDP9az7qoYeDAaYR0utq6f0F8cFaDb-JhobLhf7ZRY,479
|
71
|
-
notionary/blocks/paragraph/paragraph_element.py,sha256=
|
77
|
+
notionary/blocks/paragraph/paragraph_element.py,sha256=cp90cL0hi9gvIoefmxd-U_xM4z5YiTYt3yO7NQ-Hyvg,2478
|
72
78
|
notionary/blocks/paragraph/paragraph_markdown_node.py,sha256=PCu_KLDk5iIJ2jqB0QYziYDridrrE-Mg_ajfALh8p2s,669
|
73
79
|
notionary/blocks/paragraph/paragraph_models.py,sha256=Hm4IXYNrKqNqMy6QUt6SnIiVNZU_4a-27BH7fNBjc0o,429
|
74
80
|
notionary/blocks/pdf/__init__.py,sha256=NHoP43hIioaAG5GFIkNu5e962oc57xdzax5VdeEklBo,338
|
75
|
-
notionary/blocks/pdf/pdf_element.py,sha256=
|
76
|
-
notionary/blocks/pdf/pdf_markdown_node.py,sha256=
|
81
|
+
notionary/blocks/pdf/pdf_element.py,sha256=AIUe2FFlYnxV_WpcMD9MNI4bFDajYJ9z5hikBE1_p-k,4056
|
82
|
+
notionary/blocks/pdf/pdf_markdown_node.py,sha256=V1J9egeGlvvo4zBTb1Eyv1vQ1oGuWxdm0rJ1naIMjg0,1156
|
77
83
|
notionary/blocks/pdf/pdf_models.py,sha256=k3GB01LNDWnvcxj-gtHSMYAwElrDqFdXkw6DFjlpZNY,293
|
78
84
|
notionary/blocks/quote/__init__.py,sha256=xb5JY4k6naDYkqSQopWvTj2L9YTNMmFOaFingjUbOkU,444
|
79
|
-
notionary/blocks/quote/quote_element.py,sha256=
|
80
|
-
notionary/blocks/quote/quote_markdown_node.py,sha256=
|
85
|
+
notionary/blocks/quote/quote_element.py,sha256=X7YZrhg94rgvWuRi96hbetbMx_FJbYGsmto1P_Am34I,2795
|
86
|
+
notionary/blocks/quote/quote_markdown_node.py,sha256=G0539a5xeMMViAzTz5PvN8KYwSZgwrs8itUfXkZ2qlQ,630
|
81
87
|
notionary/blocks/quote/quote_models.py,sha256=XT1hDfYw8SZUEg-rPfHiC4_0LNVWK-Vs7J6h9PIGgNE,506
|
82
88
|
notionary/blocks/registry/__init__.py,sha256=Het-sHkwxg8c0A1GlPvpm6Ca-GwfN-II55YIpLb-__A,156
|
83
|
-
notionary/blocks/registry/block_registry.py,sha256=
|
84
|
-
notionary/blocks/registry/block_registry_builder.py,sha256=
|
89
|
+
notionary/blocks/registry/block_registry.py,sha256=B01_6jwrIExvMpgxFHDD8P3mXtrkK0SDriNhV7o7NWY,3195
|
90
|
+
notionary/blocks/registry/block_registry_builder.py,sha256=a-oID7OpW4b1bEhhsQOOnwK8evlJem-MralvdhaMYno,8866
|
85
91
|
notionary/blocks/rich_text/__init__.py,sha256=UuOn0MmGKNqK3fLBnEcH2surwbDkZ4GF8Gpn4TLNwLc,773
|
86
|
-
notionary/blocks/rich_text/rich_text_models.py,sha256=
|
87
|
-
notionary/blocks/rich_text/text_inline_formatter.py,sha256=
|
92
|
+
notionary/blocks/rich_text/rich_text_models.py,sha256=QPCHA-vo8DoH7sLAVzOXervoeeV39JRuJkR-IGVA63Y,6278
|
93
|
+
notionary/blocks/rich_text/text_inline_formatter.py,sha256=8J8y27OuMLX-IvSJs0Ogmvw0gw1bgQD9n55nRjSldbg,18379
|
94
|
+
notionary/blocks/syntax_prompt_builder.py,sha256=VwvpR8JyyKR13_ni0jUt--F7w6DoD_nzJB2LbwiJXJc,4626
|
88
95
|
notionary/blocks/table/__init__.py,sha256=Vrs6w_P63cFptV-gVuDpFbU5Rg-bDf3Tf_jUk0n-s-I,511
|
89
|
-
notionary/blocks/table/table_element.py,sha256=
|
96
|
+
notionary/blocks/table/table_element.py,sha256=eeqFHlyQ1dG1ZxB3zdrdvF5qXPsLqSEVyNQJ70W9Rwg,8002
|
90
97
|
notionary/blocks/table/table_markdown_node.py,sha256=9TJj0C380U-1iykAFouMGtlEM00Ig5-u9lmaWa-nPR8,1402
|
91
98
|
notionary/blocks/table/table_models.py,sha256=P0VUkX8FOE6aFWAyhOVVMVAYGtj_LO0sqSYtlbyCpQA,643
|
92
99
|
notionary/blocks/table_of_contents/__init__.py,sha256=m79PbE4vhG6UlJ8UFNQDU14_JUHxluLlPGWzgpcGkUo,598
|
93
|
-
notionary/blocks/table_of_contents/table_of_contents_element.py,sha256=
|
100
|
+
notionary/blocks/table_of_contents/table_of_contents_element.py,sha256=p4bYHB3jvkptdaB_fjKdqw_LTZmxckuXOKVUiikyc5I,2622
|
94
101
|
notionary/blocks/table_of_contents/table_of_contents_markdown_node.py,sha256=en8NdehkYl6mntphjnIwCZPGXnN2o2XTQm3Q5X-hZ_o,897
|
95
102
|
notionary/blocks/table_of_contents/table_of_contents_models.py,sha256=ECC5m-q-nDX34XWAqlt5sONxlbQSB0LhLJZpsjpV5xk,531
|
96
103
|
notionary/blocks/todo/__init__.py,sha256=HBjy9vRu1yEUk_P4-el1aZMw9SRwpJXGcFFtUEp4Xb8,383
|
97
|
-
notionary/blocks/todo/todo_element.py,sha256=
|
104
|
+
notionary/blocks/todo/todo_element.py,sha256=8rH84wHH1FEFnVd76AZrT-c-BpkwaN9hLQK7CWMCbBY,3092
|
98
105
|
notionary/blocks/todo/todo_markdown_node.py,sha256=MBRHtUQBNvJdX0plxY02r-XW7vkzBc_PFZxtW03UrHo,996
|
99
106
|
notionary/blocks/todo/todo_models.py,sha256=ADM2YEFPn6zXan5paS6-eYKqa9-HQ52FQjfUVInJoBI,530
|
100
107
|
notionary/blocks/toggle/__init__.py,sha256=kMNpgbKBFoFaOXcfYsNOzHEpBjTZBmYEzXapysbtjNs,415
|
101
|
-
notionary/blocks/toggle/toggle_element.py,sha256=
|
102
|
-
notionary/blocks/toggle/toggle_markdown_node.py,sha256=
|
108
|
+
notionary/blocks/toggle/toggle_element.py,sha256=O_gv3Xz0vxtJ3-1Hi07xBbrpgLDo9FKZ_OESOhbvpAQ,4618
|
109
|
+
notionary/blocks/toggle/toggle_markdown_node.py,sha256=EFGSFVsnl7bM6wm-geQ7tUplHyyZrCzZnwVzb-NbcO8,1270
|
103
110
|
notionary/blocks/toggle/toggle_models.py,sha256=Tkqmz7bzKX7v-T9xWZLy9Eiw_ksGg4UZaacE30uZmwI,521
|
104
111
|
notionary/blocks/toggleable_heading/__init__.py,sha256=hk43FCDhkSg_QbHEucXSBd96-Gj1tIMwiRxQY-vPREA,412
|
105
|
-
notionary/blocks/toggleable_heading/toggleable_heading_element.py,sha256=
|
112
|
+
notionary/blocks/toggleable_heading/toggleable_heading_element.py,sha256=y3tBDWmi3IeyhFyJEmsFndhlrQls5XhJVUGUVORnXUY,4428
|
106
113
|
notionary/blocks/toggleable_heading/toggleable_heading_markdown_node.py,sha256=kSo7rnYjX_9PT6kfmCbMCvndwNbtHNnLYdtznXhWXe4,1626
|
107
|
-
notionary/blocks/types.py,sha256=
|
114
|
+
notionary/blocks/types.py,sha256=qAmcxIGQcekrLsbNZVjOcI3HYmvHz5bzFFj8Asuh8JI,3567
|
108
115
|
notionary/blocks/video/__init__.py,sha256=z_lz1agYtSRv9A9bFRwPlpzmpfgf49w9uJMVkHTTsR0,376
|
109
|
-
notionary/blocks/video/video_element.py,sha256=
|
116
|
+
notionary/blocks/video/video_element.py,sha256=nDYcr1HwCZYVBSLPEo1qHuqU9AQ8yzS9OHQTIe3rVyA,4417
|
110
117
|
notionary/blocks/video/video_element_models.py,sha256=CYK2tq0qhrOxjO_ctOgRvEHM9hLjQCBXrP7wcTNlUPw,229
|
111
|
-
notionary/blocks/video/video_markdown_node.py,sha256=
|
118
|
+
notionary/blocks/video/video_markdown_node.py,sha256=u5OaoxLzg10PAdvo70OYgi1d-eFtTK_kUdYLAKQWdtM,1151
|
119
|
+
notionary/comments/__init__.py,sha256=G0OWsaN2VgbykvhLlNSweL_f0bl16j9NpidH2UNbFcQ,529
|
120
|
+
notionary/comments/client.py,sha256=c8mgHKVjMxC-ssuu4nv34S3788icCWSZQS-a1AZXM48,7309
|
121
|
+
notionary/comments/models.py,sha256=O2-yg-0Xrs8xrzLUa4793FlyNn3HbTRsv4dqaskI6ps,3409
|
112
122
|
notionary/database/__init__.py,sha256=4tdML0fBzkOCpiWT6q-L--5NELFLbTPD0IUA_E8yZno,155
|
113
|
-
notionary/database/client.py,sha256=
|
123
|
+
notionary/database/client.py,sha256=mN_8XHvIQkRxiWbgBfvncgw4IRiCFX3bVLMLBvtk1Ig,5398
|
114
124
|
notionary/database/database.py,sha256=sdo830KVInR4enaEaeMHaPadNfYnPLy5R3OW2f74w28,16558
|
115
125
|
notionary/database/database_filter_builder.py,sha256=YIkdghD5VbdwLJISMRiJ0WIJTm8jcDIL22yrvZau4sA,5950
|
116
126
|
notionary/database/database_provider.py,sha256=HB-hZ9pMjronLJS8w_b1GiQ-Ecz1uJbrWpnePL67BCA,8956
|
@@ -120,47 +130,56 @@ notionary/database/models.py,sha256=4LjnsltPLK4xddz_d_L7I-TnmixyCuqmKV5Mapa2i1I,
|
|
120
130
|
notionary/database/notion_database.py,sha256=DNsb_YuMg9Fix8OmKMBBN0FSlCGNWbDbG7GIsrSOgK0,16744
|
121
131
|
notionary/file_upload/__init__.py,sha256=7TNyiIgLMD_IGRXTwRiAmStokF3rLoG4zXPwNb9KQqk,168
|
122
132
|
notionary/file_upload/client.py,sha256=X3LInvHWuJgiL_phytLRzW6rrocXegm30TmTL0sCcfY,8531
|
123
|
-
notionary/file_upload/models.py,sha256=
|
133
|
+
notionary/file_upload/models.py,sha256=bbACznMXdg7WAlAZ6uJ6qVAj7r3GP9LlEv2T5hxcIrI,1621
|
124
134
|
notionary/file_upload/notion_file_upload.py,sha256=Ul3CMicJpUodUa3SU3ihrkWU_Wa5z36mKOqSVXNc_DM,13173
|
125
135
|
notionary/markdown/___init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
136
|
notionary/markdown/makdown_document_model.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
127
|
-
notionary/markdown/markdown_builder.py,sha256=
|
137
|
+
notionary/markdown/markdown_builder.py,sha256=q9J7FduIxrf8hSPu_5P4ZwYaGVZdvpe-qa0dyaRsBJ0,26379
|
128
138
|
notionary/markdown/markdown_document_model.py,sha256=i9zMINcTlTwlqpHV9zeQfMVlni2VAl6BMjAdKSdoUeg,6409
|
129
139
|
notionary/markdown/markdown_node.py,sha256=u8ApehnTCo1KnTFbtYzGuTAyUQrYPc3RSMJaUMyg0LI,717
|
130
140
|
notionary/models/notion_database_response.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
131
|
-
notionary/page/client.py,sha256=
|
132
|
-
notionary/page/markdown_whitespace_processor.py,sha256=azsYau4eDrFN9CY7kzlG-ketoVKSkqSTc1bFq_i7ggQ,2942
|
141
|
+
notionary/page/client.py,sha256=IOsjWOsmODxOq-7OF0y-gcuC2HUbMIT0SvJZHrH9weQ,4520
|
133
142
|
notionary/page/models.py,sha256=pD8FlK8KtnUrIITTd2jg_yJICakgPE4ysZiS9KiMpr0,7088
|
134
|
-
notionary/page/notion_page.py,sha256=
|
135
|
-
notionary/page/
|
136
|
-
notionary/page/page_content_writer.py,sha256=
|
143
|
+
notionary/page/notion_page.py,sha256=4X13kJWzJIoB7pFrfNbrIvLCQ2j4HKPOesblr6FM6d8,23903
|
144
|
+
notionary/page/page_content_deleting_service.py,sha256=ZxGUMmT7k85IPLALfZkIJ5oQA3tMHWVW4acjdp5cB0k,4540
|
145
|
+
notionary/page/page_content_writer.py,sha256=6WMDTbgjYRgJhmCrMnK4XokgVDhRWSRm55_1xceo0CA,6856
|
146
|
+
notionary/page/page_context.py,sha256=fIeCF9gjpiAtRK0GZ-3CUZ5Ina8xIVCvmOnt4MtS3ek,1938
|
137
147
|
notionary/page/property_formatter.py,sha256=_978ViH83gfcr-XtDscWTfyBI2srGW2hzC-gzgp5NR8,3788
|
138
|
-
notionary/page/reader/handler/__init__.py,sha256=
|
139
|
-
notionary/page/reader/handler/base_block_renderer.py,sha256=
|
148
|
+
notionary/page/reader/handler/__init__.py,sha256=ROMH1KvGGdQ0ANLhmIP_4LtMks9jsTTwnZKP8W0uwls,644
|
149
|
+
notionary/page/reader/handler/base_block_renderer.py,sha256=HZwv727bvu6suT1-uzK4y-4ci54VCdi0FF_yOJYBB1g,1513
|
140
150
|
notionary/page/reader/handler/block_processing_context.py,sha256=eSNpjQ3tpOc7sJgEm-2UAwd1UvCf-B4CtHJLS5B0lZA,1001
|
141
|
-
notionary/page/reader/handler/block_rendering_context.py,sha256=
|
151
|
+
notionary/page/reader/handler/block_rendering_context.py,sha256=o3ASovI71jtffDeKVtx7hZqg7P6-qXvkWBft7ZqOa_s,1583
|
142
152
|
notionary/page/reader/handler/column_list_renderer.py,sha256=rYh4lOmr74j-KE8VqddVbqVyXcZ4ZRg2ig_XNJAKmX8,2011
|
143
153
|
notionary/page/reader/handler/column_renderer.py,sha256=XahgbvWCNqpdKpf0fs9E2yU9_sq7F4_ByUXE8Pi_Q_4,2312
|
144
|
-
notionary/page/reader/handler/
|
145
|
-
notionary/page/reader/handler/line_renderer.py,sha256=
|
154
|
+
notionary/page/reader/handler/equation_renderer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
155
|
+
notionary/page/reader/handler/line_renderer.py,sha256=TvgLZo1URsRQ4UEcaQtbAU4tGIuAX4uh3Kmemp9aRrA,2905
|
156
|
+
notionary/page/reader/handler/numbered_list_renderer.py,sha256=tFDfMYxFme1PuNBNi2kbIb13MGNLP5n2-NpLoEklR1E,3480
|
146
157
|
notionary/page/reader/handler/toggle_renderer.py,sha256=D-kDJc1JbqM9BSGdgJxBsu1Fb8gpKU9ziNFqkS4_Tu8,2593
|
147
158
|
notionary/page/reader/handler/toggleable_heading_renderer.py,sha256=vw336TY9K0v-JFu_x5xHlovCKylSITtMh2RM0YDt4lk,3374
|
148
|
-
notionary/page/reader/page_content_retriever.py,sha256=
|
159
|
+
notionary/page/reader/page_content_retriever.py,sha256=ruzRISReupp5TbVwmVjURBk8wE35YYatNpDFpSpnEEQ,2854
|
149
160
|
notionary/page/search_filter_builder.py,sha256=m8NbFUoxxCEBpcWZIxClyix8NNzeohsOw7D-Fddi-qA,4599
|
150
161
|
notionary/page/utils.py,sha256=2nfBrWeczBdPH13R3q8dKP4OY4MwEdfKbcs2UJ9kg1o,2041
|
151
|
-
notionary/page/writer/handler/__init__.py,sha256=
|
152
|
-
notionary/page/writer/handler/code_handler.py,sha256=
|
153
|
-
notionary/page/writer/handler/column_handler.py,sha256=
|
154
|
-
notionary/page/writer/handler/column_list_handler.py,sha256=
|
155
|
-
notionary/page/writer/handler/
|
162
|
+
notionary/page/writer/handler/__init__.py,sha256=8rAzBvmeaPYoYIB5Fd3XHCKFMmbSdlDZ-C8xN-Qxx0s,794
|
163
|
+
notionary/page/writer/handler/code_handler.py,sha256=Xn5SitI2fnJkS38_RGtMEY0EOqwy8m-wnqaNetRx7hY,2671
|
164
|
+
notionary/page/writer/handler/column_handler.py,sha256=JIwvWMPiNsMKAG6UEMpkiglD0kKsXQFu1dP1V6L5Keg,5415
|
165
|
+
notionary/page/writer/handler/column_list_handler.py,sha256=k_exJ87d8i9MGV_uKxAB_mdpmcf5nfOZQ1bqHUoJHiA,5309
|
166
|
+
notionary/page/writer/handler/equation_handler.py,sha256=vflcoaSNNnLxbI_8oE_o33etmF3CxvWYnVQCJ7gbbd8,2844
|
167
|
+
notionary/page/writer/handler/line_handler.py,sha256=miuU7MXJj1Ae_B_r4a84s9tJaJ8xWNo-LAeD6RqJ-aM,1163
|
156
168
|
notionary/page/writer/handler/line_processing_context.py,sha256=F2GxDXIOgvZHxiDP-VDe8JUHGcsszMexPG0W9E9y39E,1739
|
157
|
-
notionary/page/writer/handler/regular_line_handler.py,sha256=
|
158
|
-
notionary/page/writer/handler/table_handler.py,sha256=
|
159
|
-
notionary/page/writer/handler/toggle_handler.py,sha256=
|
160
|
-
notionary/page/writer/handler/toggleable_heading_handler.py,sha256=
|
161
|
-
notionary/page/writer/markdown_to_notion_converter.py,sha256=
|
169
|
+
notionary/page/writer/handler/regular_line_handler.py,sha256=2T8xOi4ybcugMJL-sPyVvU0KRVQzFSPpvLibrixIJLA,3223
|
170
|
+
notionary/page/writer/handler/table_handler.py,sha256=5r-Uh5Unc0iTbl3PXEDvE6qVCrp6YSprpOP9FRnaLY8,2581
|
171
|
+
notionary/page/writer/handler/toggle_handler.py,sha256=3ZmaAxGh4PDqk9U0Gq4FhSWdmdU4-qgQRNvv_8vQf_Q,5823
|
172
|
+
notionary/page/writer/handler/toggleable_heading_handler.py,sha256=ae0Cuzzdd5c-xKBFMYjzqRkj47wErgyFoBOZ9ytd0b4,6858
|
173
|
+
notionary/page/writer/markdown_to_notion_converter.py,sha256=ENeP7I2ui532rx9hOULrJC6DHwcYELSkItY5epzBWi4,3272
|
174
|
+
notionary/page/writer/markdown_to_notion_converter_context.py,sha256=Tys52QEGOzE_zDICI8W6pawCKSFGAjEqOyWTscUUysU,1033
|
175
|
+
notionary/page/writer/markdown_to_notion_formatting_post_processor.py,sha256=E41t_TQYLbFTmOzREDrGOUy4gGiSu9pAP8No5Qpsi28,2368
|
176
|
+
notionary/page/writer/markdown_to_notion_post_processor.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
177
|
+
notionary/page/writer/markdown_to_notion_text_length_post_processor.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
178
|
+
notionary/page/writer/notion_text_length_processor.py,sha256=WfXGouHs2KUFH1ASqloRkV6y7q2jS4vqbiEEMrmd7Qw,5744
|
179
|
+
notionary/shared/__init__.py,sha256=7dKlDC1BpKy7LxceHTKVamLc9X0mc6stO5MOxBxidWY,87
|
180
|
+
notionary/shared/name_to_id_resolver.py,sha256=SlxB2vmq1cMIZnL0o3U27wjYQSXeQkKURmKFy-BAqk4,6318
|
162
181
|
notionary/telemetry/__init__.py,sha256=uzPrvkPIpbzPSHCu-tObCTmZA18l3VWqk42L8WLT-XM,511
|
163
|
-
notionary/telemetry/service.py,sha256=
|
182
|
+
notionary/telemetry/service.py,sha256=FujT1ZuSHzTO0Rxa6oKlycE_Y-Qpe5lc59EGzzDf-jc,4725
|
164
183
|
notionary/telemetry/views.py,sha256=FgFZGYaxP7pRYx-9wg18skMh_MJAwf4W3rCfe9JOZe4,1796
|
165
184
|
notionary/user/__init__.py,sha256=qcAWjWQVn_3WxAJZpToTj2WuCHhKLdtv3bblmx7SG2U,281
|
166
185
|
notionary/user/base_notion_user.py,sha256=qeCUmVvi62HZDQMLaT4bEuu6Dkeit8L0hBMtJaNndJI,1502
|
@@ -168,9 +187,9 @@ notionary/user/client.py,sha256=8gHEjiE6aNrKGlo3PMoLhIeO8R5gBgF6W7TDOsM1A4E,4515
|
|
168
187
|
notionary/user/models.py,sha256=G6Emj8TqAFTGCmyfKk8hq0bZC_tL7uNdI6USNWTVfP4,2065
|
169
188
|
notionary/user/notion_bot_user.py,sha256=AbkyBXM2__yNfGd8czxVqDEKvtFuzgQguyL5da5lvcs,7772
|
170
189
|
notionary/user/notion_user.py,sha256=GyWAGYS3OjMz6jYwETqOSmAS3qsGkwhTR9SDw-qvqTg,8503
|
171
|
-
notionary/user/notion_user_manager.py,sha256=
|
172
|
-
notionary/user/notion_user_provider.py,sha256=zAU4m1ZdsrLv3DRHtoiTVgtQaDvz0t28LwvxMMMSJm4,20
|
190
|
+
notionary/user/notion_user_manager.py,sha256=WVgKRgodwOZU30f6NrPTyOjKwoqUjgj4_sySG_l0AoY,3897
|
173
191
|
notionary/util/__init__.py,sha256=umFas1H4zUoxibNn-Ff6dTCWt3mkhmAG4Lu2viZ-XAU,386
|
192
|
+
notionary/util/concurrency_limiter.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
174
193
|
notionary/util/factory_decorator.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
175
194
|
notionary/util/factory_only.py,sha256=q-ZXUEvQ8lsuD1JQwx-ai6e9Lhie65waRE1BcRhCR_4,1235
|
176
195
|
notionary/util/fuzzy.py,sha256=y7EroToodFSIQLD0FAfFrPEDXOUlZaDGN9ko3XjfHMw,2063
|
@@ -178,8 +197,8 @@ notionary/util/logging_mixin.py,sha256=WLziC-IVovKIe3n3R-ns3YYE2aP5bZVu0r_y5joxh
|
|
178
197
|
notionary/util/page_id_utils.py,sha256=AA00kRO-g3Cc50tf_XW_tb5RBuPKLuBxRa0D8LYhLXg,736
|
179
198
|
notionary/util/singleton.py,sha256=CKAvykndwPRZsA3n3MAY_XdCR59MBjjKP0vtm2BcvF0,428
|
180
199
|
notionary/util/singleton_metaclass.py,sha256=DMvrh0IbAV8nIG1oX-2Yz57Uk1YHB647DNxoI3pAT3s,809
|
181
|
-
notionary/workspace.py,sha256=
|
182
|
-
notionary-0.2.
|
183
|
-
notionary-0.2.
|
184
|
-
notionary-0.2.
|
185
|
-
notionary-0.2.
|
200
|
+
notionary/workspace.py,sha256=QP4WcOIdQnlVr4M7hpGaFT-Fori_QRhsV-SBC2lnwTU,3809
|
201
|
+
notionary-0.2.23.dist-info/LICENSE,sha256=zOm3cRT1qD49eg7vgw95MI79rpUAZa1kRBFwL2FkAr8,1120
|
202
|
+
notionary-0.2.23.dist-info/METADATA,sha256=asanJv6EUiN6zgUVVplKEM7MUrafPfkGdxV4EQNGQ-Y,9035
|
203
|
+
notionary-0.2.23.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
204
|
+
notionary-0.2.23.dist-info/RECORD,,
|
@@ -1,80 +0,0 @@
|
|
1
|
-
class MarkdownWhitespaceProcessor:
|
2
|
-
"""Helper class for processing markdown whitespace."""
|
3
|
-
|
4
|
-
def __init__(self):
|
5
|
-
self.processed_lines = []
|
6
|
-
self.in_code_block = False
|
7
|
-
self.current_code_block = []
|
8
|
-
|
9
|
-
def process_lines(self, lines: list[str]) -> str:
|
10
|
-
"""Process all lines and return the processed markdown."""
|
11
|
-
self.processed_lines = []
|
12
|
-
self.in_code_block = False
|
13
|
-
self.current_code_block = []
|
14
|
-
|
15
|
-
for line in lines:
|
16
|
-
self._process_single_line(line)
|
17
|
-
|
18
|
-
# Handle unclosed code block
|
19
|
-
if self.in_code_block and self.current_code_block:
|
20
|
-
self._finish_code_block()
|
21
|
-
|
22
|
-
return "\n".join(self.processed_lines)
|
23
|
-
|
24
|
-
def _process_single_line(self, line: str) -> None:
|
25
|
-
"""Process a single line of markdown."""
|
26
|
-
if self._is_code_block_marker(line):
|
27
|
-
self._handle_code_block_marker(line)
|
28
|
-
return
|
29
|
-
|
30
|
-
if self.in_code_block:
|
31
|
-
self.current_code_block.append(line)
|
32
|
-
return
|
33
|
-
|
34
|
-
# Regular text - remove leading whitespace
|
35
|
-
self.processed_lines.append(line.lstrip())
|
36
|
-
|
37
|
-
def _handle_code_block_marker(self, line: str) -> None:
|
38
|
-
"""Handle code block start/end markers."""
|
39
|
-
if not self.in_code_block:
|
40
|
-
# Starting new code block
|
41
|
-
self.in_code_block = True
|
42
|
-
self.processed_lines.append(self._normalize_code_block_start(line))
|
43
|
-
self.current_code_block = []
|
44
|
-
else:
|
45
|
-
# Ending code block
|
46
|
-
self._finish_code_block()
|
47
|
-
|
48
|
-
def _finish_code_block(self) -> None:
|
49
|
-
"""Finish processing current code block."""
|
50
|
-
self.processed_lines.extend(
|
51
|
-
self._normalize_code_block_content(self.current_code_block)
|
52
|
-
)
|
53
|
-
self.processed_lines.append("```")
|
54
|
-
self.in_code_block = False
|
55
|
-
|
56
|
-
def _is_code_block_marker(self, line: str) -> bool:
|
57
|
-
"""Check if line is a code block marker."""
|
58
|
-
return line.lstrip().startswith("```")
|
59
|
-
|
60
|
-
def _normalize_code_block_start(self, line: str) -> str:
|
61
|
-
"""Normalize code block opening marker."""
|
62
|
-
language = line.lstrip().replace("```", "", 1).strip()
|
63
|
-
return "```" + language
|
64
|
-
|
65
|
-
def _normalize_code_block_content(self, code_lines: list[str]) -> list[str]:
|
66
|
-
"""Normalize code block indentation."""
|
67
|
-
if not code_lines:
|
68
|
-
return []
|
69
|
-
|
70
|
-
# Find minimum indentation from non-empty lines
|
71
|
-
non_empty_lines = [line for line in code_lines if line.strip()]
|
72
|
-
if not non_empty_lines:
|
73
|
-
return [""] * len(code_lines)
|
74
|
-
|
75
|
-
min_indent = min(len(line) - len(line.lstrip()) for line in non_empty_lines)
|
76
|
-
if min_indent == 0:
|
77
|
-
return code_lines
|
78
|
-
|
79
|
-
# Remove common indentation
|
80
|
-
return ["" if not line.strip() else line[min_indent:] for line in code_lines]
|
@@ -1,119 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Utility functions for handling Notion API text length limitations.
|
3
|
-
|
4
|
-
This module provides functions to fix text content that exceeds Notion's
|
5
|
-
rich_text character limit of 2000 characters per element.
|
6
|
-
|
7
|
-
Resolves API errors like:
|
8
|
-
"validation_error - body.children[79].toggle.children[2].paragraph.rich_text[0].text.content.length
|
9
|
-
should be ≤ 2000, instead was 2162."
|
10
|
-
"""
|
11
|
-
|
12
|
-
import logging
|
13
|
-
import re
|
14
|
-
|
15
|
-
from notionary.blocks.models import BlockCreateRequest
|
16
|
-
|
17
|
-
logger = logging.getLogger(__name__)
|
18
|
-
|
19
|
-
|
20
|
-
def fix_blocks_content_length(
|
21
|
-
blocks: list[BlockCreateRequest], max_text_length: int = 1900
|
22
|
-
) -> list[BlockCreateRequest]:
|
23
|
-
"""Check each block and ensure text content doesn't exceed Notion's limit."""
|
24
|
-
fixed_blocks: list[BlockCreateRequest] = []
|
25
|
-
|
26
|
-
flattened_blocks = _flatten_blocks(blocks)
|
27
|
-
|
28
|
-
for block in flattened_blocks:
|
29
|
-
fixed_block = _fix_single_block_content(block, max_text_length)
|
30
|
-
fixed_blocks.append(fixed_block)
|
31
|
-
return fixed_blocks
|
32
|
-
|
33
|
-
|
34
|
-
def _fix_single_block_content(
|
35
|
-
block: BlockCreateRequest, max_text_length: int
|
36
|
-
) -> BlockCreateRequest:
|
37
|
-
"""Fix content length in a single block and its children recursively."""
|
38
|
-
block_copy = block.model_copy(deep=True)
|
39
|
-
_fix_block_rich_text_direct(block_copy, max_text_length)
|
40
|
-
|
41
|
-
return block_copy
|
42
|
-
|
43
|
-
|
44
|
-
def _fix_block_rich_text_direct(
|
45
|
-
block: BlockCreateRequest, max_text_length: int
|
46
|
-
) -> None:
|
47
|
-
"""Fix rich text content directly on the Pydantic object."""
|
48
|
-
block_content = _get_block_content(block)
|
49
|
-
if not block_content:
|
50
|
-
return
|
51
|
-
if hasattr(block_content, "rich_text") and block_content.rich_text:
|
52
|
-
_fix_rich_text_objects_direct(block_content.rich_text, max_text_length)
|
53
|
-
if hasattr(block_content, "children") and block_content.children:
|
54
|
-
for child in block_content.children:
|
55
|
-
_fix_block_rich_text_direct(child, max_text_length)
|
56
|
-
|
57
|
-
|
58
|
-
def _get_block_content(block: BlockCreateRequest):
|
59
|
-
"""Get the actual content object from a create block dynamically."""
|
60
|
-
# Get all attributes that don't start with underscore and aren't methods
|
61
|
-
for attr_name in dir(block):
|
62
|
-
if attr_name.startswith("_") or attr_name in [
|
63
|
-
"model_copy",
|
64
|
-
"model_dump",
|
65
|
-
"model_validate",
|
66
|
-
]:
|
67
|
-
continue
|
68
|
-
|
69
|
-
attr_value = getattr(block, attr_name, None)
|
70
|
-
|
71
|
-
# Skip None values, strings (like 'type'), and callable methods
|
72
|
-
if attr_value is None or isinstance(attr_value, str) or callable(attr_value):
|
73
|
-
continue
|
74
|
-
|
75
|
-
# If it's an object with rich_text or children, it's likely our content
|
76
|
-
if hasattr(attr_value, "rich_text") or hasattr(attr_value, "children"):
|
77
|
-
return attr_value
|
78
|
-
|
79
|
-
return None
|
80
|
-
|
81
|
-
|
82
|
-
def _fix_rich_text_objects_direct(rich_text_list: list, max_text_length: int) -> None:
|
83
|
-
"""Fix rich text objects directly without dict conversion."""
|
84
|
-
if not rich_text_list:
|
85
|
-
return
|
86
|
-
|
87
|
-
for rich_text_item in rich_text_list:
|
88
|
-
if not rich_text_item:
|
89
|
-
continue
|
90
|
-
|
91
|
-
# Check if this is a text type rich text object
|
92
|
-
if (
|
93
|
-
hasattr(rich_text_item, "text")
|
94
|
-
and rich_text_item.text
|
95
|
-
and hasattr(rich_text_item.text, "content")
|
96
|
-
):
|
97
|
-
|
98
|
-
content = rich_text_item.text.content
|
99
|
-
if content and len(content) > max_text_length:
|
100
|
-
logger.warning(
|
101
|
-
"Truncating text content from %d to %d chars",
|
102
|
-
len(content),
|
103
|
-
max_text_length,
|
104
|
-
)
|
105
|
-
# Direct assignment - no parsing needed!
|
106
|
-
rich_text_item.text.content = content[:max_text_length]
|
107
|
-
|
108
|
-
|
109
|
-
def _flatten_blocks(blocks: list) -> list[BlockCreateRequest]:
|
110
|
-
"""Flatten nested block lists."""
|
111
|
-
flattened = []
|
112
|
-
for item in blocks:
|
113
|
-
if isinstance(item, list):
|
114
|
-
# Rekursiv flatten für nested lists
|
115
|
-
flattened.extend(_flatten_blocks(item))
|
116
|
-
else:
|
117
|
-
# Normal block
|
118
|
-
flattened.append(item)
|
119
|
-
return flattened
|
@@ -1 +0,0 @@
|
|
1
|
-
# for caching shit
|