magicbookproject / magicbook

The magic book project returns!
MIT License
1.07k stars 59 forks source link

Index terms markup #3

Closed shiffman closed 8 years ago

shiffman commented 8 years ago

There is probably a larger discussion to have, but I've found that the ASCIIDOC to HTMLBook conversion for NOC resulted in the following:

<p><a data-primary="random walks" data-type="indexterm">&nbsp;</a></p>

<p>CONTENT</p>

This markup leaves blank paragraphs and extra spacing in the book. I could do a global replace like:

<a data-primary="random walks" data-type="indexterm"></a>

<p>CONTENT</p>

But then these index terms are floating. What is the proper markup? Do I need them to just be moved and embedded into actual paragraphs?

<p><a data-primary="random walks" data-type="indexterm"></a> CONTENT</p>

Is the &nbsp; necessary?

See: https://github.com/shiffman/The-Nature-of-Code/blob/master/chapters/00_7_intro.html#L17

runemadsen commented 8 years ago

Yeah, this is probably a result of the asciidoc conversion. In a perfect world, they would all look like this:

<p>This is some text about tigers<a data-type="indexterm" data-primary="Tiger" />. 
They are very dangerous.</p>

But given that the indexterm simply indicates a target for the back-of-the-book index, it won't make much of a difference whether it's exactly next to the word or not. But you should probably remove the empty paragraph, as it will give extra space in your book.