notionary 0.2.28__py3-none-any.whl → 0.3.1__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/__init__.py +9 -2
- notionary/blocks/__init__.py +5 -0
- notionary/blocks/client.py +6 -4
- notionary/blocks/enums.py +28 -1
- notionary/blocks/rich_text/markdown_rich_text_converter.py +14 -0
- notionary/blocks/rich_text/models.py +14 -0
- notionary/blocks/rich_text/name_id_resolver/__init__.py +2 -0
- notionary/blocks/rich_text/name_id_resolver/data_source.py +32 -0
- notionary/blocks/rich_text/rich_text_markdown_converter.py +12 -0
- notionary/blocks/rich_text/rich_text_patterns.py +3 -0
- notionary/blocks/schemas.py +42 -10
- notionary/comments/__init__.py +5 -0
- notionary/comments/client.py +7 -10
- notionary/comments/factory.py +4 -6
- notionary/data_source/http/data_source_instance_client.py +14 -4
- notionary/data_source/properties/{models.py → schemas.py} +4 -8
- notionary/data_source/query/__init__.py +9 -0
- notionary/data_source/query/builder.py +38 -10
- notionary/data_source/query/schema.py +13 -10
- notionary/data_source/query/validator.py +11 -11
- notionary/data_source/schema/registry.py +104 -0
- notionary/data_source/schema/service.py +136 -0
- notionary/data_source/schemas.py +1 -1
- notionary/data_source/service.py +29 -103
- notionary/database/service.py +17 -60
- notionary/exceptions/__init__.py +5 -1
- notionary/exceptions/block_parsing.py +21 -0
- notionary/exceptions/search.py +24 -0
- notionary/http/client.py +9 -10
- notionary/http/models.py +5 -4
- notionary/page/content/factory.py +10 -3
- notionary/page/content/markdown/builder.py +76 -154
- notionary/page/content/markdown/nodes/__init__.py +0 -2
- notionary/page/content/markdown/nodes/audio.py +1 -1
- notionary/page/content/markdown/nodes/base.py +1 -1
- notionary/page/content/markdown/nodes/bookmark.py +1 -1
- notionary/page/content/markdown/nodes/breadcrumb.py +1 -1
- notionary/page/content/markdown/nodes/bulleted_list.py +31 -8
- notionary/page/content/markdown/nodes/callout.py +12 -10
- notionary/page/content/markdown/nodes/code.py +3 -5
- notionary/page/content/markdown/nodes/columns.py +39 -21
- notionary/page/content/markdown/nodes/container.py +64 -0
- notionary/page/content/markdown/nodes/divider.py +1 -1
- notionary/page/content/markdown/nodes/embed.py +1 -1
- notionary/page/content/markdown/nodes/equation.py +1 -1
- notionary/page/content/markdown/nodes/file.py +1 -1
- notionary/page/content/markdown/nodes/heading.py +26 -6
- notionary/page/content/markdown/nodes/image.py +1 -1
- notionary/page/content/markdown/nodes/mixins/__init__.py +5 -0
- notionary/page/content/markdown/nodes/mixins/caption.py +1 -1
- notionary/page/content/markdown/nodes/numbered_list.py +28 -5
- notionary/page/content/markdown/nodes/paragraph.py +1 -1
- notionary/page/content/markdown/nodes/pdf.py +1 -1
- notionary/page/content/markdown/nodes/quote.py +17 -5
- notionary/page/content/markdown/nodes/space.py +1 -1
- notionary/page/content/markdown/nodes/table.py +1 -1
- notionary/page/content/markdown/nodes/table_of_contents.py +1 -1
- notionary/page/content/markdown/nodes/todo.py +23 -7
- notionary/page/content/markdown/nodes/toggle.py +13 -14
- notionary/page/content/markdown/nodes/video.py +1 -1
- notionary/page/content/parser/context.py +98 -21
- notionary/page/content/parser/factory.py +1 -10
- notionary/page/content/parser/parsers/__init__.py +0 -2
- notionary/page/content/parser/parsers/audio.py +1 -1
- notionary/page/content/parser/parsers/base.py +1 -1
- notionary/page/content/parser/parsers/bookmark.py +1 -1
- notionary/page/content/parser/parsers/breadcrumb.py +1 -1
- notionary/page/content/parser/parsers/bulleted_list.py +52 -8
- notionary/page/content/parser/parsers/callout.py +55 -84
- notionary/page/content/parser/parsers/caption.py +1 -1
- notionary/page/content/parser/parsers/code.py +5 -5
- notionary/page/content/parser/parsers/column.py +23 -64
- notionary/page/content/parser/parsers/column_list.py +45 -45
- notionary/page/content/parser/parsers/divider.py +1 -1
- notionary/page/content/parser/parsers/embed.py +1 -1
- notionary/page/content/parser/parsers/equation.py +1 -1
- notionary/page/content/parser/parsers/file.py +1 -1
- notionary/page/content/parser/parsers/heading.py +65 -8
- notionary/page/content/parser/parsers/image.py +1 -1
- notionary/page/content/parser/parsers/numbered_list.py +52 -8
- notionary/page/content/parser/parsers/paragraph.py +3 -2
- notionary/page/content/parser/parsers/pdf.py +1 -1
- notionary/page/content/parser/parsers/quote.py +75 -15
- notionary/page/content/parser/parsers/space.py +14 -8
- notionary/page/content/parser/parsers/table.py +1 -1
- notionary/page/content/parser/parsers/table_of_contents.py +1 -1
- notionary/page/content/parser/parsers/todo.py +57 -19
- notionary/page/content/parser/parsers/toggle.py +17 -74
- notionary/page/content/parser/parsers/video.py +1 -1
- notionary/page/content/parser/post_processing/handlers/rich_text_length.py +6 -4
- notionary/page/content/parser/post_processing/handlers/rich_text_length_truncation.py +43 -22
- notionary/page/content/parser/pre_processsing/handlers/__init__.py +4 -0
- notionary/page/content/parser/pre_processsing/handlers/column_syntax.py +108 -54
- notionary/page/content/parser/pre_processsing/handlers/indentation.py +86 -0
- notionary/page/content/parser/pre_processsing/handlers/video_syntax.py +66 -0
- notionary/page/content/parser/pre_processsing/handlers/whitespace.py +14 -7
- notionary/page/content/parser/service.py +9 -0
- notionary/page/content/renderer/context.py +5 -2
- notionary/page/content/renderer/factory.py +2 -11
- notionary/page/content/renderer/post_processing/handlers/__init__.py +2 -2
- notionary/page/content/renderer/post_processing/handlers/numbered_list.py +156 -0
- notionary/page/content/renderer/renderers/__init__.py +0 -2
- notionary/page/content/renderer/renderers/base.py +1 -1
- notionary/page/content/renderer/renderers/bulleted_list.py +1 -1
- notionary/page/content/renderer/renderers/callout.py +6 -21
- notionary/page/content/renderer/renderers/captioned_block.py +1 -1
- notionary/page/content/renderer/renderers/column.py +28 -19
- notionary/page/content/renderer/renderers/column_list.py +24 -11
- notionary/page/content/renderer/renderers/heading.py +53 -27
- notionary/page/content/renderer/renderers/numbered_list.py +6 -5
- notionary/page/content/renderer/renderers/quote.py +1 -1
- notionary/page/content/renderer/renderers/todo.py +1 -1
- notionary/page/content/renderer/renderers/toggle.py +6 -7
- notionary/page/content/service.py +4 -1
- notionary/page/content/syntax/__init__.py +4 -0
- notionary/page/content/syntax/grammar.py +10 -0
- notionary/page/content/syntax/models.py +0 -2
- notionary/page/content/syntax/{service.py → registry.py} +31 -91
- notionary/page/properties/client.py +3 -3
- notionary/page/properties/models.py +3 -2
- notionary/page/properties/service.py +18 -3
- notionary/page/service.py +22 -80
- notionary/shared/entity/service.py +94 -36
- notionary/shared/models/cover.py +1 -1
- notionary/shared/typings.py +3 -0
- notionary/user/base.py +60 -11
- notionary/user/factory.py +0 -0
- notionary/utils/decorators.py +122 -0
- notionary/utils/fuzzy.py +18 -6
- notionary/utils/mixins/logging.py +38 -27
- notionary/utils/pagination.py +70 -16
- notionary/workspace/__init__.py +2 -1
- notionary/workspace/client.py +4 -2
- notionary/workspace/query/__init__.py +3 -0
- notionary/workspace/query/builder.py +25 -1
- notionary/workspace/query/models.py +12 -3
- notionary/workspace/query/service.py +57 -32
- notionary/workspace/service.py +31 -21
- {notionary-0.2.28.dist-info → notionary-0.3.1.dist-info}/METADATA +35 -105
- notionary-0.3.1.dist-info/RECORD +211 -0
- notionary/page/content/markdown/nodes/toggleable_heading.py +0 -35
- notionary/page/content/parser/parsers/toggleable_heading.py +0 -150
- notionary/page/content/renderer/post_processing/handlers/numbered_list_placeholdere.py +0 -62
- notionary/page/content/renderer/renderers/toggleable_heading.py +0 -78
- notionary/utils/async_retry.py +0 -39
- notionary/utils/singleton.py +0 -13
- notionary-0.2.28.dist-info/RECORD +0 -200
- {notionary-0.2.28.dist-info → notionary-0.3.1.dist-info}/WHEEL +0 -0
- {notionary-0.2.28.dist-info → notionary-0.3.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
notionary/__init__.py,sha256=_nL90pjfhRkdxatfVRy_l1Ld86MloAmgqlWPKlYtAMc,445
|
|
2
|
+
notionary/blocks/__init__.py,sha256=LsVUgSsDYlLy-bwLqnukcr4uB8ZcCLMz3fGd4HsNXDY,99
|
|
3
|
+
notionary/blocks/client.py,sha256=zYy_eFz6NKFGqsESDddiUUZZfV6ybWWyzseThZEdIvI,5551
|
|
4
|
+
notionary/blocks/enums.py,sha256=xr1h-8kZCRRERaAsC4p8wTV7nkX7ili5D-_jNQ61Wk4,4772
|
|
5
|
+
notionary/blocks/schemas.py,sha256=7ZB4jbNzoKraa8O6yLLXeQXGskisUAzbOm1qHUYosNo,21413
|
|
6
|
+
notionary/blocks/rich_text/markdown_rich_text_converter.py,sha256=kZyCwKgv4BMTswmIPTyDVrLs4OQ9JQn9O-Qb0rxea1k,11642
|
|
7
|
+
notionary/blocks/rich_text/models.py,sha256=0aNsB_gpFiqBXAATL4yVMyOy4-zbN0WKB3rEaFQeTKs,4863
|
|
8
|
+
notionary/blocks/rich_text/rich_text_markdown_converter.py,sha256=oKqh8vK5JTehiYC-y0m4bfRSkt5bq1gTpWZib7NIvoo,5512
|
|
9
|
+
notionary/blocks/rich_text/rich_text_patterns.py,sha256=nC2WosgLh_RhaEckVkSi-xUNJl14bKO2u2ImuOcufso,1703
|
|
10
|
+
notionary/blocks/rich_text/name_id_resolver/__init__.py,sha256=1WZprWsEpL-gWnZrSn7-DqhHUz0r_8OiOcyHi1P4i1g,372
|
|
11
|
+
notionary/blocks/rich_text/name_id_resolver/data_source.py,sha256=IQo-njsuyUENm05ccroU_EbmqExn8Kc3TQ2SsiLkop8,1269
|
|
12
|
+
notionary/blocks/rich_text/name_id_resolver/database.py,sha256=xrCnBUYfZJfDw9bSwUroWbqzK4N1P8eduBfKVug_KXg,1073
|
|
13
|
+
notionary/blocks/rich_text/name_id_resolver/page.py,sha256=DfjXyBLdkYl5UfoU2UGSllsRUM5XFp30H_OJwJdKdrI,1137
|
|
14
|
+
notionary/blocks/rich_text/name_id_resolver/person.py,sha256=lhDBhJXL0VRoOu8eJc-uOcqXB78os8V6VePagBboKs8,1301
|
|
15
|
+
notionary/blocks/rich_text/name_id_resolver/port.py,sha256=VtTavK6rHL-_qTIjFMsO25cgh_oUHNS-qEM_mONOaS0,259
|
|
16
|
+
notionary/comments/__init__.py,sha256=1LfujehhvWqJmNKft6QvcbwhLlJOGq7cH1uTb4IUR2w,63
|
|
17
|
+
notionary/comments/client.py,sha256=43raXEooa_kA-iYlUSEFqtQuA9gJ1kHPLsbC0K0H_bE,2593
|
|
18
|
+
notionary/comments/factory.py,sha256=OmE1CBY5elpbvuSj64EmBfSlmED9VAYIQ65J5jKM15s,1511
|
|
19
|
+
notionary/comments/models.py,sha256=g-WTDSel8nhyRa60rN0U5FuccU0KVnsnJBi6Uqz7NVw,107
|
|
20
|
+
notionary/comments/schemas.py,sha256=AWDMeZbtOiaXfb45cxP5UhXOMxAqPYGetXzRWaJOdfQ,6003
|
|
21
|
+
notionary/comments/service.py,sha256=qRCwTTzjdSD2vgqCJCBPbSO3gyajyUD3JWV3qgiMFe0,1652
|
|
22
|
+
notionary/data_source/schemas.py,sha256=I1b1HEbOj_uWebgZFjZBLTe82DShxM8Tes4_imyfogU,849
|
|
23
|
+
notionary/data_source/service.py,sha256=YFEd6q9ibkE92L8Erq-mpobQ20btzhzlGzJQVknNb28,10842
|
|
24
|
+
notionary/data_source/http/client.py,sha256=wvaBOIT5OtGdE0QjbcDUsuDnZ0TZ-CyIifBHp6OYTqE,445
|
|
25
|
+
notionary/data_source/http/data_source_instance_client.py,sha256=S2cDnUw3ISn7cM7vhdX6PGpAarneZri5NRlILlcBV_s,5006
|
|
26
|
+
notionary/data_source/properties/schemas.py,sha256=EWUtLplGdjbb688EU5EXWqMU2PSPf2GzGglLwS5wAgg,12067
|
|
27
|
+
notionary/data_source/query/__init__.py,sha256=Q3uQf6r0xHYV_i5kn-Gdwf68QKJMnV_7vS_gO4I3kG8,226
|
|
28
|
+
notionary/data_source/query/builder.py,sha256=6oyTtcbs7TiJtitzXDiIk_tCaA3G6uvf_KXIQEJByGU,18740
|
|
29
|
+
notionary/data_source/query/resolver.py,sha256=zkV-ra2vvKdXAIcDO7zEzjvd_79YKLz6umczK6U8fpo,4370
|
|
30
|
+
notionary/data_source/query/schema.py,sha256=PdoboG_b8MDhRw5gfWAnVJpdUJc9b-jcWQs-EUGG8vk,9573
|
|
31
|
+
notionary/data_source/query/validator.py,sha256=wO0oT2i8d-Vl6ul_4ilXFyOxnOvM64HXdCRJPyu-xdE,3309
|
|
32
|
+
notionary/data_source/schema/registry.py,sha256=ageQvLYOnU1g65JcZ9cmQWfj0Sv7petNWUBl5eH-eFo,5185
|
|
33
|
+
notionary/data_source/schema/service.py,sha256=AFkHsOnTOSpf36pr2XHgw16Kna5hzw0GduAdLAh7bMQ,5977
|
|
34
|
+
notionary/database/client.py,sha256=oLl8iRPkNC7Fuu9tAhXg3iX5n6z_35Nvl-JN8i0aSd4,2213
|
|
35
|
+
notionary/database/database_metadata_update_client.py,sha256=LryhjGxDgLbRvuOUVvViZCogI0-Op4QkOlQUW4z8Tmg,905
|
|
36
|
+
notionary/database/schemas.py,sha256=RwhxDRa7v8IAtkXdJLu-gHclliClWmcIfa6xKYCUkZA,853
|
|
37
|
+
notionary/database/service.py,sha256=yb3bo53wTg5UE2SzaDhqNzxbOnWo38apyiyF4uGZZNo,4449
|
|
38
|
+
notionary/exceptions/__init__.py,sha256=thgYj5f-RacLLaodqUVVi5jsQflMU9FgKjsnB8Q3AAE,1280
|
|
39
|
+
notionary/exceptions/api.py,sha256=5xCX5Xyaa8CMG2f4_fgkZQezPsSjqDrV27ByOY05meg,790
|
|
40
|
+
notionary/exceptions/base.py,sha256=vzMtgFalmpXVEOZDkyF0HqW--WBpq2rVJm-IG1f5vlY,44
|
|
41
|
+
notionary/exceptions/block_parsing.py,sha256=6Dd_pg6SEIjy9nNfbnmaLLsOPwra76bXbuFRkJ4Z8qg,1475
|
|
42
|
+
notionary/exceptions/properties.py,sha256=xHAU83C-8fxC1ColcIkA7wyhbAalfdz6Y3JSlFJuhy0,2199
|
|
43
|
+
notionary/exceptions/search.py,sha256=V3l-v5YcR5-zMcLw-A5rvCFMc0xhlWY6nVEVC8HMsDk,2160
|
|
44
|
+
notionary/exceptions/data_source/__init__.py,sha256=Xs4I-zVxVQiVhfTclJX7GuGVO5fMYQIWqiqFnh_O67M,170
|
|
45
|
+
notionary/exceptions/data_source/builder.py,sha256=MjDacxvR4C0OiW739R0razjfukKGCXi-TI538ajwVUI,6015
|
|
46
|
+
notionary/exceptions/data_source/properties.py,sha256=WrudbojMa_ktCXvpe0OwegqI-PCUMdi0rTf7-VWqYHo,1236
|
|
47
|
+
notionary/file_upload/client.py,sha256=TVmtMi5iBrgUFLDb7emCwUetmfbTpVFFTnurJ-qU_gw,8384
|
|
48
|
+
notionary/file_upload/models.py,sha256=7a82S1c1PySTulyKJjrOQ-i986W8d3FbCkyGkyUumYc,1738
|
|
49
|
+
notionary/file_upload/service.py,sha256=WcqEE2OfZQ8EhYQWHKzy-Usnd8KzVI3M-1UFWJbJco8,12701
|
|
50
|
+
notionary/http/client.py,sha256=FsrNcxSW99AFu6Gkhre53XcwAHkZZwe9h6H_z_FiGoU,7696
|
|
51
|
+
notionary/http/models.py,sha256=fvjKAGX-b6JcJ-W7V3DEt4v3SnsdikMa6N0c4aolslY,1352
|
|
52
|
+
notionary/page/page_context.py,sha256=dMxGuzNerfcfy6boRPrcEwxCsuNNeFwzQZg-BdeDgec,1506
|
|
53
|
+
notionary/page/page_http_client.py,sha256=YQdXkfMGu2wuJpALJBIsKKwoHv316n_sMjne-iqJYHc,445
|
|
54
|
+
notionary/page/page_metadata_update_client.py,sha256=jJc3SMFnt98YBAb9ie_OxQBXAiXpeCzslOcRRRGwVks,865
|
|
55
|
+
notionary/page/schemas.py,sha256=rEq1TSEGft8Y1P4ATcpYfxk7h_T7bLRxA2__dA2HJzQ,388
|
|
56
|
+
notionary/page/service.py,sha256=2s89lgxxdE-TwRnmMdVTKtEXNuK4ufhLfP-4jhiQdhI,6185
|
|
57
|
+
notionary/page/blocks/client.py,sha256=2ukLeaYdFJCGzpQr-3eIZRFG2potXS-3MdKLoRha9bc,19
|
|
58
|
+
notionary/page/content/factory.py,sha256=MRrHgHIruOVJ1Atew4eF4thPTj2L73QVCbfc9YdYFEM,3760
|
|
59
|
+
notionary/page/content/service.py,sha256=5beyQrQMyjo5Mq6c0uaj3nfbKSA3ujU1aaKiKJN7r3U,2973
|
|
60
|
+
notionary/page/content/markdown/__init__.py,sha256=dhBiNIbiyG38eppjXC0fkZk3NVXzRGC8xqoE89jWHG0,80
|
|
61
|
+
notionary/page/content/markdown/builder.py,sha256=1t4_0mWedf9OM2V1DdDbtHxte8LWsgt8kCx3OkIVFR8,9008
|
|
62
|
+
notionary/page/content/markdown/nodes/__init__.py,sha256=09XSsSNO4surN3lCHayqTC8zhcE5PZ7cAav_-js3dP4,1729
|
|
63
|
+
notionary/page/content/markdown/nodes/audio.py,sha256=CefGip__kbiqo6oBeBphgnZeB6sOBR3-bni9-WRCvK4,888
|
|
64
|
+
notionary/page/content/markdown/nodes/base.py,sha256=95mHu6KRKFXjtaPLHuJPYh8M4glqNGNwixZe1TXD0Z4,348
|
|
65
|
+
notionary/page/content/markdown/nodes/bookmark.py,sha256=Sez3V4nj6-rmbmfAdcgpXzfRkfS4feWU2RamKCOW_OU,966
|
|
66
|
+
notionary/page/content/markdown/nodes/breadcrumb.py,sha256=qkVQSNxcyfeTunTmstt5ydaR-QTsore2aykxkxqfKp4,523
|
|
67
|
+
notionary/page/content/markdown/nodes/bulleted_list.py,sha256=y7zgnsyVb5JlDriaKxXC9sBI2E1stVnYuOf-lxYnM9g,1479
|
|
68
|
+
notionary/page/content/markdown/nodes/callout.py,sha256=MRT6s3Q-XEcWL07bAYOjCDukUcw1pX9CtnrKKtkB0uQ,1111
|
|
69
|
+
notionary/page/content/markdown/nodes/code.py,sha256=DeptFjne05d3QP0Onm2dRYFH0w-sNecoKxibYVBvYxs,1069
|
|
70
|
+
notionary/page/content/markdown/nodes/columns.py,sha256=3-X5qsdYJhJbowPuGKVQpPtdGnKmbqLtV_Gw0c2zrkA,2346
|
|
71
|
+
notionary/page/content/markdown/nodes/container.py,sha256=GMl1Q_ust7Y51lw53wbAHM98kQGbBsSIKJyJfEv0elU,2526
|
|
72
|
+
notionary/page/content/markdown/nodes/divider.py,sha256=YTSYj7aJSubIVmGcpA3R4fsNDaYeK9vdKK3KvKCXo48,511
|
|
73
|
+
notionary/page/content/markdown/nodes/embed.py,sha256=ZmZrujsTwr_-genXfwa-DofCXRjvp6lnSqYy_V-Su6M,888
|
|
74
|
+
notionary/page/content/markdown/nodes/equation.py,sha256=t0hUTc0lOR9k6_9zDZRz5FNWKAtsborgfxJQsmKANM4,764
|
|
75
|
+
notionary/page/content/markdown/nodes/file.py,sha256=wO4vnumZDq2L7LdjXwO0bCroL-GZ9oIySf-Kr3yzJss,883
|
|
76
|
+
notionary/page/content/markdown/nodes/heading.py,sha256=7AY5WEtskBiYXgjJYSscIOK6n_c_1PillbUCidUlcyc,1200
|
|
77
|
+
notionary/page/content/markdown/nodes/image.py,sha256=mTVHgNVhI4Duv9ARhbuWirQ6-_FQSIq3m6IQCzRVicQ,888
|
|
78
|
+
notionary/page/content/markdown/nodes/numbered_list.py,sha256=GLr8AJ9rYr9zAvuWGWua1ERpdv8k3uUQ1W3pSrVmI9o,1334
|
|
79
|
+
notionary/page/content/markdown/nodes/paragraph.py,sha256=m9hk5QyjCnPRXHJzoHBtcNiB4fu1xKy2NV730vajm74,452
|
|
80
|
+
notionary/page/content/markdown/nodes/pdf.py,sha256=WwRnws-BDIU6s5Tjrg_H90rSr3D6pjbEfoonia3wP1Q,878
|
|
81
|
+
notionary/page/content/markdown/nodes/quote.py,sha256=2n1t0bMvJOwFgZ5FRlEy2Klaonaw8X75TXsp5eUUZ2g,923
|
|
82
|
+
notionary/page/content/markdown/nodes/space.py,sha256=eG-AlYkeC19QjG5uuYACdYBbaKYPqICodnUZTQR0kRw,503
|
|
83
|
+
notionary/page/content/markdown/nodes/table.py,sha256=F-GZWQie8LsJAYsgyFrg5wfSt5ZRY7A9PPh3NfWhn2M,1780
|
|
84
|
+
notionary/page/content/markdown/nodes/table_of_contents.py,sha256=THXvxPtFLM69GqJHhGsFhFcnC0eB_gz4Oat7G4ZzJ9Q,521
|
|
85
|
+
notionary/page/content/markdown/nodes/todo.py,sha256=7DJ1kHM-vpAD_HwMLOeyCxD5sns2G4ILZ98jG4SYFW0,1349
|
|
86
|
+
notionary/page/content/markdown/nodes/toggle.py,sha256=9fVsDPFHqrrpj2vYzbDklVitxtWGx5Oxji1ojFLpyRs,926
|
|
87
|
+
notionary/page/content/markdown/nodes/video.py,sha256=COmRavqXIoD7_Y8k1ha6b36gbBtYfyTH-c52mol-h8Q,888
|
|
88
|
+
notionary/page/content/markdown/nodes/mixins/__init__.py,sha256=KVWvxbgwrbfXt495N4xkIu4s8tD-miwVTcXa2fc9Kvc,98
|
|
89
|
+
notionary/page/content/markdown/nodes/mixins/caption.py,sha256=05tHz2RzNzyN6ggKk5gCR4iWWmM9ILwSCgfAxhgo9Bk,436
|
|
90
|
+
notionary/page/content/parser/context.py,sha256=oboLkBQCeUehYtgooycOJ0Vs830Jhx0HIPXBKPWdaaM,4750
|
|
91
|
+
notionary/page/content/parser/factory.py,sha256=M610fBJjqzHb8_rZX2bVgfpqm5Mkszt1njHK-3ovCJQ,7728
|
|
92
|
+
notionary/page/content/parser/service.py,sha256=gHonMPByZhNjUwMNJGPsNTZyfxIZp0Yaza6Z-huO6A8,2891
|
|
93
|
+
notionary/page/content/parser/parsers/__init__.py,sha256=cHGTAs7XZEHPmFHhlnno5J7nmLlfYwuTXtOtWvjWAD4,1637
|
|
94
|
+
notionary/page/content/parser/parsers/audio.py,sha256=FLpGkU1urTPTaUfT0Gnz0Hzgg9Y5exiPjMw-JHdnJjE,1327
|
|
95
|
+
notionary/page/content/parser/parsers/base.py,sha256=do1z_YLjQg1qdExtPaH1negInx3HLXz6kDBaGoCxGcM,988
|
|
96
|
+
notionary/page/content/parser/parsers/bookmark.py,sha256=OPHcQo4XVBNuV--IRarxgnnjDiStgxtUJvJ2WP_EQoA,1233
|
|
97
|
+
notionary/page/content/parser/parsers/breadcrumb.py,sha256=xkPj0dzQrpk349ruB0ysZ2g-7ezWAyrdEhQD3uC5A2s,1190
|
|
98
|
+
notionary/page/content/parser/parsers/bulleted_list.py,sha256=hmBW3CcZMbgKqq46mjm9THMqk7N1le3y2gN6f5Yjspg,3564
|
|
99
|
+
notionary/page/content/parser/parsers/callout.py,sha256=5291TO-6bKllZBP3i_yIrO9bcaPjeZFm4_JvLqOgjII,4022
|
|
100
|
+
notionary/page/content/parser/parsers/caption.py,sha256=nsS2_AENiGx-ojet8Esc0XjLOnIXmv10sjSJ6TrVzLA,2071
|
|
101
|
+
notionary/page/content/parser/parsers/code.py,sha256=A--JUlsjiudnULzKpAU_PkXusP4eP2oZk-r5O57I20k,3529
|
|
102
|
+
notionary/page/content/parser/parsers/column.py,sha256=8Y4pyg4rfk8lAR4AAstzXzD-UQayF3KC4JB7fokQUUM,2914
|
|
103
|
+
notionary/page/content/parser/parsers/column_list.py,sha256=utyOZLO6jEVNUFxDG_yMRKlvewVWCTsfa02w_pWz87g,3474
|
|
104
|
+
notionary/page/content/parser/parsers/divider.py,sha256=j9nuuViHAeXddWg-qt-IYLqnbpRu0tB--ll2nYPnUak,1148
|
|
105
|
+
notionary/page/content/parser/parsers/embed.py,sha256=VBxE6_-P7ifQMW83RhBLqVIO_3-G5CH7zHQvobvSAM0,1203
|
|
106
|
+
notionary/page/content/parser/parsers/equation.py,sha256=hJL4PbJkiBrfphgBCV_a9LRvVHMcUU1_O1lAHDELs5o,2333
|
|
107
|
+
notionary/page/content/parser/parsers/file.py,sha256=Zjj-b4xtvrdPiM3I-NvbY6pwdMlcOP8KRp6MObJpXsk,1349
|
|
108
|
+
notionary/page/content/parser/parsers/heading.py,sha256=MO3XpTlhO18F36rI-u5XQ7TXx739FmntCpvwcoi02N4,4524
|
|
109
|
+
notionary/page/content/parser/parsers/image.py,sha256=JBraNzXRV1d_EEO2rLYg-N1zA7ZHBWGGAbC5t7bVI2o,1357
|
|
110
|
+
notionary/page/content/parser/parsers/numbered_list.py,sha256=ouebkdw3dhbsERdqQLJlbvBP9cw9yJHoUg1r0wrGBrg,3623
|
|
111
|
+
notionary/page/content/parser/parsers/paragraph.py,sha256=GDzGxAQOBFgZPSdzZiK-OruSE3yVIZwyVMPn064NHmU,1359
|
|
112
|
+
notionary/page/content/parser/parsers/pdf.py,sha256=JNRcQxCOEGNxVDfoYe_OlFrFAUZjaLkQuuTkONJWkJY,1341
|
|
113
|
+
notionary/page/content/parser/parsers/quote.py,sha256=--zTyGPfg_V42yfShWQjYgD5x6pHIRqoMCqGl1QnVC0,5078
|
|
114
|
+
notionary/page/content/parser/parsers/space.py,sha256=BJ7IOXrpKO_Xjsb2GWzESW97Tju89VnddB5pkmq7pD4,1569
|
|
115
|
+
notionary/page/content/parser/parsers/table.py,sha256=eyrCdEEGyxmro4mHxKx6APnBHZAfLtWiD6Hlv_MwZvU,5479
|
|
116
|
+
notionary/page/content/parser/parsers/table_of_contents.py,sha256=f8JVQmBvV2ptrUYw5LPY5j844nbFlhU8K-3mfT7GMjk,1205
|
|
117
|
+
notionary/page/content/parser/parsers/todo.py,sha256=iv0WD8T2Y8DxJ3k0khLiyDHPhDJIe2veExu1Aco_a3E,3838
|
|
118
|
+
notionary/page/content/parser/parsers/toggle.py,sha256=x42I5ABN6SyoFxmeliZsToUwiZAtg1JEWTRuWZ6jIe8,2883
|
|
119
|
+
notionary/page/content/parser/parsers/video.py,sha256=NshablM97cL0G8yq_iz_UlOfCFCVujgOuaSCNIqdPCU,1357
|
|
120
|
+
notionary/page/content/parser/post_processing/port.py,sha256=ZjTz9pIrk3R8Hy_NdRWmYTYrGScNyWyqgzcSUk_1BkI,248
|
|
121
|
+
notionary/page/content/parser/post_processing/service.py,sha256=Wp_30iCcqtB7qZdO__E6f_WjNKhkaOQML6q4dW33bJM,608
|
|
122
|
+
notionary/page/content/parser/post_processing/handlers/__init__.py,sha256=Io7Qw_bR6lDXCCuFWUZqR5QmmZwqKG-icE1hRoRivIk,144
|
|
123
|
+
notionary/page/content/parser/post_processing/handlers/rich_text_length.py,sha256=mFiKqq-dPHzUnjXHrWmHRXeU5WUCdGk7HplDxvCCbaE,3571
|
|
124
|
+
notionary/page/content/parser/post_processing/handlers/rich_text_length_truncation.py,sha256=UZhH3ifJtiJrV22jBAQqnTAWWJCAhmp0F4n0gY1RAE0,4143
|
|
125
|
+
notionary/page/content/parser/pre_processsing/service.py,sha256=moa5sHuNvzUQCVGe-4IvqrCEWtIaEMD6M7FMjLXENcM,507
|
|
126
|
+
notionary/page/content/parser/pre_processsing/handlers/__init__.py,sha256=RX6VC1Q9tJAAjtt92hjOy20fcT7yFZP6PvNBjsp79sE,397
|
|
127
|
+
notionary/page/content/parser/pre_processsing/handlers/column_syntax.py,sha256=pd4uFYCriDZWZmM8Ma7nUZMcPh0DExQO0J37Gfpn1Jo,5456
|
|
128
|
+
notionary/page/content/parser/pre_processsing/handlers/indentation.py,sha256=RconFOfl0VR4_RHa4Kqcv9vmbK5xiXSUEXjoMPf1RJU,3324
|
|
129
|
+
notionary/page/content/parser/pre_processsing/handlers/port.py,sha256=Gm_GRGl1eGo1C8AM5CUfFdYAofe4Y0gAPScU2O1EcJo,153
|
|
130
|
+
notionary/page/content/parser/pre_processsing/handlers/video_syntax.py,sha256=O4AA8Gea81NBJklGD-JE4IAeb-IEeWTE2wLTm8BXP1E,2731
|
|
131
|
+
notionary/page/content/parser/pre_processsing/handlers/whitespace.py,sha256=GknAlc4bm2T13MwPz3F-ZP_T_En6-KCQXneqToc2l5I,2685
|
|
132
|
+
notionary/page/content/renderer/context.py,sha256=yiEl0zHWrvfdqXm3tV7IQkuYhoIKaWv3s_PKCNyhRZ8,2015
|
|
133
|
+
notionary/page/content/renderer/factory.py,sha256=YUV0FQ55sPYwTpvDg1n-WoBio4UNUTj3cFg7IGzauzk,8901
|
|
134
|
+
notionary/page/content/renderer/service.py,sha256=llgxgijk6_rYGMLvYW9OdgcpLSk8xxg2mEELRK54CY0,1916
|
|
135
|
+
notionary/page/content/renderer/post_processing/port.py,sha256=VcfLsEyXd8EXMjYEf_uTX0-iq5RThwGvE7mgUsL6b8s,154
|
|
136
|
+
notionary/page/content/renderer/post_processing/service.py,sha256=dCc6GRRDkT3NmVHBerBf_TZfNjCIRbS8NdLJhaDQQsA,511
|
|
137
|
+
notionary/page/content/renderer/post_processing/handlers/__init__.py,sha256=LurntAvtz38tBpm3KAfd_Z-EyaxfG6WS_JPrytfc32M,144
|
|
138
|
+
notionary/page/content/renderer/post_processing/handlers/numbered_list.py,sha256=Ry7RpKa-VSp9VWShvu9KzoWgvyVGeJ3iy5z05o47mdk,5825
|
|
139
|
+
notionary/page/content/renderer/renderers/__init__.py,sha256=YinHG6qfAPRTLD2-fts0gnuDuxQW9ZMBXflxoEfQ16o,1636
|
|
140
|
+
notionary/page/content/renderer/renderers/audio.py,sha256=WfmY672zKhvykazxXPgOdiC3_DXJixBIGMezdlQpzRg,943
|
|
141
|
+
notionary/page/content/renderer/renderers/base.py,sha256=2y8pnPmk-Kf2eA_MKVsGsnt9oKuefaRx5C_ZWsrRa7c,1071
|
|
142
|
+
notionary/page/content/renderer/renderers/bookmark.py,sha256=rpd1SBDNO2uoCCRynGGHeqgudMzDXXNra-hTt3vxJdY,815
|
|
143
|
+
notionary/page/content/renderer/renderers/breadcrumb.py,sha256=M_Qlu73LmSwcCzsF1IJywZIekzOVBP1rd8md51dvfq8,782
|
|
144
|
+
notionary/page/content/renderer/renderers/bulleted_list.py,sha256=FYEmLHxxhG8HrhEnfBzSqoMLpavSphfpw3EbxghcMRE,2015
|
|
145
|
+
notionary/page/content/renderer/renderers/callout.py,sha256=R-wkczhIfaHto3aflh7LMv72vF3Za18MIu5z55nLah4,2017
|
|
146
|
+
notionary/page/content/renderer/renderers/captioned_block.py,sha256=74dx0IiGs1yCq2pXDJgivPsLoBWWr0JV7vDisintSuI,2227
|
|
147
|
+
notionary/page/content/renderer/renderers/code.py,sha256=0ZJpzr-1noVxGQLUyqHfhqv2cWPVAeLmOn-cKwSv-PA,1269
|
|
148
|
+
notionary/page/content/renderer/renderers/column.py,sha256=W9UwDaZPy1QtIfozNespwWvr2-8LWHB9MTtq8bTCUIc,1854
|
|
149
|
+
notionary/page/content/renderer/renderers/column_list.py,sha256=5XChh0doxfoKzYe9_lUdVg0DjKeuV2o83XIvlVqJnsQ,1615
|
|
150
|
+
notionary/page/content/renderer/renderers/divider.py,sha256=S6XvueUgihBC5I5y7_WHWeULfUq3ydvGNC8Mz72nNwQ,796
|
|
151
|
+
notionary/page/content/renderer/renderers/embed.py,sha256=v5Ycztt4koB-uboAn0b9hrvkM0SohBSQMFw_z75_cGw,794
|
|
152
|
+
notionary/page/content/renderer/renderers/equation.py,sha256=lLZ82s2y_K_0avrp6eX8LLvWXTnPX_9kI6bwhGFKe-g,1363
|
|
153
|
+
notionary/page/content/renderer/renderers/fallback.py,sha256=R-w6k5N3EmTQ5ytSzPNykpNwm9tq3dW71Xffchj4qXA,918
|
|
154
|
+
notionary/page/content/renderer/renderers/file.py,sha256=sLwRbScAwNSiGyVhY1DVTvRAg7vOAZ7_BoouCCQI-ec,1136
|
|
155
|
+
notionary/page/content/renderer/renderers/heading.py,sha256=6F1imJeTsn8b7YNtySv-YWbl7XgGxn7SauXaM15tbWo,3770
|
|
156
|
+
notionary/page/content/renderer/renderers/image.py,sha256=zcdEvS_csy1YymWVof1wiKDWCBq0TnL5Ky6PY3sdDbk,943
|
|
157
|
+
notionary/page/content/renderer/renderers/numbered_list.py,sha256=QVzpozfROnuutjbjV-U1qB_VpwpX7m8viSfqE-J_J8s,1818
|
|
158
|
+
notionary/page/content/renderer/renderers/paragraph.py,sha256=srwCP13H9V22wM1Ned0UODWmYrSYlcn4FJgoPb1B4fM,1620
|
|
159
|
+
notionary/page/content/renderer/renderers/pdf.py,sha256=USeqVEHYnxiiCi-IL8VEDdbaQ8EtbKSkSHzDPWeZVS0,923
|
|
160
|
+
notionary/page/content/renderer/renderers/quote.py,sha256=oBYP3kPzzxIRcqj-F1FAqOemG70V95nHm3NBxOOX4os,1987
|
|
161
|
+
notionary/page/content/renderer/renderers/table.py,sha256=CqmV9ii6MVbd8YJvJ18HXBPWXEaSM0i2ufgKJIbJlCo,4619
|
|
162
|
+
notionary/page/content/renderer/renderers/table_of_contents.py,sha256=pWlkz-jQ2jviI-it0XxJQsZ0G5I2ZtxZkC7pBSWnRBg,988
|
|
163
|
+
notionary/page/content/renderer/renderers/table_row.py,sha256=Zs1yFsU4hKIZizg4rGo8THGZ0VKrb3KNUQOT9ehmzFk,623
|
|
164
|
+
notionary/page/content/renderer/renderers/todo.py,sha256=J0hwarEEBhwlDvgSR5jwlJ_cvMw3dpi_UYaWZHCCYEc,2137
|
|
165
|
+
notionary/page/content/renderer/renderers/toggle.py,sha256=BGGvDlQMCaZxUQw-kmv5M5RZq86UZAWvBLLPkagKVtc,2045
|
|
166
|
+
notionary/page/content/renderer/renderers/video.py,sha256=2pKJFFkJheRl-G4qaXIJTvPvwBrUqk11RqqYrly2ptI,943
|
|
167
|
+
notionary/page/content/syntax/__init__.py,sha256=0OjmKk1n4QyZS_0nnKfVAFfn2wge2f4ANQT6UcbX7pg,127
|
|
168
|
+
notionary/page/content/syntax/grammar.py,sha256=vWJ1rgtekcRH4uIb94q83kYaBxmDD0E5YS7oGQR_1Aw,252
|
|
169
|
+
notionary/page/content/syntax/models.py,sha256=pkFoQVMu4eg6xIyi9JYkeRgegrB-QUAw7wlRrIKGIXE,1830
|
|
170
|
+
notionary/page/content/syntax/registry.py,sha256=RsN974l_ddwIv9V4WYFUcEVAo34_BcGiPdrXOtwdYYg,15697
|
|
171
|
+
notionary/page/properties/client.py,sha256=k4iS64txrzhWbaAn_xSzQ31b0yx6JLDh_madCCSLU14,6749
|
|
172
|
+
notionary/page/properties/factory.py,sha256=YnVWZ98RGYpV9iEY4Ufk7InIoeP9vWwMn5sSvcbSQ2k,1248
|
|
173
|
+
notionary/page/properties/models.py,sha256=G3e7vzmk3kU6G1c0oWX9QlKMdaPOuKwR76CscOUPJMg,8878
|
|
174
|
+
notionary/page/properties/service.py,sha256=RDPM6E3XaigzhW6fsIYKpZGqy_ErW88iQ2POmd1VrDA,13178
|
|
175
|
+
notionary/shared/typings.py,sha256=LKg_NJvqi0ZuyB6I995zg4XCyijGKY0T_bW90YiI5_g,58
|
|
176
|
+
notionary/shared/entity/client.py,sha256=knblCIKwUHgoxJ_z7QtrRES9E8P9keHQTvr6CMc69gA,1181
|
|
177
|
+
notionary/shared/entity/dto_parsers.py,sha256=yaADwtL9S6mlQzLSNlW71trL0E3FPBmykgI6wuLNKKU,2086
|
|
178
|
+
notionary/shared/entity/entity_metadata_update_client.py,sha256=MKNT6W4ZUVffdB1BzXBqcWuTqaaBBqZ7Q9cRLrynKOI,1769
|
|
179
|
+
notionary/shared/entity/schemas.py,sha256=-NDlmw3dWANFx2Nw_x1WKhtmp_PmcuzpJ2Tsxx7O23c,1132
|
|
180
|
+
notionary/shared/entity/service.py,sha256=zB46PPnukgN7VQNwqQTKXvQclSDKgxkzgV_0_rIGtAo,8262
|
|
181
|
+
notionary/shared/models/cover.py,sha256=Qg3I6XS7pQUnsx3VO9_dRHHrt_VmJEpU8h3eu92Cqa0,495
|
|
182
|
+
notionary/shared/models/file.py,sha256=kU_hiLHEQDirBDoKkIKutXlRTSv3-hRJRfaoW-1hGtA,442
|
|
183
|
+
notionary/shared/models/icon.py,sha256=f1NVijUb4B_HhcGA7GtVsS1izycb8u8R7A3uy5qAu0o,603
|
|
184
|
+
notionary/shared/models/parent.py,sha256=fptJhWHot35jN9IH9BhsXNMZfNClc8av1G2TR6SqRmY,888
|
|
185
|
+
notionary/shared/properties/type.py,sha256=04KNeWGzphJ2hN6AbVhfDfF89XxtSGzcmnatcPHkEQI,780
|
|
186
|
+
notionary/user/__init__.py,sha256=O1sa9EPnJKZgpEAARJhzgh0ULqmwB-JNIgoPUCwDGMo,111
|
|
187
|
+
notionary/user/base.py,sha256=M2psGOJt6YLKFMw_iWEYave67sfoBa2_0Sij00Zen5M,4362
|
|
188
|
+
notionary/user/bot.py,sha256=G093TD2ZNxwtKpCqKreHxGDa7jsBsAGq8yEqfR3nIT0,2585
|
|
189
|
+
notionary/user/client.py,sha256=CDevJlHfNnrfPE2OaaLWXeNro72J4ezCfwgdM_SJeAg,1410
|
|
190
|
+
notionary/user/factory.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
191
|
+
notionary/user/person.py,sha256=8w0xMNVLen8xx2DSff-3Y9H7x9A0B3FLZUZJQZ_qe4g,1144
|
|
192
|
+
notionary/user/schemas.py,sha256=ZPKopqd6OepGFPnbK3B13PgNH6l4hLCGMxpk0eWe41s,1432
|
|
193
|
+
notionary/user/service.py,sha256=20DaDC4Eozfzr2sf0VP3z6sORRKmfb5PdtGG02rJews,2565
|
|
194
|
+
notionary/utils/date.py,sha256=HPwqmZoylTFKkyI8q4BJXT3q9B39nE55uVZAyG4JnDw,1729
|
|
195
|
+
notionary/utils/decorators.py,sha256=jKik6C_2mAzN1f1RUMkhzsqg7vC_tEO-CyYqLTnyTiw,3722
|
|
196
|
+
notionary/utils/fuzzy.py,sha256=k_D48yHbSd_ecFo3QlrxF5-5c3Bd8gR3bq-_W2J2ZyE,1783
|
|
197
|
+
notionary/utils/pagination.py,sha256=6h1ZZpgn5YFBBUCGAVntZ45wCeFiQRJhW0JqPPtN9Ws,3343
|
|
198
|
+
notionary/utils/uuid_utils.py,sha256=ygTQdiKmdtyb2iY7d9kuYbo8uGSeuhiHH2PhUza6ZUw,579
|
|
199
|
+
notionary/utils/mixins/logging.py,sha256=fCkHFYhNYeVfppCjD5WLKxY7Sr3FHlJ5UhNd7KzrvsM,1662
|
|
200
|
+
notionary/workspace/__init__.py,sha256=DlLV8qNtiuXxru5CorfMkBs_g7SkPalpnN0eNDkODM8,162
|
|
201
|
+
notionary/workspace/client.py,sha256=yChqszwc1FZeuWboqDSEMSkBPNhDO5buOGpdWqJDxLM,2447
|
|
202
|
+
notionary/workspace/schemas.py,sha256=uITRJpqHZD7LF7wOqZ6Cdx51a4Uk9rWZ110ib9EbIrA,562
|
|
203
|
+
notionary/workspace/service.py,sha256=-zznI2_-nBGf_fMVSDkzhe9uqmPv7N0aRTdA21tQ30Q,4983
|
|
204
|
+
notionary/workspace/query/__init__.py,sha256=aw0tu_k4OIYo5nzgQZQZSrQT0HBkyS_4z9g8shiT6-A,107
|
|
205
|
+
notionary/workspace/query/builder.py,sha256=0QV0OHAWIU0O5tXOeTQFKKNNmwaC81nLk_ecHrxdokE,2887
|
|
206
|
+
notionary/workspace/query/models.py,sha256=isebZ9wyvj75C65nhw3VsuJygyZmgZBNX8D5VOf3TAM,1851
|
|
207
|
+
notionary/workspace/query/service.py,sha256=EEHNwZnstoOyBeBa9yGWYs9n54el-IZ-wIWUwhjrxv8,4975
|
|
208
|
+
notionary-0.3.1.dist-info/METADATA,sha256=gq4kaA_KvdA2n1a4hM1XoAEzMWgkNVJ5D04LTsG2pCw,6493
|
|
209
|
+
notionary-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
210
|
+
notionary-0.3.1.dist-info/licenses/LICENSE,sha256=FLNy3l12swSnCggq3zOW_3gh4uaZ12DGZL1tR6Bc5Sk,1102
|
|
211
|
+
notionary-0.3.1.dist-info/RECORD,,
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
from typing import override
|
|
2
|
-
|
|
3
|
-
from notionary.page.content.markdown.nodes.base import MarkdownNode
|
|
4
|
-
from notionary.page.content.syntax.service import SyntaxRegistry
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ToggleableHeadingMarkdownNode(MarkdownNode):
|
|
8
|
-
def __init__(
|
|
9
|
-
self,
|
|
10
|
-
text: str,
|
|
11
|
-
level: int,
|
|
12
|
-
children: list[MarkdownNode] | None = None,
|
|
13
|
-
syntax_registry: SyntaxRegistry | None = None,
|
|
14
|
-
):
|
|
15
|
-
super().__init__(syntax_registry=syntax_registry)
|
|
16
|
-
self.text = text
|
|
17
|
-
self.level = max(1, min(3, level))
|
|
18
|
-
self.children = children or []
|
|
19
|
-
|
|
20
|
-
@override
|
|
21
|
-
def to_markdown(self) -> str:
|
|
22
|
-
toggle_syntax = self._syntax_registry.get_toggle_syntax()
|
|
23
|
-
heading_syntax = self._syntax_registry.get_heading_syntax()
|
|
24
|
-
prefix = toggle_syntax.start_delimiter + (heading_syntax.start_delimiter * self.level)
|
|
25
|
-
result = f"{prefix} {self.text}"
|
|
26
|
-
|
|
27
|
-
if not self.children:
|
|
28
|
-
result += f"\n{toggle_syntax.end_delimiter}"
|
|
29
|
-
return result
|
|
30
|
-
|
|
31
|
-
# Convert children to markdown
|
|
32
|
-
content_parts = [child.to_markdown() for child in self.children]
|
|
33
|
-
content_text = "\n\n".join(content_parts)
|
|
34
|
-
|
|
35
|
-
return result + "\n" + content_text + f"\n{toggle_syntax.end_delimiter}"
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
from typing import override
|
|
2
|
-
|
|
3
|
-
from notionary.blocks.rich_text.markdown_rich_text_converter import MarkdownRichTextConverter
|
|
4
|
-
from notionary.blocks.schemas import (
|
|
5
|
-
BlockColor,
|
|
6
|
-
BlockCreatePayload,
|
|
7
|
-
BlockType,
|
|
8
|
-
CreateHeading1Block,
|
|
9
|
-
CreateHeading2Block,
|
|
10
|
-
CreateHeading3Block,
|
|
11
|
-
CreateHeadingBlock,
|
|
12
|
-
CreateHeadingData,
|
|
13
|
-
)
|
|
14
|
-
from notionary.page.content.parser.parsers import (
|
|
15
|
-
BlockParsingContext,
|
|
16
|
-
LineParser,
|
|
17
|
-
ParentBlockContext,
|
|
18
|
-
)
|
|
19
|
-
from notionary.page.content.syntax.service import SyntaxRegistry
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class ToggleableHeadingParser(LineParser):
|
|
23
|
-
MIN_HEADING_LEVEL = 1
|
|
24
|
-
MAX_HEADING_LEVEL = 3
|
|
25
|
-
|
|
26
|
-
HEADING_BLOCK_TYPES = (CreateHeading1Block, CreateHeading2Block, CreateHeading3Block)
|
|
27
|
-
|
|
28
|
-
def __init__(self, syntax_registry: SyntaxRegistry, rich_text_converter: MarkdownRichTextConverter) -> None:
|
|
29
|
-
super().__init__(syntax_registry)
|
|
30
|
-
self._syntax = syntax_registry.get_toggleable_heading_syntax()
|
|
31
|
-
self._rich_text_converter = rich_text_converter
|
|
32
|
-
|
|
33
|
-
@override
|
|
34
|
-
def _can_handle(self, context: BlockParsingContext) -> bool:
|
|
35
|
-
return self._is_heading_start(context) or self._is_heading_end(context) or self._is_heading_content(context)
|
|
36
|
-
|
|
37
|
-
@override
|
|
38
|
-
async def _process(self, context: BlockParsingContext) -> None:
|
|
39
|
-
if self._is_heading_start(context):
|
|
40
|
-
await self._start_toggleable_heading(context)
|
|
41
|
-
elif self._is_heading_end(context):
|
|
42
|
-
await self._finalize_toggleable_heading(context)
|
|
43
|
-
elif self._is_heading_content(context):
|
|
44
|
-
await self._add_heading_content(context)
|
|
45
|
-
|
|
46
|
-
def _is_heading_start(self, context: BlockParsingContext) -> bool:
|
|
47
|
-
return self._syntax.regex_pattern.match(context.line) is not None
|
|
48
|
-
|
|
49
|
-
def _is_heading_end(self, context: BlockParsingContext) -> bool:
|
|
50
|
-
if not self._syntax.end_regex_pattern.match(context.line):
|
|
51
|
-
return False
|
|
52
|
-
return self._has_heading_on_stack(context)
|
|
53
|
-
|
|
54
|
-
def _is_heading_content(self, context: BlockParsingContext) -> bool:
|
|
55
|
-
if not self._has_heading_on_stack(context):
|
|
56
|
-
return False
|
|
57
|
-
|
|
58
|
-
return not (
|
|
59
|
-
self._syntax.regex_pattern.match(context.line) or self._syntax.end_regex_pattern.match(context.line)
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
def _has_heading_on_stack(self, context: BlockParsingContext) -> bool:
|
|
63
|
-
if not context.parent_stack:
|
|
64
|
-
return False
|
|
65
|
-
current_parent = context.parent_stack[-1]
|
|
66
|
-
return isinstance(current_parent.block, self.HEADING_BLOCK_TYPES)
|
|
67
|
-
|
|
68
|
-
async def _start_toggleable_heading(self, context: BlockParsingContext) -> None:
|
|
69
|
-
block = await self._create_heading_block(context.line)
|
|
70
|
-
if not block:
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
parent_context = ParentBlockContext(
|
|
74
|
-
block=block,
|
|
75
|
-
child_lines=[],
|
|
76
|
-
)
|
|
77
|
-
context.parent_stack.append(parent_context)
|
|
78
|
-
|
|
79
|
-
async def _create_heading_block(self, line: str) -> CreateHeadingBlock | None:
|
|
80
|
-
match = self._syntax.regex_pattern.match(line)
|
|
81
|
-
if not match:
|
|
82
|
-
return None
|
|
83
|
-
|
|
84
|
-
level = len(match.group("level"))
|
|
85
|
-
content = match.group(2).strip()
|
|
86
|
-
|
|
87
|
-
if not self._is_valid_heading(level, content):
|
|
88
|
-
return None
|
|
89
|
-
|
|
90
|
-
heading_data = await self._build_heading_data(content)
|
|
91
|
-
|
|
92
|
-
if level == 1:
|
|
93
|
-
return CreateHeading1Block(heading_1=heading_data)
|
|
94
|
-
elif level == 2:
|
|
95
|
-
return CreateHeading2Block(heading_2=heading_data)
|
|
96
|
-
else:
|
|
97
|
-
return CreateHeading3Block(heading_3=heading_data)
|
|
98
|
-
|
|
99
|
-
def _is_valid_heading(self, level: int, content: str) -> bool:
|
|
100
|
-
return self.MIN_HEADING_LEVEL <= level <= self.MAX_HEADING_LEVEL and bool(content)
|
|
101
|
-
|
|
102
|
-
async def _build_heading_data(self, content: str) -> CreateHeadingData:
|
|
103
|
-
rich_text = await self._rich_text_converter.to_rich_text(content)
|
|
104
|
-
return CreateHeadingData(rich_text=rich_text, color=BlockColor.DEFAULT, is_toggleable=True, children=[])
|
|
105
|
-
|
|
106
|
-
async def _add_heading_content(self, context: BlockParsingContext) -> None:
|
|
107
|
-
context.parent_stack[-1].add_child_line(context.line)
|
|
108
|
-
|
|
109
|
-
async def _finalize_toggleable_heading(self, context: BlockParsingContext) -> None:
|
|
110
|
-
heading_context = context.parent_stack.pop()
|
|
111
|
-
await self._assign_children(heading_context, context)
|
|
112
|
-
self._add_to_parent_or_result(heading_context.block, context)
|
|
113
|
-
|
|
114
|
-
async def _assign_children(self, heading_context: ParentBlockContext, context: BlockParsingContext) -> None:
|
|
115
|
-
children = await self._collect_children(heading_context, context)
|
|
116
|
-
self._set_heading_children(heading_context.block, children)
|
|
117
|
-
|
|
118
|
-
async def _collect_children(
|
|
119
|
-
self, heading_context: ParentBlockContext, context: BlockParsingContext
|
|
120
|
-
) -> list[BlockCreatePayload]:
|
|
121
|
-
children = []
|
|
122
|
-
|
|
123
|
-
if heading_context.child_lines:
|
|
124
|
-
text = "\n".join(heading_context.child_lines)
|
|
125
|
-
text_blocks = await self._parse_nested_content(text, context)
|
|
126
|
-
children.extend(text_blocks)
|
|
127
|
-
|
|
128
|
-
if heading_context.child_blocks:
|
|
129
|
-
children.extend(heading_context.child_blocks)
|
|
130
|
-
|
|
131
|
-
return children
|
|
132
|
-
|
|
133
|
-
def _set_heading_children(self, block: CreateHeadingBlock, children: list[BlockCreatePayload]) -> None:
|
|
134
|
-
if block.type == BlockType.HEADING_1:
|
|
135
|
-
block.heading_1.children = children
|
|
136
|
-
elif block.type == BlockType.HEADING_2:
|
|
137
|
-
block.heading_2.children = children
|
|
138
|
-
elif block.type == BlockType.HEADING_3:
|
|
139
|
-
block.heading_3.children = children
|
|
140
|
-
|
|
141
|
-
def _add_to_parent_or_result(self, block: CreateHeadingBlock, context: BlockParsingContext) -> None:
|
|
142
|
-
if context.parent_stack:
|
|
143
|
-
context.parent_stack[-1].add_child_block(block)
|
|
144
|
-
else:
|
|
145
|
-
context.result_blocks.append(block)
|
|
146
|
-
|
|
147
|
-
async def _parse_nested_content(self, text: str, context: BlockParsingContext) -> list:
|
|
148
|
-
if not text.strip():
|
|
149
|
-
return []
|
|
150
|
-
return await context.parse_nested_content(text)
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import re
|
|
2
|
-
from typing import override
|
|
3
|
-
|
|
4
|
-
from notionary.page.content.renderer.post_processing.port import PostProcessor
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class NumberedListPlaceholderReplaceerPostProcessor(PostProcessor):
|
|
8
|
-
"""
|
|
9
|
-
Handles post processing of numbered lists in markdown text.
|
|
10
|
-
Would otherwise require complex state management during initial rendering.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
NUMBERED_LIST_PLACEHOLDER = "__NUM__"
|
|
14
|
-
LIST_ITEM_PATTERN = rf"^\s*{re.escape(NUMBERED_LIST_PLACEHOLDER)}\.\s*(.*)"
|
|
15
|
-
NUMBERED_ITEM_PATTERN = r"^\d+\.\s+"
|
|
16
|
-
|
|
17
|
-
@override
|
|
18
|
-
def process(self, markdown_text: str) -> str:
|
|
19
|
-
lines = markdown_text.splitlines()
|
|
20
|
-
processed_lines = []
|
|
21
|
-
list_counter = 1
|
|
22
|
-
|
|
23
|
-
for line_index, line in enumerate(lines):
|
|
24
|
-
if self._is_custom_list_item(line):
|
|
25
|
-
content = self._extract_list_content(line)
|
|
26
|
-
processed_lines.append(f"{list_counter}. {content}")
|
|
27
|
-
list_counter += 1
|
|
28
|
-
elif self._should_skip_blank_line(lines, line_index, processed_lines):
|
|
29
|
-
continue
|
|
30
|
-
else:
|
|
31
|
-
list_counter = 1
|
|
32
|
-
processed_lines.append(line)
|
|
33
|
-
|
|
34
|
-
return "\n".join(processed_lines)
|
|
35
|
-
|
|
36
|
-
def _is_custom_list_item(self, line: str) -> bool:
|
|
37
|
-
return bool(re.match(self.LIST_ITEM_PATTERN, line.strip()))
|
|
38
|
-
|
|
39
|
-
def _extract_list_content(self, line: str) -> str:
|
|
40
|
-
match = re.match(self.LIST_ITEM_PATTERN, line.strip())
|
|
41
|
-
return match.group(1) if match else ""
|
|
42
|
-
|
|
43
|
-
def _is_numbered_list_item(self, line: str) -> bool:
|
|
44
|
-
return bool(re.match(self.NUMBERED_ITEM_PATTERN, line))
|
|
45
|
-
|
|
46
|
-
def _is_blank_line(self, line: str) -> bool:
|
|
47
|
-
return not line.strip()
|
|
48
|
-
|
|
49
|
-
def _should_skip_blank_line(self, lines: list[str], current_index: int, processed_lines: list[str]) -> bool:
|
|
50
|
-
if not self._is_blank_line(lines[current_index]):
|
|
51
|
-
return False
|
|
52
|
-
|
|
53
|
-
previous_is_list_item = processed_lines and self._is_numbered_list_item(processed_lines[-1])
|
|
54
|
-
if not previous_is_list_item:
|
|
55
|
-
return False
|
|
56
|
-
|
|
57
|
-
next_index = current_index + 1
|
|
58
|
-
if next_index >= len(lines):
|
|
59
|
-
return False
|
|
60
|
-
|
|
61
|
-
next_is_list_item = self._is_custom_list_item(lines[next_index])
|
|
62
|
-
return next_is_list_item
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
from typing import override
|
|
2
|
-
|
|
3
|
-
from notionary.blocks.rich_text.rich_text_markdown_converter import RichTextToMarkdownConverter
|
|
4
|
-
from notionary.blocks.schemas import Block, BlockType
|
|
5
|
-
from notionary.page.content.renderer.context import MarkdownRenderingContext
|
|
6
|
-
from notionary.page.content.renderer.renderers.base import BlockRenderer
|
|
7
|
-
from notionary.page.content.syntax.service import SyntaxRegistry
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class ToggleableHeadingRenderer(BlockRenderer):
|
|
11
|
-
def __init__(
|
|
12
|
-
self,
|
|
13
|
-
syntax_registry: SyntaxRegistry | None = None,
|
|
14
|
-
rich_text_markdown_converter: RichTextToMarkdownConverter | None = None,
|
|
15
|
-
) -> None:
|
|
16
|
-
super().__init__(syntax_registry=syntax_registry)
|
|
17
|
-
self._heading_syntax = self._syntax_registry.get_heading_syntax()
|
|
18
|
-
self._rich_text_markdown_converter = rich_text_markdown_converter or RichTextToMarkdownConverter()
|
|
19
|
-
|
|
20
|
-
@override
|
|
21
|
-
def _can_handle(self, block: Block) -> bool:
|
|
22
|
-
if block.type == BlockType.HEADING_1:
|
|
23
|
-
return block.heading_1.is_toggleable
|
|
24
|
-
if block.type == BlockType.HEADING_2:
|
|
25
|
-
return block.heading_2.is_toggleable
|
|
26
|
-
if block.type == BlockType.HEADING_3:
|
|
27
|
-
return block.heading_3.is_toggleable
|
|
28
|
-
|
|
29
|
-
@override
|
|
30
|
-
async def _process(self, context: MarkdownRenderingContext) -> None:
|
|
31
|
-
level = self._get_heading_level(context.block)
|
|
32
|
-
title = await self._get_heading_title(context.block)
|
|
33
|
-
|
|
34
|
-
if not title or level == 0:
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
syntax = self._syntax_registry.get_toggleable_heading_syntax()
|
|
38
|
-
prefix = self._syntax_registry.TOGGLE_DELIMITER + " " + (self._heading_syntax.start_delimiter * level)
|
|
39
|
-
heading_start = f"{prefix} {title}"
|
|
40
|
-
|
|
41
|
-
if context.indent_level > 0:
|
|
42
|
-
heading_start = context.indent_text(heading_start)
|
|
43
|
-
|
|
44
|
-
children_markdown = await context.render_children()
|
|
45
|
-
|
|
46
|
-
heading_end = syntax.end_delimiter
|
|
47
|
-
if context.indent_level > 0:
|
|
48
|
-
heading_end = context.indent_text(heading_end)
|
|
49
|
-
|
|
50
|
-
if children_markdown:
|
|
51
|
-
context.markdown_result = f"{heading_start}\n{children_markdown}\n{heading_end}"
|
|
52
|
-
else:
|
|
53
|
-
context.markdown_result = f"{heading_start}\n{heading_end}"
|
|
54
|
-
|
|
55
|
-
def _get_heading_level(self, block: Block) -> int:
|
|
56
|
-
if block.type == BlockType.HEADING_1:
|
|
57
|
-
return 1
|
|
58
|
-
elif block.type == BlockType.HEADING_2:
|
|
59
|
-
return 2
|
|
60
|
-
elif block.type == BlockType.HEADING_3:
|
|
61
|
-
return 3
|
|
62
|
-
else:
|
|
63
|
-
return 0
|
|
64
|
-
|
|
65
|
-
async def _get_heading_title(self, block: Block) -> str:
|
|
66
|
-
if block.type == BlockType.HEADING_1:
|
|
67
|
-
heading_content = block.heading_1
|
|
68
|
-
elif block.type == BlockType.HEADING_2:
|
|
69
|
-
heading_content = block.heading_2
|
|
70
|
-
elif block.type == BlockType.HEADING_3:
|
|
71
|
-
heading_content = block.heading_3
|
|
72
|
-
else:
|
|
73
|
-
return ""
|
|
74
|
-
|
|
75
|
-
if not heading_content or not heading_content.rich_text:
|
|
76
|
-
return ""
|
|
77
|
-
|
|
78
|
-
return await self._rich_text_markdown_converter.to_markdown(heading_content.rich_text)
|
notionary/utils/async_retry.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
import functools
|
|
3
|
-
from collections.abc import Callable
|
|
4
|
-
from typing import Any
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
def async_retry(
|
|
8
|
-
max_retries: int = 3,
|
|
9
|
-
initial_delay: float = 1.0,
|
|
10
|
-
backoff_factor: float = 2.0,
|
|
11
|
-
retry_on_exceptions: tuple[type[Exception], ...] | None = None,
|
|
12
|
-
):
|
|
13
|
-
def decorator(func: Callable[..., Any]) -> Callable[..., Any]:
|
|
14
|
-
@functools.wraps(func)
|
|
15
|
-
async def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
16
|
-
delay = initial_delay
|
|
17
|
-
last_exception = None
|
|
18
|
-
|
|
19
|
-
for attempt in range(max_retries + 1):
|
|
20
|
-
try:
|
|
21
|
-
return await func(*args, **kwargs)
|
|
22
|
-
except Exception as e:
|
|
23
|
-
last_exception = e
|
|
24
|
-
|
|
25
|
-
# If specific exceptions are defined, only retry those
|
|
26
|
-
if retry_on_exceptions is not None and not isinstance(e, retry_on_exceptions):
|
|
27
|
-
raise
|
|
28
|
-
|
|
29
|
-
if attempt == max_retries:
|
|
30
|
-
raise
|
|
31
|
-
|
|
32
|
-
await asyncio.sleep(delay)
|
|
33
|
-
delay *= backoff_factor
|
|
34
|
-
|
|
35
|
-
raise last_exception
|
|
36
|
-
|
|
37
|
-
return wrapper
|
|
38
|
-
|
|
39
|
-
return decorator
|
notionary/utils/singleton.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from collections.abc import Callable
|
|
2
|
-
from typing import Any
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def singleton(cls) -> Callable[..., Any]:
|
|
6
|
-
instances = {}
|
|
7
|
-
|
|
8
|
-
def get_instance(*args, **kwargs) -> Any:
|
|
9
|
-
if cls not in instances:
|
|
10
|
-
instances[cls] = cls(*args, **kwargs)
|
|
11
|
-
return instances[cls]
|
|
12
|
-
|
|
13
|
-
return get_instance
|