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

Add option to collapse preformatted blocks, configuration option to set default #174

Open
jamestomasino opened this issue Feb 25, 2021 · 3 comments
Labels
accessibility Something isn't well-suited for all users enhancement New feature or request

Comments

@jamestomasino
Copy link
Contributor

The preformatted text blocks have an alt text property following the three backticks which is designed to be a human-readable representation or indication of what is in the block. This feature gains value for blind users when our clients embrace it and allow it to be displayed instead of the wall of text common in ascii art or even code samples.

Davin Prater's post on the mailing list explains this from the POV of a blind user quite well.

As a feature request I would ask for two additions to Kristall to improve it for blind users:

  1. Allow preformatted blocks to toggle visibility, labeled with their alt-text representation or a generic fallback
  2. Allow the collapsed state to be set as the default in a configuration option
@ghost
Copy link

ghost commented Feb 27, 2021

@jamestomasino mentioned on IRC that they've not specified the generic fallback, in the case that no alt-text is given. I suggest(ed) that a simple 'missing alt-text' or 'no alt-text provided' message be used.

@mikejzx
Copy link
Contributor

mikejzx commented Feb 27, 2021

I think this feature might be possible, however the only implementation method I can think of (using the current infrastructure) is extremely hacky. (Since kristall works by literally writing to a rich text document and displaying it to the user)

My solution would be like follows: say a user has collapsible blocks enabled, Kristall would render the document similar to this (mocked up in GIMP):

image

And then when a user clicks on the KristallTextBrowser widget, send the QTextCursor to that block (using the mouse click position), delete the block, and insert a new block with the preformatted text:

image

I guess the same approach could be used to fold the uncollapsed block too

This all seems pretty dodgy but it might work.

@ikskuh
Copy link
Owner

ikskuh commented Feb 28, 2021

I think this solution isn't that bad actually. We could do that!

@ikskuh ikskuh added enhancement New feature or request accessibility Something isn't well-suited for all users labels Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Something isn't well-suited for all users enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants