yannick-cw / notionfy

Syncing kindle highlights to notion
BSD 3-Clause "New" or "Revised" License
138 stars 7 forks source link

Custom styles for the highlights #19

Open sidc9 opened 3 years ago

sidc9 commented 3 years ago

Hi, first of all, I really liked using this app!

I was wondering if it is possible to customise the page design/layout for the highlights.

For example, currently each highlight extracted into Notion contains the book title and author name. I would like to have Book title as h1 , author as h2 and then the highlights as bullet points. This is just one example, I have other preferences too, so I was hoping this can be customised by the user.

As a side note, I tried to clone your app in Go but couldn't figure out the Notion API. Would you mind sharing the API request format or pointing me to some resources which might have it?

Thanks!

yannick-cw commented 3 years ago

Hey, yes that sounds like a lot of customization, not possible within this app. You could either fork it and write some Scala, might be the easiest :)

Unfortunately there are no API resource anywhere, I found out through analyzing the network traffic.

Creating a highlight happens through this endpont: https://www.notion.so/api/v3/submitTransaction

And you can find the case classes (basically a 1:1 mapping of the JSON structure) here: https://github.com/yannick-cw/notionfy/blob/d353d310b3e10b708beda0b82d26cf0918ad9aee/src/main/scala/notionfys/Notion.scala#L182

It gets constructed here: https://github.com/yannick-cw/notionfy/blob/d353d310b3e10b708beda0b82d26cf0918ad9aee/src/main/scala/notionfys/Notion.scala#L31

In the same file you find the equivalent for getting the data out of notion.

sidc9 commented 3 years ago

Ah all right. Thanks a lot for the explanation!