free software resistance
the cost of computing freedom is eternal vigilance
### mlsd-verify
*originally posted:* feb 2022
*updated:* jan 2024
since i created the mlsd ive wanted to make a program to verify its contents are in order:
```
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "mlsd-verify 0.1, feb 2022"
p = arrstdin
now = "\ntotal lines: " | prints
plen = p | len | print
itemcount = 0
itemlinecount = 0
itemname = ""
previtem = ""
forin each p
eleft2 = each | left 2
eleft3 = each | left 3
eleft4 = each | left 4
ifequal eleft3 "=> "
ifless itemlinecount 1
now = "" | print | print
now = "item name needed? " | plus each | print
next
next
ifequal eleft2 "# "
previtem = ""
next
iftrue itemcount
eachlen = each | rtrim | len
iftrue eachlen
iftrue itemlinecount
now = itemlinecount | plus 1 | swap now itemlinecount
ifequal itemlinecount 2
each2 = each
e2left3 = each2 | left 3
ifequal e2left3 "=> "
e2left3
else
now = "\nurl needed: " | plus itemname | print
next
next
ifequal itemlinecount 3
each3 = each
e3left6 = each3 | left 6
ifequal e3left6 "notes:"
e3left6
else
now = "\nnotes needed? " | plus itemname | print
next
next
ifequal itemlinecount 4
each4 = each
e4left3 = each4 | left 3
ifequal e4left3 "```"
e4left3
else
now = "\nopen ``` needed: " | plus itemname | print
next
next
ifequal itemlinecount 5
each5 = each
e5left5 = each5 | left 5
ifequal e5left5 "tags:"
e5left5
else
now = "\ntags needed? " | plus itemname | print
next
next
ifequal itemlinecount 6
each6 = each
e6left3 = each6 | left 3
ifequal e6left3 "```"
e6left3
else
now = "\nclosing ``` needed: " | plus itemname | print
next
next
next
else
ifless itemlinecount 6
iftrue itemlinecount
now = "\nlow" | print
now = itemname | print
now = itemlinecount | print | "" | print
next
next
ifmore itemlinecount 6
iftrue itemlinecount
now = "\nhigh" | print
now = itemname | print
now = itemlinecount | print | "" | print
next
next
itemlinecount = 0
next
next
ifequal eleft4 "### "
itemname = each
now = itemcount | plus 1 | swap now itemcount
itemlinecount = 1
ifmore previtem ""
ifmore previtem itemname
now = "\nnot in order:" | print
now = previtem | print
now = itemname | print
next
next
previtem = itemname
next
next
now = "\nitemcount: " | prints
now = itemcount | print
```
this program will notify you about entries that may need:
* an entry name
* a url
* a line that says "notes:"
* a line that says "tags:"
* opening and closing ``` around the tags: line
it will also tell you if an entry is out of alphabetical order.
```
cat mlsd-z.html | ./mlsd-verify.fig.py
```
license: 0-clause bsd
```
# 2018, 2019, 2020, 2021, 2022, 2023, 2024
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
```
=> https://freesoftwareresistance.neocities.org