swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 383 forks source link

Workaround for glossary at EPUB #550

Closed rgaiacs closed 10 years ago

rgaiacs commented 10 years ago

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 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

$ make epub