Or you can just run the target in Sphinx, and get better organized output with real table of contents and indexes - it supports a huge number of output formats: https://www.sphinx-doc.org/en/master/usage/builders/index.ht... If you must use markdown, there's always https://mystmd.org which integrates directly into Sphinx, modulo minor bits of weirdness due to markdown being a mishmash of extensions.
Show HN: Generate pdf with gitbook or mdbook url
21–30 of 45 posts
Re: Show HN: Generate pdf with gitbook or mdbook url
#22Sometimes I feel we're never going to be rid of PDFs. Everything can be converted into one, but you can't reliably convert from it. They're going to be here in 200 years.
Re: Show HN: Generate pdf with gitbook or mdbook url
#23Wrong.
Chrome/Chromium crashes due to hard coded memory limit in V8.
Firefox has no command line option for printing pdfs.
No other libraries render the pdfs correctly because they are not full-fledged web engines.
So what were my options?
1. Read/understand Chromium source, recompile to lift the memory limit.
2. Read/understand Firefox source, recompile to add a command line option.
3. Use some UI testing framework to automate pdf printing in Firefox.
Eventually I did 4, which is split the html files into smaller chunks, convert and re-combine. Of course the problem is how do you know where to split the html so that it's at the boundary of the page? The solution is to do a binary search for the number of entries to put into each chunk when the number of generated pdf pages changes. What a pain.
Re: Show HN: Generate pdf with gitbook or mdbook url
#24Like mdbook, the themes are isolated. Instead of CSS, KeenWrite themes are written in ConTeXt. There are several example starter themes.[2] A "thesis" theme would be a nice addition, but there's a problem.
Markdown lacks a standard for cross-references and citations. An open KeenWrite issue animates a possible UX solution.[3] The topic of references/citations has been discussed on CommonMark[4] without much movement. Parsing cross-references and citations would likely benefit all flexmark-java[5] integrations. KeenWrite uses flexmark-java, but I'm otherwise unaffiliated. If anyone is interested in helping, reach out (see profile).
[1]: https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/docs/cmd...
[2]: https://gitlab.com/DaveJarvis/keenwrite-themes/
[3]: https://gitlab.com/DaveJarvis/KeenWrite/-/issues/145
[4]: https://talk.commonmark.org/t/cross-references-and-citations...
Re: Show HN: Generate pdf with gitbook or mdbook url
#25Just recently I was tasked to convert some huge html pages (with lots of small entries) into a pdf file. The requirements are "fully automated solution" and "pdf must look the same as the page when viewed in a browser". Probably takes less than five minutes, right? I thought the same. Wrong. Chrome/Chromium crashes due to hard coded memory limit in V8. Firefox has no command line option for printing pdfs. No other li…
Re: Show HN: Generate pdf with gitbook or mdbook url
#26Just recently I was tasked to convert some huge html pages (with lots of small entries) into a pdf file. The requirements are "fully automated solution" and "pdf must look the same as the page when viewed in a browser". Probably takes less than five minutes, right? I thought the same. Wrong. Chrome/Chromium crashes due to hard coded memory limit in V8. Firefox has no command line option for printing pdfs. No other li…
Re: Show HN: Generate pdf with gitbook or mdbook url
#27Earlier quoted context omitted.
They have become a reliable way in office & legal processes around the world in terms of fixed layouts & content immutability (in a sort of layman view. Knowing Acrobat Pro exists & PDF editing too - but I'd argue that in majority of cases its not as trivial as modifying text file or markup sources, with intention to change or forge). Correct me if wrong but Word/LibreOffice layouts could change depending on the mach…
https://en.m.wikipedia.org/wiki/PDF/A PDF/A is made especially for archival and long term preservation
PDF resembles the state of HTML years after HTML4, it barely says what should happen in the best case.
Re: Show HN: Generate pdf with gitbook or mdbook url
#28Sometimes I feel we're never going to be rid of PDFs. Everything can be converted into one, but you can't reliably convert from it. They're going to be here in 200 years.
It doesn't evolve with the electronic device, which means you might need to zoom and pan, but it also means that it probably won't be completely bungled.
I've bought an EPUB which only works on iPad. If the screen is sized differently, or uses a different font, etc., the texts are all messed up. It simply wouldn't happen if the book was distributed via PDF.
Re: Show HN: Generate pdf with gitbook or mdbook url
#29Sometimes I feel we're never going to be rid of PDFs. Everything can be converted into one, but you can't reliably convert from it. They're going to be here in 200 years.
My favorite “workaround” for turning a pdf into html is to render the pdf with something like pdf.js; create a canvas, render contents, scale responsively, done. It works good enough for e.g. displaying book previews. Demo: https://merely.xyz/seven-photo-challenges/ (photo exercise ebook).
Re: Show HN: Generate pdf with gitbook or mdbook url
#30Just recently I was tasked to convert some huge html pages (with lots of small entries) into a pdf file. The requirements are "fully automated solution" and "pdf must look the same as the page when viewed in a browser". Probably takes less than five minutes, right? I thought the same. Wrong. Chrome/Chromium crashes due to hard coded memory limit in V8. Firefox has no command line option for printing pdfs. No other li…