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

Alt-Text from draw.io document text #48

Open
DennyWebb opened this issue Jul 26, 2023 · 4 comments
Open

Alt-Text from draw.io document text #48

DennyWebb opened this issue Jul 26, 2023 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@DennyWebb
Copy link

Feature consideration/request:
Parse the draw.io document for all text, then embed that text as the alt text of the image so that searches/search engines can parse it and make image contents searchable.

@LukeCarrier LukeCarrier added help wanted Extra attention is needed enhancement New feature or request labels Feb 16, 2024
@LukeCarrier
Copy link
Owner

Hi @DennyWebb, thanks for the suggestion. Whilst I appreciate this was some time ago, is there any chance you'd be able to provide some example source diagrams containing the alternate text and what you'd expect the summary to be?

My understanding is that it's generally better to limit alt attribute text to ~150 characters, as it could otherwise be a hassle to users of screen readers. I would imagine we'd be better off using HTML <figure> and <figcaption> for that purpose.

Some possibly helpful context:

  • Diagrams.net supports adding tooltips to elements, but not the root.
  • You can apply arbitrary data (in key-value pairs) to both the root and to elements. If you use this, below the root element of the diagram the object will have an alt="blah" attribute.
  • There's also a text plugin that exposes an Extras -> Extract Text... menu item.

@LukeCarrier LukeCarrier added the question Further information is requested label Mar 8, 2024
@DennyWebb
Copy link
Author

Sure! Sort of... without giving away anything sensitive, imagine a draw IO that's one network diagram out of a dozen or so different ones across a large organization... so servernames, workstation names, switch names, etc all over the place in the draw file. Then, I have a report of a machine acting up, I can quickly go and search to find the draw image without having to dig to figure out which department that machine is hosted in.

Granted, this can also be solved by better naming conventions/etc to make these things more obvious... but... people are people.

For a more specific example: In my specific case it was actually a function name from an error log, and trying to find which application that function existed in. There were some issues with the logging so we weren't getting a complete picture.

The figcaption is a great suggestion. Really it wouldn't even have to be on the image itself though, just at the page level as something that would make the site search identify that page as containing the content, regardless on if it's actually displayed.

@LukeCarrier
Copy link
Owner

Since the primary concern here is making the text from diagrams searchable, I think the path of least resistance is #40, where we'll make it possible to inline the contents of an exported SVG rather than embedding it as an <object>/<img>.

@LukeCarrier
Copy link
Owner

Closed #40 in favour of #56, which should land in v0.9.0. Unfortunately it doesn't look as though the search indexer recurses into <svg> elements to find the text, so I need to troubleshoot this a little further.

I'm going to keep this out of the next release for now, but will try to get back around to it soon. I suspect this might need some changes to MkDocs itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants