summaryrefslogtreecommitdiff
path: root/TODO.org
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-12-06 07:57:50 -0500
committerDavid Thompson <dthompson2@worcester.edu>2022-12-06 07:59:12 -0500
commit3b978e16abe6c1e216777f64800083b47723e714 (patch)
treed3f6d337455fe5db651b2a7c93e3414dee1e4b46 /TODO.org
parentbf5b852d93e8c7a07736a171d5539424a6600b91 (diff)
Add TODO.org.
Diffstat (limited to 'TODO.org')
-rw-r--r--TODO.org46
1 files changed, 46 insertions, 0 deletions
diff --git a/TODO.org b/TODO.org
new file mode 100644
index 0000000..8e36b2f
--- /dev/null
+++ b/TODO.org
@@ -0,0 +1,46 @@
+* TODO
+** Allow collection pages to live in a different directory than posts.
+** Feature request: Auto-reload pages when --watch detects changes
+** External command processing
+Hacky experimentation:
+#+BEGIN_SRC scheme
+ (use-modules (ice-9 match))
+
+ (call-with-output-file "bloop.txt"
+ (lambda (port)
+ (match (primitive-fork)
+ (0
+ (close 1)
+ (dup2 (fileno port) 1)
+ (execlp "grep" "-e" "cat" "animals"))
+ (pid
+ (waitpid pid)))))
+
+ (define (gcc c-file o-file)
+ (list "gcc" "-o" o-file c-file))
+
+ (define (external-artifact source destination command)
+ (unless (file-exists? source)
+ (error "input file does not exist" source))
+ (make-artifact destination
+ (lambda (output)
+ (let ((command* (append command (list source))))
+ (format #t "run '~a' → '~a'~%"
+ (string-join command* " ")
+ destination)
+ (call-with-output-file output
+ (lambda (port)
+ ;; Run the command in a new process with
+ ;; stdout redirected into the output file.
+ (match (primitive-fork)
+ (0
+ (close 1)
+ (dup2 (fileno port) 1)
+ (apply execlp command*))
+ (pid
+ (match (waitpid pid)
+ ((_ . status)
+ (unless (zero? (status:exit-val status))
+ (error "command failed" command*))))))))))))
+
+#+END_SRC