Live data from Hacker News

Writing a Book with Pandoc, Make, and Vim

keleshev.com

21–30 of 61 posts

Re: Writing a Book with Pandoc, Make, and Vim

#22
Thanks for sharing this work flow and also for writing this book! I sometimes think I would like to write a book about microcontroller basics (which I've collected knowledge from countless blogs and white papers) but I know it's a huge project!

Also it is cool that you can run draw.io yourself! I've used yed for documentation but this looks nice and is capable.

Re: Writing a Book with Pandoc, Make, and Vim

#23
I’m always interested in reading articles like this, as I like to see the setups that people come up with to produce books and documents. I didn’t know about set virtualedit=all in vim!

If you learn how to extend Pandoc with your own filters, which you can write in several languages, there is no limit to what you can do. Here’s the description, published in the sadly defunct Linux Journal, of the system I created to help me write a book about gnuplot:

https://lee-phillips.org/panflute-gnuplot/

Re: Writing a Book with Pandoc, Make, and Vim

#24
post #17
post #14

I was building a new API recently, and was looking for a good documentation solution. The commercial cloud based solutions (Gitlab, Confluence, et al) are pretty good, but you have to keep paying or your documentation disappears. Self hosted Wiki or documentation solutions were also out, due to the pain of migrating content in and out. We ended up with a very simple solution of Markdown + CSS + Pandoc + make. Pandoc…

Excuse me if this is a dumb question but did you consider swagger?

There are no dumb questions.

I did have a look at swagger, but it felt way to bloated and complex for what we wanted. With Markdown we know that even in 10 years time when services like swagger are long gone, it'll be possible to view markdown files. Also, there is barely any learning curve with Markdown.

Re: Writing a Book with Pandoc, Make, and Vim

#26

It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0…

This is a very interesting (open source) project that I didn’t know about; thank you for mentioning it. But it doesn’t replace LaTeX, as it doesn’t produce the same results. A glance at the sample documents reveals the ugly typography resulting from the word-processing layout strategy employed in web browsers. This is confirmed in the documentation. So this could be useful if you have an existing set of HTML pages th…

It looks nice for graphics-heavy documents, but the quality of the typographical output doesn't come close to LaTeX with microtype. I do wish that LaTeX had something similar to CSS, however. The separation of markup and styling makes the web easier to use for complex layouts, which are not generally TeX's strong suit.

Re: Writing a Book with Pandoc, Make, and Vim

#27

It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0…

Skimming the examples the typographical quality is that of a webpage (which is to be expected), miles below TeX-quality typesetting.

Re: Writing a Book with Pandoc, Make, and Vim

#28
post #27

It's even possible to replace (Xe)LaTeX with weasy¹, a Python HTML-to-PDF converter. It supports two-colums via CSS, automatic CSS hypens, CSS page counters and embedding SVGs. I just needed an HTML header with CSS in the markdown file. $ pandoc --filter pandoc-citeproc --csl ieee.csl --bibliography=paper.bib --smart --normalize -f markdown+multiline_tables+inline_notes -t html5 -V margin-top:0.5in -V margin-bottom:0…

Skimming the examples the typographical quality is that of a webpage (which is to be expected), miles below TeX-quality typesetting.

I think it really depends on the font you use and the CSS rules you apply. LaTeX needs tweaking, too, even with a good template.

E.g., if your font supports it, you can enable ligatures:

    text-rendering: optimizeLegibility;

Re: Writing a Book with Pandoc, Make, and Vim

#30
I use something very similar for mathematical homework and notes: MacVim, with a Makefile that runs Pandoc with the Eisvogel template.

I also have a script that runs fswatch to run make on save.

Didn't know about virtualedit, though: tables are going to be so much easier now.

Post reply on HN