Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

doesn't support block equation #56

Open
AlieZVzz opened this issue Dec 3, 2022 · 2 comments
Open

doesn't support block equation #56

AlieZVzz opened this issue Dec 3, 2022 · 2 comments

Comments

@AlieZVzz
Copy link

AlieZVzz commented Dec 3, 2022

The latex equation in mardown file is $$, which should be a block equation in notion.
image
But when I import this to notion, it is a Inline Equation.
image
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)
@williamium3000
Copy link

same problem here. Is there a solution for this?

@AlieZVzz
Copy link
Author

I'm afraid not. I convert it manually so maybe you should try another way:(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants