Closed Kin-Zhang closed 2 years ago
Oh thank you for sharing the error. Can you share the notion page url that you tested? It will be more easy to find which block occurs error.
Oh thank you for sharing the error. Can you share the notion page url that you tested? It will be more easy to find which block occurs error.
Thanks for your quick reply, here is the page: https://kinzhang.notion.site/Optimization-Based-Collision-Avoidance-815a2796158b41c4990fa9a04272e9a4 Just ignore the language...
I think the error may be it didn't support all kinds of the block that notion have... but the notion export button to markdown is fine, just sometimes the format is terrible with tab especially.
here is the config script:
from notion2md.exporter import block_exporter
class config:
def __init__(self, id, path, name):
self.target_id = id
self.output_path = path
self.file_name = name
my_config = config("815a2796158b41c4990fa9a04272e9a4","/home/kin/MyBlog/content/posts","test")
block_exporter(my_config)
Yeap. I found that I didn't add the handling case for "mention" type richtext. I add it and it will work well now. I will release new version that fixes this. Thank you p.s. I changed the tap to \t
Yeap. I found that I didn't add the handling case for "mention" type richtext. I add it and it will work well now. I will release new version that fixes this. Thank you p.s. I changed the tap to \t
Retrieving blocks from '815a2796158b41c4990fa9a04272e9a4'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/exporter.py", line 18, in block_exporter
output.write(blocks_convertor(blocks))
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/convertor/block.py", line 109, in blocks_convertor
outcome_blocks = "".join([result for result in results])
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/convertor/block.py", line 109, in <listcomp>
outcome_blocks = "".join([result for result in results])
File "/home/kin/anaconda3/envs/py37/lib/python3.7/concurrent/futures/_base.py", line 598, in result_iterator
yield fs.pop().result()
File "/home/kin/anaconda3/envs/py37/lib/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/home/kin/anaconda3/envs/py37/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/kin/anaconda3/envs/py37/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/convertor/block.py", line 151, in block_convertor
outcome_block += "\t"*depth + block_convertor(block,depth)
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/convertor/block.py", line 140, in block_convertor
outcome_block = block_type_map[block_type](information_collector(block[block_type])) + "\n\n"
File "/home/kin/anaconda3/envs/py37/lib/python3.7/site-packages/notion2md/convertor/block.py", line 67, in image
return f"![{information['url']}]({information['url']})\n\n{information['caption']}"
KeyError: 'url'
It seems also have other... error like URL?
System:
pip install
Here is the error show on python, I tried a simple page it works but with other more complex page have many blocks, it seems have problems: And here is the error text: