The latex equation in mardown file is $$, which should be a block equation in notion.
But when I import this to notion, it is a Inline Equation.
Here is my code. It seems the code will tranform the single $ into double $$
from notion.client import NotionClient
from notion.block import PageBlock
import itertools
from md2notion.upload import upload, convert, uploadBlock
from md2notion.NotionPyRenderer import NotionPyRenderer, addLatexExtension
from tqdm.notebook import tqdm
import os
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"
# Follow the instructions at https://github.com/jamalex/notion-py#quickstart to setup Notion.py
client = NotionClient(
token_v2="")
page = client.get_block(
"")
with open("text.md", "r", encoding="utf-8") as mdFile:
newPage = page.children.add_new(PageBlock, title="XGBoost")
lines = mdFile.readlines()
rendered = convert(lines, addLatexExtension(NotionPyRenderer))
for blockDescriptor in tqdm(rendered):
uploadBlock(blockDescriptor, newPage, mdFile.name)
The latex equation in mardown file is $$, which should be a block equation in notion. But when I import this to notion, it is a Inline Equation. Here is my code. It seems the code will tranform the single $ into double $$