-
Notifications
You must be signed in to change notification settings - Fork 5
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
Script to insert keyword links #410
base: main
Are you sure you want to change the base?
Conversation
Python script to extract a mapping from keyword names to XML URI tag names. The mapping can be saved to a file and later used to make keywords clickable. That is, to be able to click on a keyword referenced in a paragraph of text, and then jump to the page where that keyword is defined.
A mapping file for keyword name to URI
d382488
to
b4586fd
Compare
The script also needs to handle recursive |
I would be inclined not to add links here. I think if we would like to have a link then the keyword could be mentioned in the text surrounding the example input. |
Where a "keyword" appears multiple times in a KEYWORD.fodt file do we want add links to every occurrence or perhaps just the first? |
@gdfldm We could also think of the links as a special markup for the keywords. Currently, the user recognizes a keyword by being an uppercase word, but there are upper case words that are not a keyword. However, if the keyword is also displayed in in e.g. italics and in a different color, the user will more easily recognize a keyword. Here is an example for how it will look for the Note that currently the keyword itself |
To provide a consistent markup experience for the keywords, we should also link the keyword to itself
Thanks a lot. I'll review this (with my limited Python knowledge) after the others are merged. That hopefully saves time. |
Currently, the script misses keywords that are split by span tags, for example if CO2STORE occurs like this within the text |
Builds on #408 and #409 which should be merged first.
The script replaces keyword names inside
<text:p ...>
tags with links to the corresponding keyword definition page. See #408 for more information. Since there are over 1000 keywords, and since I am not very confident that it will work correctly on every file, the plan is to apply the script to some keywords at a time. For example, starting with the 168 keywords in chapter 5. After it has been applied to all keyword files, we can consider applying it to the chapters and appendices also.