Live data from Hacker News

Converting Markdown to ePub or Mobi Using Pandoc

themythicalengineer.com

11–20 of 56 posts

Re: Converting Markdown to ePub or Mobi Using Pandoc

#11
Thanks for the nice tutorial OP.

Here's a public notebook in Deepnote if anyone wants to play around with the code or duplicate it: https://deepnote.com/project/Converting-Markdown-to-Epub-or-...

2 fun facts about Deepnote:

1. You can create a Custom environment by writing a Dockerfile with all the libraries you need to install and everytime you're in a need to re-use a similar functionality (e.g. convert yet another book to mobi), you can just fire it up and all will be preinstalled. https://docs.deepnote.com/environment/custom-environments

2. You can turn any notebook to a blogpost right away and publish within Deepnote directly.

Disclaimer: I'm a software engineer at Deepnote.

Re: Converting Markdown to ePub or Mobi Using Pandoc

#12
post #11

Thanks for the nice tutorial OP. Here's a public notebook in Deepnote if anyone wants to play around with the code or duplicate it: https://deepnote.com/project/Converting-Markdown-to-Epub-or-... 2 fun facts about Deepnote: 1. You can create a Custom environment by writing a Dockerfile with all the libraries you need to install and everytime you're in a need to re-use a similar functionality (e.g. convert yet another…

Wait this is a notebook similar to pythons' notebook but it's a docker environment where I can install a lot of stuff I want and then do even more stuff? Am i getting this right?

It's like a shell to a vm but in a notebook format that you can then use to blog?

Re: Converting Markdown to ePub or Mobi Using Pandoc

#13
post #6

The tutorial is presented well. My biggest takeaway was that one can use 'Deepnote' to run Linux commands. If you are interested in knowing how to customize `pandoc` for generating PDF/EPUB, I have a tutorial [0] based on books I've written. I also have links at the end with related resources, including tools others than `pandoc`. [0] https://learnbyexample.github.io/customizing-pandoc/

Jupyter notebook also has the same feature. `!shell command` or start a cell with `%%bash` and everything in it will run through the terminal, not the notebook interpreter.

Re: Converting Markdown to ePub or Mobi Using Pandoc

#14
Is Pandoc being used mostly to join the files?

I recently started converting Markdown files to epub (and kepub) for my new Kobo. I load the Markdown straight into Calibre though.

On a side note, is there some benefit to mobi over epub? Kepub seems to be the preferred format on Kobo, because for some reason it turns pages _much_ faster than epub and gives access to reader statistics (if one cares about that).

Re: Converting Markdown to ePub or Mobi Using Pandoc

#15
post #11

Thanks for the nice tutorial OP. Here's a public notebook in Deepnote if anyone wants to play around with the code or duplicate it: https://deepnote.com/project/Converting-Markdown-to-Epub-or-... 2 fun facts about Deepnote: 1. You can create a Custom environment by writing a Dockerfile with all the libraries you need to install and everytime you're in a need to re-use a similar functionality (e.g. convert yet another…

Wait this is a notebook similar to pythons' notebook but it's a docker environment where I can install a lot of stuff I want and then do even more stuff? Am i getting this right? It's like a shell to a vm but in a notebook format that you can then use to blog?

Yeah, you got it right. You can even access the actual shell in the vm, not just the notebook environment.

Re: Converting Markdown to ePub or Mobi Using Pandoc

#16
I followed a similar approach for my novel; started with Markdown, used pandoc to convert it to epub/mobi, but also to LibreOffice .odt to generate the PDF for the paperback. Wrote some details about the process here: https://gabrielgambetta.com/tgs-open-source.html

Re: Converting Markdown to ePub or Mobi Using Pandoc

#18
post #15

Earlier quoted context omitted.

Wait this is a notebook similar to pythons' notebook but it's a docker environment where I can install a lot of stuff I want and then do even more stuff? Am i getting this right? It's like a shell to a vm but in a notebook format that you can then use to blog?

Yeah, you got it right. You can even access the actual shell in the vm, not just the notebook environment.

Awesome! I will definitely give it a try

Re: Converting Markdown to ePub or Mobi Using Pandoc

#19
post #4

Is the resulting typesetting any good?

Epub is just html with css and images in a zip file. So the quality of the typography will largely depend on the renderer, not the file itself.

Unfortunately, the renderer that gets used will sometimes itself depend on the file. For example, if you transfer the generated Mobi file to a Kindle as the article says, it will get rendered using an inferior renderer (in terms of kerning, for example) compared to the renderer that would've been used had the file been a KFX ("Kindle Format 10").

Re: Converting Markdown to ePub or Mobi Using Pandoc

#20
post #11

Thanks for the nice tutorial OP. Here's a public notebook in Deepnote if anyone wants to play around with the code or duplicate it: https://deepnote.com/project/Converting-Markdown-to-Epub-or-... 2 fun facts about Deepnote: 1. You can create a Custom environment by writing a Dockerfile with all the libraries you need to install and everytime you're in a need to re-use a similar functionality (e.g. convert yet another…

Thanks for publishing this as a notebook. I really love the platform.
Post reply on HN