Security, Jabber, DNS, Visual Indend Script

Rest of post about Visual Indended

One vision impaired friend was very frustrated with white space in files. I said, ok, I can ask Bing AI to generate a helper script for you:

Write a Bash and Python scripts which fill following requirements:
The filename is specified as command line parameter, like: visindend my-config.yaml
Check, if the filename exists with the same name plus .visinded extension and the file last modified timestamp is newer than the specified files. If it is, then do the process in reverse.
Read the file line by line and do following processing steps for each of the lines:
Replaces the number of spaces at the beginning of row with indicator '#>', without the single quotes, where # is number of spaces.
If the row starts with tabs use '<' instead of the '>' which was used for spaces.
Write the resulting data out, overwriting the older file or by creating a new file in case where the file doesn't already exist

Input like:

stuff:

  - indended

    - deeper

then becomes...

stuff:

2>- indended

4>- deeper

and so on. And if you edit the visinded extension file and just rerun the script, then it updates the original file with your changes.

This is especially useful for people whom are using some kind of accessibility feature which doesn't handle white space nicely. And especially with files which require usage of the white space in a very specific way like Python and YAML. Even if the task was simple to accomplish, and AI made it mostly automatically it's sad how many editors do not inherently have features like this, making it much clearer how much something is indended.

2024-08-25