Hi there. I am trying to convert programming ebooks to markdown format for adding this books to my markdown notes and making changes(adding extra notes and adding my own codes) on it. My problem is conversion tools cannot convert code blocks properly.I know that a lot of techniques exist pdf, epub to markdown so I want to discuss which technique is better for converting cs books to markdown format.
EPUB->HTML->MARKDOWN
My technique is the following:
- I use epub ebooks rather than pdf ebooks. Because epub format has a better structure for HTML, I have a lot of data loss when I tried to convert PDF to HTML because PDF format is a presenttation tool, not a structure tool.
- I use calibre to convert EPUB to HTML because it is awesome for structure detection.
- I use pandoc to convert html to markdown.My results are pretty good except for code blocks.Code blocks rendered as HTML paragraphs instead of markdown code blocks.
My main problem is that conversion tools lose code block style on PDF,EPUB to HTML conversion phase. I tried pandoc,calibre but neither of these programs maintain code block style.
Any advice for converting programming ebooks to markdown format appreciated.