This is the last piece needed for the EPUB version of our lessons (more information at #435) that is an workaround to handle the glossary.
Problem
pandoc don't support anchors and because of it the links at our lessons to the glossary don't work.
Workaround
pandoc will split our lesson in many XHTML files that will have many parts as
This kind of interface is called a <a href="#g:cli">command-line interface</a>, or CLI, to distinguish it from the <a href="#g:gui">graphical user interface</a>, or GUI, that most people now use.
Every <a href="#g:foobar"> is a link to a entry at the glossary. We need to convert this links at <a href="chXXX.xhtml#g:foobar"> where XXX is the number of the file that contains the glossary (it can change based on our changes at our lessons).
At chXXX.xhml, every entry will be of the form
<p><strong>command-line interface</strong> (CLI): An interface based on typing commands,
but it should be
<p><strong><a name="g:cli"command-line interface</a></strong> (CLI): An interface based on typing commands,
pandoc had remove the anchor and we need to add it back.
How to hack
Download the patches at #435
Create the epub with
$ make epub
Unzip the EPUB some where. Yes, you can do it using unzip.
Write your script that will do the workaround from the previous section.
Update the XHTML at the EPUB. You can use zip to do it.
Integrate your script at epub.mk with the steps to unzip and update the EPUB.
DONE as part of #435.
This is the last piece needed for the EPUB version of our lessons (more information at #435) that is an workaround to handle the glossary.
Problem
pandoc
don't support anchors and because of it the links at our lessons to the glossary don't work.Workaround
pandoc
will split our lesson in many XHTML files that will have many parts asEvery
<a href="#g:foobar">
is a link to a entry at the glossary. We need to convert this links at<a href="chXXX.xhtml#g:foobar">
whereXXX
is the number of the file that contains the glossary (it can change based on our changes at our lessons).At
chXXX.xhml
, every entry will be of the formbut it should be
pandoc
had remove the anchor and we need to add it back.How to hack
unzip
.zip
to do it.epub.mk
with the steps to unzip and update the EPUB.