-
Notifications
You must be signed in to change notification settings - Fork 501
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
index term fonts/special markup not supported #897
Comments
We're intentionally stripping the terms down to plain text to make it easier to sort and render. This assumption is baked deep into the handling of the index terms. If you can figure out how to make it work while preserving the formatting, feel free to submit a patch. However, to me it's not always clear what to sanitize and what to leave as is. There's a lot of nuance once you start to allow formatting. So the first step is to define what should be preserved and what should be stripped. |
Fair enough. I'm finding that this limitation isn't as big a deal as I once assumed it would be. |
Ahh. I was coming to open a ticket, but thought I should check first. Your reasoning makes sense. What if...any given index term is translated into some value object. That value object would hold two values, the original and the sanitized version. That sanitized version could simply be a function, making that property virtual. Use one to perform all sorting and collating, but then grab the original format when it's time to drop it in place. If people want to go all meta and embed crazy macros, etc., then that is on them. But most features, like literal, bold, or italics, should be easy to carry through. To not be a 100% spoon fed contributor, if you pointed me in the direction of the index gathering/rendering code, I may take a look at fashioning a patch. WDYT @mojavelinux? |
Thanks for giving me that idea, @gregturn! That turns out to be exactly what I needed to do. In fact, it has made the code easier to implement because we actually want the parsed version of the text instead of the sanitized version. Why? Because the parsed version gives us the sanitized version too. So it's perfect. I submitted PR #2238 to implement this enhancement. |
I am generating an index for documentation, and some of my terms are programming symbols (such as macros). In my main document I mark these up with literals, but the markup does not carry over to the index itself, where these symbols are represented using the normal body font.
I'd like these to be marked up with the monospace/literal font that I use everywhere else, if possible, when in the index.
The text was updated successfully, but these errors were encountered: