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
Generating an index #9
Comments
Re-upping this: is there a way to ensure that a particular page is converted to HTML last, so that all indexing information will have been collected? |
I'm not sure what's happening here, caching is always a mixed blessing I'm afraid. If all else fails, you can call There's no robust way to determine the last page to be generated -- it depends on the alphabetical ordering of the filenames which is inherently brittle. I suspect a better solution might involve calling root_node = ivy.nodes.root() This will force Ivy to build the node tree. You can then traverse the nodes and do whatever manipulations you like before any of the build or output hooks fire. |
Am I correct that the build step generates the HTML and saves it to disk? Or does build generate HTML in memory, which is written to disk later (e.g., in the exit stage)? |
The You can generate the node tree independently of the You could define your own say |
What I've come up with is:
It means shortcode-parsing each file another time (making three in total: figures, tables, and index entries), which is a performance hit, but I can consolidate that. |
Sounds good 👍 I'd never even considered that kind of use case for shortcodes. |
I've added another extension to https://github.com/gvwilson/theme to generate an index, but I believe my approach has broken caching.
i
shortcode inlib/mccole/extensions/index.py
translates index entries into links, and as a side effect, records all index keys and the files they appear in. So far, so good."exit"
event handler to to read the generated HTML back in and insert the generated index.This approach is ugly; it also seems to confuse the file cache. Is there a better approach?
The text was updated successfully, but these errors were encountered: