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