]> git.deb.at Git - debienna.git/blob - LefantFotoHack/index.mdwn
initial import from moinmoin
[debienna.git] / LefantFotoHack / index.mdwn
1 {{{\r
2 #!/usr/bin/scsh -s\r
3 !#\r
4 \r
5 (define r-s regexp-substitute/global)\r
6 \r
7 ;;; to be executed in a directory with dirindex.html\r
8 ;;; will echo moin markup to stdout\r
9 (display\r
10  (let ((file-contents\r
11         (call-with-input-file "dirindex.html"\r
12           (lambda (in) \r
13             (read-string (file-size "dirindex.html") in))))\r
14        (curdir\r
15         (r-s #f\r
16              (rx (: "public_html/fotos/"\r
17                     (submatch (: (= 4 numeric)\r
18                                  "/debianistas/"\r
19                                  (= 4 numeric) "_"\r
20                                  (= 2 numeric) "_"\r
21                                  (= 2 numeric)))))\r
22              (run/string (pwd))\r
23              1 "/")))\r
24    (r-s #f\r
25         (rx (: "<a href=\""\r
26                (submatch (: "cimg" (= 4 numeric) ".html"))\r
27                "\">"\r
28                #\newline\r
29                "<img src=\""\r
30                (submatch (: "cimg" (= 4 numeric) "--thumb.jpg"))\r
31                "\" width="))\r
32         file-contents\r
33         'pre 'post\r
34         "[http://fotos.lefant.net/" curdir 1\r
35         " http://fotos.lefant.net/" curdir 2 "]\n")))\r
36 \r
37 (newline)\r
38 }}}\r
39 \r
40 ----\r
41 CategoryCodeSnippets