sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.67k stars 98 forks source link

Enhancing the indexer package #1339

Open Omikhleia opened 2 years ago

Omikhleia commented 2 years ago

Main goal: I need multiple index support for a potential project. Stretch goal: As #1194 progresses, it could be nice for the SILE manual to include an index of all mentioned settings, commands, key concepts, etc.

The indexer package is a nice start.

I however noted a few things to fix and improve, from the easiest to the more challenging. Let's track them here.

That's the simple bits. Call that "Stage 0" tasks.

Let's now go for real things....

Some things that are less important to me...

And there are the troubleshooting tasks anyway...

That's already a long list, for sure.

alerque commented 2 years ago

Main goal: I need multiple index support for a potential project.

I have skimmed your message and probably a lot of the detail points are great ideas. At first blush however I'd just like to mention that SILE already provides most of the tooling needed for indexing as many ways from Sunday as you want.

For example one of the things I added to the cabook class (the default book class in CaSILE) was a verse index that keeps track of all verse references mentioned in the text and allows appendixes to be build with links pack to pages that referenced them. This was implemented starting with a copy of SILE's tableofcontents package, but all the tooling is there.

That caveat aside, yes making it more ergonomic to add your own indexes would be a welcome improvement.

Omikhleia commented 1 year ago

SILE already provides most of the tooling needed for indexing as many ways from Sunday as you want.

I didn't daresay at the time, but it made my day laughing ;)

Omikhleia commented 1 year ago

And, as if that long list of ideas ever made any sense...

https://github.com/sile-typesetter/sile/blob/1a86520d198d7709966e1fd1bfd8dfaceda86393/packages/indexer/init.lua#L61

Language-dependent sorting? Collation? Gimme a hint.

alerque commented 1 year ago

table.sort() should just stay as the Lua default function, and as you started doing we can provide a utility function that does locale-aware sorting for typesetting specific purposes.