kjk / notionapi

Unofficial Go API for Notion.so
https://blog.kowalczyk.info/article/c9df78cbeaae4e0cb2848c9964bcfc94/using-notion-api-go-client.html
BSD 2-Clause "Simplified" License
1.82k stars 86 forks source link

Can toMarkdown supports code type selections? #44

Open chaoszh opened 3 years ago

chaoszh commented 3 years ago

Hi, I am using tomarkdown.ToMarkdown api to get markdown content of a certain page. For code block, it generate markdown as below

     code

instead of

```python
code
```

I wonder if there is anyway to keep coding language attributes like the second one.

Thanks!

kjk commented 3 years ago

I don't have the bandwidth to work on tomarkdown but I'll merge PRs.

You would have to change https://github.com/kjk/notionapi/blob/master/tomarkdown/markdown.go#L318

You can also implement custom rendering just for your code using Converter.RenderBlockOverride