notionapi icon indicating copy to clipboard operation
notionapi copied to clipboard

Can toMarkdown supports code type selections?

Open chaoszh opened this issue 4 years ago • 1 comments

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!

chaoszh avatar Sep 01 '21 07:09 chaoszh

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

kjk avatar Sep 01 '21 07:09 kjk