from Hacker News

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

by apineda on 5/17/24, 4:00 PM with 23 comments

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.
  • by paeselhz on 5/17/24, 5:28 PM

    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/

  • by asicsp on 5/18/24, 2:43 AM

    I use pandoc to convert markdown to pdf+epub (https://learnbyexample.github.io/customizing-pandoc/). For web version, I use mdbook (https://github.com/rust-lang/mdBook) mainly because it comes with user choosable themes and search by default.

    However, if I had to start from scratch, I'd probably look at Quarto (https://quarto.org/) or Mau (https://project-mau.github.io/index.html)

  • by nick238 on 5/17/24, 7:23 PM

    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.
  • by hoofhearted on 5/17/24, 6:26 PM

    Hey I’ve been working on a little hobby project for easily creating markdown based websites and blogs, using TipTap for the content editor and Git as the storage mechanism.

    I’d love to hear what you think!

    https://github.com/elegantframework/elegant-cli

  • by abdullahkhalids on 5/17/24, 6:36 PM

    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/

  • by i_don_t_know on 5/17/24, 5:03 PM

    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.

  • by lioeters on 5/17/24, 9:22 PM

    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

  • by avikalp on 5/19/24, 11:15 AM

    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.

  • by brycelarkin on 5/17/24, 10:43 PM

    I just used a Vercel template. Literally took 10 minutes from cloning the repo to getting it set up on my domain.
  • by sixhobbits on 5/18/24, 12:35 AM

    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).

  • by scriptstar on 5/18/24, 7:44 PM

    I used 11ty (eleventy) for my static site blog. (Data Is A Dope)[https://DataIsAdope.com]
  • by JoeAltmaier on 5/17/24, 4:25 PM

    Scrivener is an editor that can compile a book to multiple formats.
  • by cut3 on 5/18/24, 2:21 AM

    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.
  • by AstroJetson on 5/18/24, 2:14 AM

    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.
  • by billconan on 5/17/24, 4:41 PM

    I use pandoc for the ebook generation. for the website, I tend to write my own generator.
  • by stillpoint on 5/17/24, 10:15 PM

  • by mtsolitary on 5/17/24, 8:12 PM

    Hugo works very nicely.
  • by brudgers on 5/17/24, 6:06 PM

    A typewriter?

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

    Good luck.