free software resistance
the cost of computing freedom is eternal vigilance
### findgemorph.fig
*originally posted:* oct 2024
if cklinks.fig looks for broken links to local files, then findgemorph does the reverse; you use it this way:
find . -type f | ./findgemorph.fig.py
(you can rename findgemorph.fig.py to findgemorph.py or even findgemorph if you prefer).
there are four possible results for each file listed by the find command:
1. link found: this is a direct link
2. "fake .html" link: if you add ".html" to the filename, a link is found
3. mismatched path? link: the filename matches a link, but not the path
4. NO LINK: there are no gemtext links to the file found in the text files searched
```
p arrstdin
links "find . -type f -exec grep -H '^=>' {} + | grep -v ':=> http'" arrshell
forin each p
now each prints " " prints
mfound ""
forin eachlink links
procd "=> " plus each split procd "./" join procd "" plus " "
procdhtm procd rtrim plus ".html "
cklnk instr eachlink procd
cklnkhtm instr eachlink procdhtm
found 0
iftrue cklnk
now "| found link: " plus eachlink print
found 1
break
next
iftrue cklnkhtm
q 34 chr
now "| found " plus q plus "fake .html" plus q plus " link: " plus eachlink print
found 1
break
next
try
uneach split each "/" right 1 mid 1 1
unlink split eachlink " " mid 2 1 split unlink "/" right 1 mid 1 1
ifequal uneach unlink
mfound "| mismatched path? link: " plus eachlink
next
except
pass
next
next
ifequal found 0
iftrue mfound
now mfound print
else
now "| NO LINK" print
next
next
next
# license: 0-clause bsd
#
# 2024 mn
#
# 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.
```
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