Live data from Hacker News

Converting Markdown to ePub or Mobi Using Pandoc

themythicalengineer.com

21–30 of 56 posts

Re: Converting Markdown to ePub or Mobi Using Pandoc

#21
Why wget|dpkg and wget|sh instead of apt to download Pandoc and Calibre?

You should be able to replace all this:

    !wget https://github.com/jgm/pandoc/releases/download/2.11.3.2/pandoc-2.11.3.2-1-amd64.deb
    !sudo dpkg -i pandoc-2.11.3.2-1-amd64.deb
    !apt install libgl1-mesa-glx -y
    !wget -q -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
With simply this:

    !apt install pandoc calibre

Re: Converting Markdown to ePub or Mobi Using Pandoc

#23
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…

what would be advantages to going to Deepnote from regular Jupyter notebooks based workflow?

Let's assume someone who has been working with Jupyter notebooks(mostly Python based) for a long time.

Are Deepnote notebooks exportable?

The big worry is that you guys decide to pivot or radically change your pricing model and there is no offramp.

By comparison I don't mind using Google Colab. If Google Colab decides to shutdown or 100x their price I can take my .ipynb files and use them on my local littlest JupyterHub instance.

Re: Converting Markdown to ePub or Mobi Using Pandoc

#24
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.

That'd require you to have access to a *nix terminal on your system. Deepnote is allowing access through their servers, so for example, you can try this tutorial on Windows.

See this comment from Deepnote engineer for more details: https://news.ycombinator.com/item?id=26899905

Re: Converting Markdown to ePub or Mobi Using Pandoc

#26
post #21

Why wget|dpkg and wget|sh instead of apt to download Pandoc and Calibre? You should be able to replace all this: !wget https://github.com/jgm/pandoc/releases/download/2.11.3.2/pandoc-2.11.3.2-1-amd64.deb !sudo dpkg -i pandoc-2.11.3.2-1-amd64.deb !apt install libgl1-mesa-glx -y !wget -q -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin With simply this: !apt install pandoc calibre

I use pandoc in a CD pipeline, the version in the repos is stale compared to upstream (normal, that's how it is) unless you're on a rolling distro like Arch.

I have reported pandoc bugs and had them fixed (great dev team), pulling the latest single-DEB install (no deps, unlike the one in the Debian repo) and using it gets all the latest updates which matter to a process like this.

In this particular case your needs to use the latest pandoc lead to the wget pull and install, which thanks to their DEB design is easy and clean to do in an ephemeral CI container.

Re: Converting Markdown to ePub or Mobi Using Pandoc

#30
post #23
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…

what would be advantages to going to Deepnote from regular Jupyter notebooks based workflow? Let's assume someone who has been working with Jupyter notebooks(mostly Python based) for a long time. Are Deepnote notebooks exportable? The big worry is that you guys decide to pivot or radically change your pricing model and there is no offramp. By comparison I don't mind using Google Colab. If Google Colab decides to shut…

Deepnote internally supports .ipynb format and you can always export the Deepnote notebook to .ipynb similarly as you'd in Colab.

In general the main selling points are live collaboration (you can work on a notebook with you team as you'd do on a google doc), and integrations (you can plug-in your snowflake db, or s3 bucket or whatever, and have it connected for any further analysis, or a long-term training, etc.

For many non-software-developer data scientists, it's also easier to work in a cloud environment compared to installing stuff locally, and to version their notebooks in Deepnote instead of git. But this really depends on the particular workflow that one has.

Post reply on HN