I've written a book using org-mode and I'm trying to export as an HTML/website, similar to this example. That was written using R and Bookdown, but since it all ends up as CSS/HTML, I don't see why the same thing can't be replicated with org-mode.
I've been trying to use org-publish
to do this, but I'm running into a few of issues.
1. I can't seem to replicate the book structure of the above example -- it all comes out as one single long HTML file. I'm using separate files for each chapter, and then a main.org
file where each chapter is included via #+INCLUDE
statements. What is the best way to achieve this? In other words, I want a front page with a TOC, and then each chapter to be a separate page and to have previous and next links for navigation.
2. I've been using the org-ref
package to cross-reference figures/tables/sections in the book, but it doesn't seem to work across multiple files. E.g. if I am in chapter 4 and I want to reference something in chapter 2 (using the label:
and ref:
keywords respectively), org-ref
doesn't seem to recognize it. Any way around this?
3. I suppose I could do it manually: publish each chapter separately as a HTML file and have each chapter include file links to the previous and next chapters. But this would be tedious and hard to edit afterwards. Essentially I'm looking to automate the whole process.
Any help is appreciated. Is this easily doable with org-mode, or should I just bite the bullet and learn R and Bookdown?