Chris suggested that Autoplot show a readme.txt file when it is entered in the address bar. It is presented with completions, since the extension ".txt" is used for ascii tables. It occurred to me this is exactly what "action triggers" are used for, which match the URL against a regex and run special code when there's a match. For example, a .pngwalk extention is handed off to the png walk tool for loading.
Autoplot should recognize readme.txt, readme.md, and readme.html, ignoring case, and display these in an popup window (or the browser).
I've made it so readme.txt and readme.md are both shown in a Java popup window. It's tempting to hand off the URL to a browser, but Autoplot's handling of github URLs (hiding blob/master) when it is not used makes this non-trivial.
Note too that markdown is not rendered, just the raw text. I'm pretty sure there's a markdown renderer I have in there, or I could figure out the correct URL (inserting blob/<branch>) and hand it off to the browser.
Thanks for implementing this! Since people already have a browser and know how to operate it, they can put a link there if they want. I think there's value in keeping the workflow in-line. Looking forward to trying this out.
Would you like to support viewing .CAT files from PDS3? I presume there's not a handler for .cat yet so this tool could handle those too... maybe?
On a related note: after parsing, where does the descriptive text for variables end up inside the QDataset model?
Just got a look at the text viewer. Nice. A simple tool for a simple job.
As far as sending the output to a browser goes, maybe the button for that could be in the window that displays the text.
That way a user would have the option to open in a browser but not be required to do so.
Note that this is handled by special code which triggers based on regular expressions, so Autoplot just sees that it's a readme.txt and downloads and displays the contents. (Note this means that no data files can have the name readme.txt.)
I've also put into the regular expression
"(?i)(.*readme\\.(txt|md)(\\?ref_type=heads)?|.*errata.txt|.*voldesc.cat)"so that gitlab/github is supported somewhat here, too.https://github.com/autoplot/autoplot/commit/7e741f08d9f2510fd2574c7a571d80639a325bdb
Last edit: Jeremy Faden 2025-06-23
This was done, though readme.md is not rendered.