Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is indexer documented anywhere? #893

Closed
jtauber opened this issue Jun 30, 2020 · 5 comments
Closed

is indexer documented anywhere? #893

jtauber opened this issue Jun 30, 2020 · 5 comments
Labels
documentation Documentation bug or improvement issue
Milestone

Comments

@jtauber
Copy link

jtauber commented Jun 30, 2020

I'm working on indexing on a project. I presume the indexer package is appropriate for this but could not find any documentation on how to use it.

@alerque
Copy link
Member

alerque commented Jun 30, 2020

No I don't think so. And personally I haven't even used it. When I needed something along those lines I baked my own. It would probably have been smarter of be to work on the indexer package instead, but...

You can see the variant I made in CaSILE's verseindex package. The use case in CaSILE is specific to Bible verse references. First the Markdown input is parsed with a BCV parser to find anything that looks like a verse reference. Those parsed references are turned into links to an online source for the verse and the generated markdown link has OSIS meta data and a pretty-formatted normalized name. When the Markdown is converted to SIL this link meta data is passed along. The verseindex package keeps track of those links as they occur and logs the page numbers similarly to how the TOC would do so for section references except that of course a single OSIS reference may appear on multiple pages. At the end of the book the resulting page OSIS/page number map is used to generate the printed index grouped by book:

image

@alerque alerque added the documentation Documentation bug or improvement issue label Jun 30, 2020
@jtauber
Copy link
Author

jtauber commented Jun 30, 2020

So if I understand your code, you've modified the href command to also call your markverse which creates the infonode (storing the label—the title property on the href if it exists otherwise the contents itself—and the osis property on the href).

The tableofverses command then does the display of the TOV at the end as show in your image above.

@alerque
Copy link
Member

alerque commented Jun 30, 2020

Yes, exactly.

One wouldn't have to use href's for this of course, I just happened to have them anyway. You can write any function to set marks and handle them the same way.

Also you probably know this, but do note that these kind of indexes currently take at least 2 rendering passes. The first pass collects the info and dumps it to a meta data file at the end of the document. That meta data will not be available until the second pass because the file doesn't exist yet. Given that the index is after the content (in this example) it could be done in memory rather than in an info file, but since the TOC takes 2+ passes anyway I wasn't concerned with optimizing that.

@jtauber
Copy link
Author

jtauber commented Jun 30, 2020

Yep, very familiar with the multiple passes from TeX :-)

@Omikhleia
Copy link
Member

The indexer package documentation was included in the SILE Manual some time ago. (If not mistaken, it was added on Jul 13, 2020 via #616, so indeed after this issue was opened.)

I tracked a few possible enhancements (kind of a wish list) for indexer in #1339.

So I guess this old documentation request ticket could be closed?

@alerque alerque added this to the v0.10.6 milestone Mar 5, 2022
@alerque alerque closed this as completed Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation bug or improvement issue
Projects
None yet
Development

No branches or pull requests

3 participants