diff --git a/html/thoughts/meta b/html/thoughts/meta index 5bda57d..b1fddba 100644 --- a/html/thoughts/meta +++ b/html/thoughts/meta @@ -3,7 +3,7 @@

it is annoyed by this medium


this medium presents thoughts in a 1 dimensional manor without an ergonomic way to link between different posts. -this annoys it because it generally tend to think of information such that each concept is a node and each relationship between concepts is an edge between those nodes on a two dimensional graph. +this annoys it because it generally tends to think of information such that each concept is a node and each relationship between concepts is an edge between those nodes on a two dimensional graph. the format of this webpage does not allow for such structure due to the linearity.
perhaps a "digital garden" or similar system would be a better means of managing this page. diff --git a/html/thoughts/meta-2 b/html/thoughts/meta-2 new file mode 100644 index 0000000..cb2ac8d --- /dev/null +++ b/html/thoughts/meta-2 @@ -0,0 +1,44 @@ + + +natalie has created an alternative means of viewing thoughts. $[make-footnote "$(make-link '/html/view-thought.html' 'find it here')"] +this new method improves upon its complaint regarding linearity in the last metapost by creating a system by which each post can be viewed as its own page. +this in theory adds for ergonomic linking between posts, though doing so would somewhat deprecate the prior means of viewing them in favor of the new means. +it is not sure how to feel about this. +$[put-footnotes] +
+its new means of thought viewing relies on some absolutely cursed code, it is very amused by this. +
+(defun html ()
+  (page "$[echo '$'][test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' && echo '{thought}' || echo thoughts index]"
+        `(section ()
+                  "$[echo '$'][echo > /tmp/footnote_count]"
+                  (h1 (:style "display: $[echo '$'][test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' && echo block || echo none]") "$[echo '$'][cat ./html/thoughts/$(basename '{thought}') | grep '<!-- TITLE:' | sed 's/<!-- TITLE://; s/-->//']")
+                  "$[echo '$'][cat ./html/thoughts/$(basename '{thought}') | grep '<!-- DATE:' | sed 's/<!-- DATE://; s/-->//']" (br)
+                  (div () "$[echo '$'][include \"./html/thoughts/$(basename '{thought}')\"]")
+                  "$[echo '$'][test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' || (echo '<h1>thoughts:</h1>'; ls ./html/thoughts | while read -r file; do echo \"<p>$(cat ./html/thoughts/$file | grep '<!-- DATE:' | sed 's/<!-- DATE://; s/-->//') <a href=?thought=$file>$(cat ./html/thoughts/$file | grep '<!-- TITLE:' | sed 's/<!-- TITLE://; s/-->//')</a></p>\"; done | sort --numeric --reverse)]")))
+
+
+
+ + this compiles to the following: + +

+    $[cat ./html/view-thought.html]
+  
+
+a particularly amusing bit of this is
+  "$[echo '$'][test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' 
+
+the reason the presence of the thought being set via the url parameter is checked like that is because comparing '{thought}' to '{thought}' would always be true. +when an html file contains a variable that the server does not have present when parsing the file, the variable is left as it is instead of being set to ''. +accordingly, we cannot do something like test -z '{thought}'. +

+one may think "natalie, is it not dangerous to run bash on user input supplied via url param? could one not send a request like the following:
https://natalieee.net/html/view-thought.html?thought=python-goto%27;while%20true;%20do%20echo%20foo%20%3E%3E%20aoeu;%20done;%27
" +the answer to such a thought is "yes, this is bad". +this badness should(?) be mitigated by the fact that it is impossible to get the server to process a ' in the request params. this hopefully makes RCE impossible, if not email it, please. +
+another interesting feature of this new format is that it would allow for reasonable per-post comments. +this seems like it would be a good feature. +of course, no one actually reads these, but whatever. +per post comments would still be interesting, it could continue its tradition of refusing to use a database for absolutely no reason. +per post comments would also make the view-thought.html file even more cursed, which is amusing to it.