Live data from Hacker News

MdBook – A command line tool to create books with Markdown

rust-lang.github.io

61–70 of 123 posts

Re: MdBook – A command line tool to create books with Markdown

#61
I wrote KeenWrite, a free and open-source cross-platform tool, to create Markdown-based books. KeenWrite calls out to ConTeXt to typeset the documents and uses my KeenType fork for typesetting math while in preview mode. KeenWrite can generate PDF files from the command-line.

* https://github.com/DaveJarvis/keenwrite

For example:

    java -jar keenwrite.jar \
      --all \
      --r-dir=$PWD/bin \
      --r-script=$PWD/bin/editor.R \
      --image-dir=$PWD/images \
      --variables=$PWD/variables.yaml \
      --theme-dir=$HOME/dev/java/keenwrite/themes/boschet \
      --metadata=title={{book.title}} \
      --metadata=byline={{book.author.byline}} \
      --metadata=keywords={{book.keywords}} \
      --metadata=copyright={{book.copyright}} \
      --metadata="reviewer=$1 $2, $3" \
      --chapters="-14" \
      --input="$PWD/chapter/01.Rmd" \
      --output="${TEMP_NAME}"
That mouthful compiles the book that I'm writing. The book defines numerous variables that are referenced throughout the prose and defined in an external file. Variables can also be passed in as metadata, which tells ConTeXt various PDF properties to embed. The chapters argument allows selecting a subset of chapters to build (e.g., 1-3,5,9-15,22). Lastly, the theme directory points ConTeXt to the instructions to use when typesetting the document, which controls colours, fonts, layout, annotations, etc.

Some sample outputs:

* https://github.com/DaveJarvis/keenwrite-themes/tree/main/exa...

Re: MdBook – A command line tool to create books with Markdown

#62

I’ve tried MdBook, Jekyll, and MkDocs. MdBook is slick for basic projects, but I felt it was too minimalistic for me. When I dug into the source for the MdBook sites that I liked, I saw that they had extended MdBook with some custom Rust code. My recommendations are: - MkDocs: Good default choice, reasonably flexible. - Jekyll: For people who want a little more flexibility—things like landing pages, blogs, etc. - Ant…

For science and statistics, I think Quarto is excellent: https://quarto.org

Re: MdBook – A command line tool to create books with Markdown

#63
So far, in this thread (in no particular order):

- [Jekyll](https://jekyllrb.com/)

- [Hugo Book](https://github.com/alex-shpak/hugo-book)

- [MdBook](https://rust-lang.github.io/mdBook/)

- [MkDocs](https://www.mkdocs.org/)

- [MkDocs Material](https://squidfunk.github.io/mkdocs-material/)

- [GitBook](https://www.gitbook.com/)

- [Antora](https://antora.org/)

- [Docusaurus](https://docusaurus.io/)

- [Nextra](https://nextra.site/)

- [Astro](https://astro.build/)

- [Starlight](https://starlight.astro.build/)

- [Clowncar](https://github.com/secretGeek/clowncar)

- [Keenwrite](https://github.com/DaveJarvis/keenwrite)

- [Quarto](https://quarto.org/)

- [Honkit](https://github.com/honkit/honkit)

- [JupyterBook](https://jupyterbook.org/)

Re: MdBook – A command line tool to create books with Markdown

#64
post #51

I haven't seen the newcomer Starlight[1] being mentioned, so just throwing that out there as well. It's by the wonderful folks who created Astro[2] and my own limited usage of it has been great! [1]: https://starlight.astro.build/ [2]: https://astro.build/

My friend introduced me to Astro the otherday. I have a few Gatsby projects under my belt but I could never really get into it, Astra looks fantastic compared to it

Re: MdBook – A command line tool to create books with Markdown

#65
I just wonder why Markdown (or whatever alike, I know there are alternatives superior in numerous ways) is not the default format for books, documents and everything. Some years ago I switched to Typora and discovered I hardly ever need Word/Writer for anything I write and I only use it to open documents others would send me. 90% of books I read don't look like having a serious reason for not being in the Markdown format either. I understand there is typesetting one has to do to print a nice-looking paper book but the majority of the text read on a computer/smartphone or printed from MS/Libre Office lacks this job done anyway.

Re: MdBook – A command line tool to create books with Markdown

#66
post #47

I used to do this with GitBook, but it has not seem active development for some time. Wonder how easy it would be to move from GitBook to an Obsidian workflow with mdbook. The links are written like a wiki as [[]]. Would this tool understand?

Found: https://github.com/zoni/obsidian-export but hope this can be part of a single solution.

Re: MdBook – A command line tool to create books with Markdown

#67
post #63

So far, in this thread (in no particular order): - [Jekyll]( https://jekyllrb.com/ ) - [Hugo Book]( https://github.com/alex-shpak/hugo-book ) - [MdBook]( https://rust-lang.github.io/mdBook/ ) - [MkDocs]( https://www.mkdocs.org/ ) - [MkDocs Material]( https://squidfunk.github.io/mkdocs-material/ ) - [GitBook]( https://www.gitbook.com/ ) - [Antora]( https://antora.org/ ) - [Docusaurus]( https://docusaurus.io/ ) - [Next…

Also, https://jupyterbook.org/en/stable/

(nb) I collaborate on Jupyter Book

Re: MdBook – A command line tool to create books with Markdown

#69
post #44

IIRC, this platform uses CDN-hosted libraries rather than bundling/vendoring. As a result, users are exposed to not just outages of the CDNs but also the data collected by these servers. That’s a bummer. …but it’s not the only bummer. The usage of Highlight.js + MathJax on the front-end is horribly wasteful. Why? It demands all clients parse & render the syntax/LaTeX which is not only taxing on CPUs and batteries, bu…

Interesting enough there seems to be an open PR for that: https://github.com/rust-lang/mdBook/pull/1918

Re: MdBook – A command line tool to create books with Markdown

#70

I just wonder why Markdown (or whatever alike, I know there are alternatives superior in numerous ways) is not the default format for books, documents and everything. Some years ago I switched to Typora and discovered I hardly ever need Word/Writer for anything I write and I only use it to open documents others would send me. 90% of books I read don't look like having a serious reason for not being in the Markdown fo…

That looks like a great tool!

I write a lot of documentation as part of my job and having Markdown side by side with the rendered output is great. Once you get the hang of the syntax, markdown is so much faster to write than using any text editor like Word. Just writing a list in text editors is painful.

Post reply on HN