Mired in code
Check-in [67fe0b4864]
Not logged in
Public Repositories
mwm's Repositories

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor tweaks to deal with last minute changes.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:67fe0b4864373bf7783cc0e368568224c503f2aa
User & Date: mwm@mired.org 2010-02-14 08:06:33
Context
2010-02-15
02:34
make test.clj work from the command line; add symlinks for that as well. check-in: 18d8e83b40 user: mwm@mired.org tags: trunk
2010-02-14
08:06
Minor tweaks to deal with last minute changes. check-in: 67fe0b4864 user: mwm@mired.org tags: trunk
2010-02-13
23:15
Initial version of the zfs backup script. check-in: d98a5c8151 user: mwm@mired.org tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bitchin/html.clj.

19
20
21
22
23
24
25




26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	       (str "<" ~name# (make-attrib-strings attribs#)
		    (if (nil? args#)
		      " />"
		      (format ">%s%s%s</%s>"
			      ~sep (str-join ~sep args#) ~sep ~name#)))
	       (apply ~name (concat [{} attribs#] args#))))))))





(defn- make-attrib-strings [attrs]
  (apply str (map #(format " %s=%s" (if (keyword? %) (name %) %)
			   (quoted-attribute (attrs %)))
		  (keys attr)))
			   

(defn quoted-attribute [input]
  (format "\"%s\"" 
	  (apply str (replace {\& "&amp;", \" "&quot;", \> "&gt;"} (str input)))))

;; The standard html tags with newlines between element in the contents
(make-tags "\n" html head meta_ base link script style body div dl ol ul li table 
	   tr colgroup col thead tbody tfoot form select input)

;; And now the same, with nothing between elements in the contents.
(make-tags "" title h1 h2 h3 h4 h5 h6 p pre address blockquote hr dd dt th td
	   caption option label textarea button a b i big small strong em q
	   tt a cite dfn abbr acronym code samp kbd var sub del ins font span img
	   br map_ area object param embed noembed)







>
>
>
>



|


<
<
<
<









19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35




36
37
38
39
40
41
42
43
44
	       (str "<" ~name# (make-attrib-strings attribs#)
		    (if (nil? args#)
		      " />"
		      (format ">%s%s%s</%s>"
			      ~sep (str-join ~sep args#) ~sep ~name#)))
	       (apply ~name (concat [{} attribs#] args#))))))))

(defn quoted-attribute [input]
  (format "\"%s\"" 
	  (apply str (replace {\& "&amp;", \" "&quot;", \> "&gt;"} (str input)))))

(defn- make-attrib-strings [attrs]
  (apply str (map #(format " %s=%s" (if (keyword? %) (name %) %)
			   (quoted-attribute (attrs %)))
		  (keys attrs))))
			   





;; The standard html tags with newlines between element in the contents
(make-tags "\n" html head meta_ base link script style body div dl ol ul li table 
	   tr colgroup col thead tbody tfoot form select input)

;; And now the same, with nothing between elements in the contents.
(make-tags "" title h1 h2 h3 h4 h5 h6 p pre address blockquote hr dd dt th td
	   caption option label textarea button a b i big small strong em q
	   tt a cite dfn abbr acronym code samp kbd var sub del ins font span img
	   br map_ area object param embed noembed)