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

index term fonts/special markup not supported #897

Closed
gdamore opened this issue Mar 13, 2018 · 4 comments
Closed

index term fonts/special markup not supported #897

gdamore opened this issue Mar 13, 2018 · 4 comments
Assignees
Milestone

Comments

@gdamore
Copy link

gdamore commented Mar 13, 2018

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.

@mojavelinux
Copy link
Member

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.

@gdamore
Copy link
Author

gdamore commented Nov 25, 2018

Fair enough. I'm finding that this limitation isn't as big a deal as I once assumed it would be.

@gregturn
Copy link
Contributor

gregturn commented May 3, 2020

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?

@graphitefriction graphitefriction added this to the v2.1.x milestone May 16, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
@mojavelinux
Copy link
Member

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.

@mojavelinux mojavelinux self-assigned this Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants