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

More indexing woes... #381

Open
1 task done
techauthoruk opened this issue Nov 2, 2022 · 11 comments
Open
1 task done

More indexing woes... #381

techauthoruk opened this issue Nov 2, 2022 · 11 comments
Labels
bad output rinohtype's output is not correct bug

Comments

@techauthoruk
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

PDF produced by rinohtype

With an index entry in a heading:

:index:`Safety instructions`
############################

in the table of contents, instead of the page number, I get 'XX'

image

Source files

See above. I can of course remove the index entry and place it in the body text. Not sure if this is an actual bug or a peculiarity of my installation.

Versions

rinohtype 0.5.5 (in development)
Sphinx 6.0.0b3
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35
@techauthoruk techauthoruk added bad output rinohtype's output is not correct bug labels Nov 2, 2022
@techauthoruk
Copy link
Author

Ah, this only happens in one instance. When 'XX' is displayed in the ToC, it only happens where there is link directly above the heading:

.. _Prepare:

:index:`Preparing` the |prodname| for use
#########################################

@techauthoruk
Copy link
Author

Actually, it seems any directive before the heading causes this issue, for example:

.. raw:: html
...

@brechtm is this a rinoh issue or something particular to my install?

@brechtm
Copy link
Owner

brechtm commented Nov 25, 2022

The XX basically means that rinohtype can't resolve the reference or page number. I'll need to investigate to see what's happening exactly. Thanks for the extra info!

@brechtm
Copy link
Owner

brechtm commented Dec 7, 2022

I can't reproduce this (tests-regression/sphinx/test-ref/chapter1.rst - project zip). It could also be a Sphinx bug that's already fixed (I tried with 5.3.0). If you still see this with Sphinx 5.3.0, please provide a minimal Sphinx project triggering the bug.

@techauthoruk
Copy link
Author

This occurs with Sphinx version 6.0.0b3 - I will retest with 5.3 and let you know the results

@techauthoruk
Copy link
Author

Same thing happens with Sphinx 5.3:

image

Do you want me to send my demo instance?

@brechtm
Copy link
Owner

brechtm commented Dec 7, 2022

Do you want me to send my demo instance?

Yes, please.

@techauthoruk
Copy link
Author

OK...here it is. Bear in mind this is the content I was using for the pdf rear page development, so its a bit all over the place. However, I have edited the hands.rst file to add an index entry:

.. _Prepare:

:index:`Preparing` the |prodname| for use
#########################################

test text

General health and safety
#########################

Hope this helps!

pdf-dev.zip

@brechtm
Copy link
Owner

brechtm commented Dec 7, 2022

Thanks, that helped! Turns out this only happens with index terms in section titles that are rendered out of line (BodyPageTemplate.chapter_title_flowables). For the book template (and your derivative), that means chapter titles. In some cases, it does output a page number, possibly a wrong one, and the hyperlink is broken. Not yet sure how to fix this...

@techauthoruk
Copy link
Author

Now I'm aware of the issue, it isn't a problem (I will not add an index entry to a heading where there is a directive preceding it), but if you can find a fix, that would be great (as I am bound to forget about this!)

@brechtm
Copy link
Owner

brechtm commented Jan 19, 2023

I will not add an index entry to a heading where there is a directive preceding it

To be clear: the issue isn't caused by the directive preceding it. It happens when the index role is used in a chapter title. This is because chapter titles are rendered in a different way (in the Book template, at least).

brechtm added a commit that referenced this issue Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bad output rinohtype's output is not correct bug
Projects
None yet
Development

No branches or pull requests

2 participants