(www-display-object-desc): Add link for HNG-card for HNG
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 4 May 2016 13:12:00 +0000 (22:12 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 4 May 2016 13:12:00 +0000 (22:12 +0900)
representative glyph-images.

cwiki-view.el

index d8b79f3..2164d60 100644 (file)
@@ -66,7 +66,7 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
        without-header
        logical-feature chise-wiki-displayed-features
        parents
-       GlyphWiki-id ret object-spec)
+       GlyphWiki-id HNG-card ret object-spec)
     (if (eq level 0)
        (setq level 1
              without-header nil)
@@ -160,6 +160,11 @@ li { margin: 0 0 0 2em; }
        (setq GlyphWiki-id (char-GlyphWiki-id object)))
       (setq ret (www-format-encode-string
                 (est-format-object object 'readable)))
+      (setq HNG-card
+           (if (string-match "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)\"" ret)
+               (format "HNG/%s/cards/%s.jpg"
+                       (match-string 1 ret)
+                       (match-string 2 ret))))
       (princ (format "<h%d>%s%s</h%d>\n"
                     level
                     (if uri-feature-name
@@ -169,7 +174,11 @@ li { margin: 0 0 0 2em; }
                                  ;;   "<a href=\"%s\">%s</a>")
                                 (www-uri-make-object-url object uri-object)
                                 ret)
-                      ret)
+                      (if HNG-card
+                          (format
+                           "<a href=\"http://hng.chise.org/images/%s\">%s</a>"
+                           HNG-card ret)
+                        ret))
                     (if GlyphWiki-id
                         (format
                          " <a href=\"http://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"http://glyphwiki.org/glyph/%s.50px.png\" /></a>"