Re: [gcpm] coalescing sequences of numbers for cross-references, back-of-the-book index etc

> On Dec 17, 2015, at 08:01, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> On Wed, Dec 16, 2015 at 2:42 PM, Liam R. E. Quin <liam@w3.org> wrote:
>> On Wed, 2015-12-16 at 11:18 -0800, Tab Atkins Jr. wrote:
>>> On Tue, Dec 15, 2015 at 9:51 PM, Liam R. E. Quin <liam@w3.org> wrote:
>>>> 
>>>> [..]
>> 
>>>> See http://barefootliam.blogspot.ca/2015/12/declarative-index-
>>>> proposal-
>>>> for-printing.html for the actual proposal.
>>>> 
>>> Your examples confuse me - it looks like you have all the information
>>> necessary to represent a range and collapse duplicates already,
>>> encoded in the markup.
>> 
>> Thanks for the feedback and for looking. I tried to clarify in the edit
>> I did. There are two kinds of ranges involved, and I should use a
>> different name for one of them.
>> 
>> (1) a discussion that occurs over a range of pages will typically have
>> index markers at the start and end of that range. If the two markers
>> end up on the same page (18, say), the formatter has to combine them,
>> and not put something pathetic and wrong out like,
>>    position, absolute, 18-18
>> instead of,
>>    position, absolute: 18
>> But if they are on different pages, 18-19 is correct, or 18-26 or
>> whatever.
>> 
>> So the markup can know there was a range but not how to format it.
>> 
>> (2) a sequence of individual isolated instances where something is
>> mentioned might end up as
>>    position, absolute: 12, 16, 18, 18, 18, 19, 20, 21, 36
>> and that must be formatted at run-time as
>>    position, absolute: 12, 16, 18-21, 36
>> 
>> You can't do this in the markup because you don't know the page
>> numbers.
> 
> Right, but you haven't proposed a mechanism for *finding* the page
> numbers yet.  Your blog post seems to suggest some generator that
> fills them in, so your proposal seems to operate on the DOM content.
> This seems... weird?  Why can your generator find the page numbers and
> insert them into the DOM, but not format them into attractive ranges?
> What's limiting it to solely just inserting page numbers into the DOM?

The mechanism for finding the page numbers should fall out of doing CSS layout. Until you've done layout, you have no idea which pages things are on. In this approach, a preprocessor of some kind (or maybe manual work) needs to create links between the index and the points in the text that are being referenced, but it cannot deal with the page numbering, and also therefore not either with collapsing the ranges.

Of course, we'll need to solve circular dependencies where changing the formatting of the index would change the page numbers.

 - Florian

Received on Thursday, 17 December 2015 03:43:42 UTC