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
Add a script to browse mode to toggle inclusion of layout tables #7634
Add a script to browse mode to toggle inclusion of layout tables #7634
Conversation
Nice work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
source/browseMode.py
Outdated
def script_toggleIncludeLayoutTables(self,gesture): | ||
if config.conf["documentFormatting"]["includeLayoutTables"]: | ||
# Translators: The message announced when toggling the include layout tables document formatting setting. | ||
state = _("include layout tables off") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "layout tables off" or "layout tables disabled" might be more easy to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went the layout tables off route. Also fixed the translator comments in the process.
source/browseMode.py
Outdated
config.conf["documentFormatting"]["includeLayoutTables"]=True | ||
ui.message(state) | ||
# Translators: Input help mode message for include layout tables command. | ||
script_toggleIncludeLayoutTables.__doc__=_("Toggles on and off the inclusion of layout tables in browse mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need a category attribute here? I'm not familiar with this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, the category is set on the class itself, so all the scripts have the category that the class prescribes.
Link to issue number:
None
Summary of the issue:
Some tables on the web, even though they have data, are treated as layout tables as they don't follow the convention that headers are required for a table to be treated as a data table. It is currently not possible to switch inclusion of layout tables on the fly while in browse mode.
Description of how this pull request fixes the issue:
Adds an unbound script to browse mode to toggle layout tables. Even though this is a document formatting setting according to the config spec, I made this browse mode only due to the fact that from a UX perspectieve, this is a browse mode setting.
Testing performed:
Toggled this setting while in a layout table in Firefox browse mode, detection changed on the fly as expected.
Known issues with pull request:
None i'm aware of
Change log entry: