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

Conversation

@egordm
Copy link
Contributor

@egordm egordm commented Dec 30, 2020

This PR adds an additional renderer (LatexNotionPyRenderer) which converts

  • Inline Equation $y = ax + b$ is translated to $$y = ax + b$$
  • Block Equation $$y = ax + b$$ is translated to notion EquationBlock.

While Inline Equation uses notion accepted format ($$) it is not yet translated to an actual inline-block. There is a PR pending in notion-py for this (jamalex/notion-py#247).

A relevant issue for this is #20

Example usage:

from md2notion.NotionPyRenderer import LatexNotionPyRenderer
from md2notion.upload import convert

mdFile1 = io.StringIO('$y = ax + b$\n$$\ny = ax + b \n $$')
mdFile1.__dict__["name"] = path

@Cobertos
Copy link
Owner

Cobertos commented Jan 1, 2021

Hey, thanks for the implementation of this!

Just a couple things:

Added cli support for latex
Added additional test for latex functionality
@egordm
Copy link
Contributor Author

egordm commented Jan 4, 2021

Hey @Cobertos,

Thanks for the feedback.
I have changed the code to use an extension instead and added a few tests.

@Cobertos
Copy link
Owner

Cobertos commented Jan 4, 2021

This looks great!

Any reason you can think of to not have latex extension be on by default? I'd like to keep feature parity where possible with Notion's uploader and #20 seems to suggest that it is default in Notion's uploader

I'll pull this down and give it a test by the end of the week

@Cobertos
Copy link
Owner

Cobertos commented Feb 8, 2021

Looks like the upstream PR is merged. Testing it out rn

@Cobertos Cobertos merged commit b95edce into Cobertos:master Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants