Ask HN: Best way for a Markdown based blog and eBook?

35 points by apineda ↗ HN
I'd like to write an ebook (epub, mobi) and web based book similar to what you see in many places. Anyone have a solid method, or tool recommendations to do this easily and look good? I'm thinking about using Astro for the web version.

25 comments

[ 4.4 ms ] story [ 58.7 ms ] thread
Scrivener is an editor that can compile a book to multiple formats.
I use pandoc for the ebook generation. for the website, I tend to write my own generator.
If it’s a technical book, you might like https://jupyterbook.org/

I haven’t used it myself, so I don’t know how easy it is to use. But I like some books that were written in it.

I've used Quarto[1] to build a personal blog and it has been really easy and straightforward. Especially if you want to run some code alongside the post (like Python, R, or Julia). As far as I know, you can also use it to write books and presentations.

[1]: https://quarto.org/

Quarto FTW! I uses pandoc to translate between formats, is almost effortless to use, and seems to be growing very fast.
A typewriter?

I mean writing is the most important part of writing a book.

Good luck.

Most static site generators will work to create a blog. I use pelican [1], which serves my needs.

You will likely need to edit your blogposts a little bit before putting them in the book. So I recommend a separate program for that altogether.

[1] https://getpelican.com/

(comment deleted)
If you plan on needing much in the way of cross-references (i.e. like in documentation where you're linking to other things all the time), you can use a slightly more advanced markup language like rST (reStructuredText) which is used by Sphinx (though it also supports Markdown). Sphinx docs can be output to a variety of formats, including epub, single-file HTML, PDF via LaTeX, and of course, a multi-page HTML site.
And AsciiDoc seems roughly equivalent to rST.
Hugo works very nicely.
I second Hugo. It's been my SSG of choice for a long time, and once you understand where to put things, it really lives up to its name.

The fact that it's in Go, and therefore distributed as a single binary, also makes installation and use anywhere you want it a cakewalk. YMMV on how important that is to you, but I like to keep my tools light and nomadic when possible.

I use Hugo, GitHub to store blog and Cloudflare Pages to host it. This setup is free, straightforward and configures in few clicks. You only need to pay for the domain name.
I've been curious about "Magic Book" for Markdown/HTML/PDF. (EPUB and MOBI on the roadmap.)

> The Magic Book Project is an open source project funded by New York University's Interactive Telecommunications Program. It aims to be the best free tool for creating print and digital books from a single source.

https://github.com/magicbookproject/magicbook

I learned about it because it's used for The Nature of Code 2nd Edition.

https://github.com/nature-of-code/noc-book-2

Sounded interesting, but this:

>This project is for you, if:

... (last bullet point):

>You want that command-line tool be be written in Node-only. No more XSLT.

Put me off, personally.

I just used a Vercel template. Literally took 10 minutes from cloning the repo to getting it set up on my domain.
I have tried a bunch and would love a free OSS option but honestly Leanpub is the best I have found for ebook and printing.

For web, I went

Mkdocs material (cos I like Python) to Docusaurus (because it has more features) to Astro (because wow at speed and polish).

Huge fan of markdeep. It’s easy to use has a ton of functionality. It’s been here on HN a few times with lots of positive comments.
I've been using a github repo for a book I wanted a digital version of and I love it. I really like github markdown is presented.
We have very recently integrated Strapi into our website (we haven't even added a single blog on it yet).

I wish I had asked this question here when we were doing our research. There are some great recommendations here. But I like Strapi so far. Their documentation is pretty nice. Even if their onboarding is complicated, the documentation makes it easy to execute.