(www-display-object-desc): Add code for genre `hng-card' to display
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 8 Jun 2016 13:51:31 +0000 (22:51 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 8 Jun 2016 13:51:31 +0000 (22:51 +0900)
image of HNG-card.

cwiki-view.el

index b0c1454..3ce51b5 100644 (file)
@@ -224,6 +224,19 @@ li { margin: 0 0 0 2em; }
           (format "<img alt=\"%s\" src=\"%s\" />"
                   ret ret)))
        )
+       ((and (eq genre 'hng-card)
+            (setq ret (concord-object-get object '=hng-card))
+            (setq ret (symbol-name ret))
+            (string-match "\\([0-9]+\\)-\\([0-9]+\\)" ret))
+       (princ
+        (format
+         "<img alt=\"HNG-card:%s\"
+src=\"http://hng.chise.org/images/HNG/%03d/cards/%04d.jpg\"
+style=\"height: 480px;\" />"
+         ret
+         (string-to-int (match-string 1 ret))
+         (string-to-int (match-string 2 ret))))
+       )
        (t
        (setq ret (www-format-encode-string
                   (est-format-object object 'readable)))