lojban / cll

Complete Lojban Language Chunked
http://lojban.org/publications/cll/
Other
176 stars 49 forks source link

Make sure backwards-compatible anchors exist #82

Open ento opened 11 years ago

ento commented 11 years ago

Original line in the TODO file

make sure backwards-compatible anchors exist

  • Ideally, make sure they are autogenerated as part of the HTML production.

pdf: n/a html-nochunks: needs fix? html-chapters:needs fix? html-sections: needs fix? epub: n/a mobi: n/a

rlpowell commented 8 years ago

What this means is:

Old CLL html Chapter 5 Example 2.3 is:

http://www.lojban.org/publications/reference_grammar/chapter5.html#e2d3

github.io/dag-cll Chapter 5 Example 2.3 is:

https://lojban.github.io/cll/5/2/#e3

These are both terrible as they rely on the chunking behaviour selected! That is: if the file is one big chunk, neither of these methods can possibly work.

I don't know what that means in terms of our ability to generate such anchors.

Section URLs:

old: http://www.lojban.org/publications/reference_grammar/chapter5.html#s2
dag-cll: https://lojban.github.io/cll/5/2/
rlpowell commented 8 years ago

So the thing is that pre-CLLv1.1 URLs are reliably convertible to CLLv1.1 URLs, just not at the anchor level. In particular, this:

http://vrici.lojban.org/~rlpowell/media/public/cll_build/cll-xhtml-nochunks/#c5e2d3

is the equivalent of both of the example URLs above, and this:

http://vrici.lojban.org/~rlpowell/media/public/cll_build/cll-xhtml-nochunks/#c5s2

(after my latest update, which hasn't actually been pushed yet).

Notice that these conversions can easily be achieved by Apache mod_rewrite, but there is no sane/obvious way to do it at any other level.

If, for some reason, it is really important to make it so that, say, the chapter-chunked output of CLLv1.1 responds to [url]/chapter5.html#e2d3 , this could be done by:

  1. cp or mv chapter-selbri.html to chapter5.html
  2. Something like: sed -r -i 's;a id="c5e([0-9]+)d([0-9]+)">;&\n;' (untested)

I don't see baking that replacement into the build process as adding significant value, much easier to have whatever system is hosting CLLv1.1's output do it at the mod rewrite level.

rlpowell commented 8 years ago

The commentary above has been added to the repo as README-urls

rlpowell commented 8 years ago

Leaving this ticket open for reference, but not planning to do anything more on it.