parasite 0.2.1

film still from the movie flesh for frankenstein. person in a bloody white shirt standing in front of a pole with an impaled heard. diy html surgery for everyone

this is public domain sofware published by kusoge softworks inc.

download the latest release

public domain badge homo slop (no ai) badge kusoge softworks badge

usage

user@unix:~$ surgery input-file ... -t template-file [-w wrap-file] [-r] > result.html

surgery.sh converts each input-file (in the markdown-ish format defined in parasite.awk) to html and transplants them (using frankenstein.awk) into the html given by template-file (with <!-- ::FRANKENSTEIN-stitch:: --> marking the insertion location in that template-file).

The optional -w flag allows to specify a wrap-file which is another template file (executed with frankenstein.awk) but run for each individual input-file before the main transplantation takes place.

If -r or --reverse is present, the order of the input files will be reversed.

All the tools write to stdout and don't modify their input files.


limitations

written by a dumb monkey (certainly has bugs).

surgery.sh should handle spaces in filenames, but will not handle tabs or newlines.


install

user@unix:~/parasite$ chmod +x surgery.sh parasite.awk frankenstein.awk user@unix:~/parasite$ ln -s $(realpath surgery.sh) ~/.local/bin/surgery

example

consider the example files in the example directory

example/template.html <!doctype html> <html lang="en"> <head> <style> body {max-width: 80ch; min-width: 30ch; } article {padding: 1em; margin: 1rem 0; border: 1px solid gray; background: lavender; } img {display: block; margin: 1em 0; } header, footer {background: pink; padding: 1em; } </style> </head> <body> <header> <h1>say gex</h1> </header> <main> <!-- ::FRANKENSTEIN-stitch:: --> </main> <footer> <p>made with poo &lt;3</p> </footer> </body> </html> example/post-template.html <article id='::FRANKENSTEIN-number::'> <!-- ::FRANKENSTEIN-stitch:: --> <p style="text-align: right;"><em>plaintext: <a href="posts/::FRANKENSTEIN-title::">::FRANKENSTEIN-title::</a><em></p> </article> example/posts/01.md # first post this is the 1st paragraph. this is the 2nd paragraph with a [link](https://en.wikipedia.org/wiki/Cybele)! this is the 3rd paragraph. <html> will be properly escaped, no worries. --- ## a subheadline this the 4th paragraph with an image surrounded by horizontal rules (will be rendered as "<hr>" in html). ![image of a gay skeleton](https://plastikfrucht.com/img/enjoy-have-fun.gif) --- and this is the 5th paragraph. finally, the 6th and last paragraph :) example/posts/02.md # the second post <3 ## my interests ### gay sex i like gay sex. ### [surgery](https://en.wikipedia.org/wiki/Orchiectomy) i really like diy surgery ### cats i like cats. also big cats like [cheetahs](https://en.wikipedia.org/wiki/Cheetah). but also smol house cats. --- ## my skills i can convert food to poo :)

then, the command

user@unix:~/parasite/doc/example$ surgery posts/*.md -t template.html -w post-template.html > result.html

will produce the following result:

example/result.html <!doctype html> <html lang="en"> <head> <style> body {max-width: 80ch; min-width: 30ch; } article {padding: 1em; margin: 1rem 0; border: 1px solid gray; background: lavender; } img {display: block; margin: 1em 0; } header, footer {background: pink; padding: 1em; } </style> </head> <body> <header> <h1>say gex</h1> </header> <main> <article id='1'> <h1> first post </h1> <p> this is the 1st paragraph. </p> <p> this is the 2nd paragraph with a <a href='https://en.wikipedia.org/wiki/Cybele'>link</a>! </p> <p> this is the 3rd paragraph. &lt;html&gt; will be properly escaped, no worries. </p> <hr> <h2> a subheadline </h2> <p> this the 4th paragraph with an image surrounded by horizontal rules (will be rendered as &quot;&lt;hr&gt;&quot; in html). <img src='https://plastikfrucht.com/img/enjoy-have-fun.gif' alt='image of a gay skeleton'> </p> <hr> <p> and this is the 5th paragraph. </p> <p> finally, the 6th and last paragraph :) </p> <p style="text-align: right;"><em>plaintext: <a href="posts/01.md">01.md</a><em></p> </article> <article id='2'> <h1> the second post &lt;3 </h1> <h2> my interests </h2> <h3> gay sex </h3> <p> i like gay sex. </p> <h3> <a href='https://en.wikipedia.org/wiki/Orchiectomy'>surgery</a> </h3> <p> i really like diy surgery </p> <h3> cats </h3> <p> i like cats. also big cats like <a href='https://en.wikipedia.org/wiki/Cheetah'>cheetahs</a>. but also smol house cats. </p> <hr> <h2> my skills </h2> <p> i can convert food to poo :) </p> <p style="text-align: right;"><em>plaintext: <a href="posts/02.md">02.md</a><em></p> </article> </main> <footer> <p>made with poo &lt;3</p> </footer> </body> </html>

for putting the posts in reverse order instead, run with the -r flag:

user@unix:~/parasite/doc/example$ surgery posts/*.md -t template.html -w post-template.html -r > result-reversed.html