(coded-charset-GlyphWiki-id-alist): Decrease preferences of
[chise/est.git] / est-format.el
index 116d412..176cbcb 100644 (file)
       (setq dest
            (format "%s %s=\"%s\""
                    dest key
-                   (www-format-encode-string
-                    (format "%s"
-                            (est-format-unit val 'without-tags
-                                             'without-edit 'as-property))
-                    'without-tags))))
+                   (format "%s"
+                           (est-format-unit val 'without-tags
+                                            'without-edit 'as-property))
+                   )))
     dest))
 
 (defun est-format-unit (format-unit
@@ -41,7 +40,7 @@
     (setq output-format 'html)
     ))
   (let (name props children ret object feature format value
-            output-string)
+            output-string subtype)
     (cond
      ((stringp format-unit)
       (www-format-encode-string format-unit
              (eq output-format 'wiki-text))
          (unless separator
            (setq separator (plist-get props :separator)))
+         (setq subtype (plist-get props :subtype))
          (setq output-string
                (est-format-list children output-format
-                                without-edit as-property separator))
+                                without-edit as-property separator subtype))
          )
         ((eq output-format 'html)
          (setq props (list* :class name props)
                        children)))
          ))
        )
+       ((eq name 'omitted)
+       (cond
+        ((eq output-format 'wiki-text)
+         (setq output-string "{{...}}")
+         )
+        ((and (eq output-format 'html)
+              (setq object (plist-get props :object))
+              (setq feature (plist-get props :feature)))
+         (setq children
+               (list
+                (list* 'a
+                       (list :href
+                             (concat (www-uri-make-object-url object)
+                                     (if est-hide-cgi-mode
+                                         "/feature="
+                                       "&feature=")
+                                     (www-uri-encode-feature-name feature)))
+                       children)))
+         ))
+       )
        ((eq name 'feature-name)
        (setq name 'span)
        (when (eq output-format 'html)
                     (setq feature (plist-get props :feature)))
            (setq children
                  (list
-                  (list* 'a
-                         (list :href
-                               (www-uri-make-feature-name-url
-                                (est-object-genre object)
-                                (www-uri-encode-feature-name feature)
-                                (www-uri-encode-object object)))
-                         children)))))
+                  (list 'span
+                        '(:class "feature-name")
+                        (list* 'a
+                               (list :href
+                                     (www-uri-make-feature-name-url
+                                      (est-object-genre object)
+                                      (www-uri-encode-feature-name feature)
+                                      (www-uri-encode-object object)))
+                               children))))))
        )
        ((eq name 'value)
        (cond
        (t
        (unless separator
          (setq separator (plist-get props :separator)))
+       (setq subtype (plist-get props :subtype))
        (if children
-           (if (eq output-format 'plain-text)
-               (est-format-list children output-format as-property separator)
+           (cond
+            ((eq output-format 'plain-text)
+             (est-format-list children output-format as-property separator
+                              subtype)
+             )
+            ((eq subtype 'unordered-list)
+             (format "<ul\n%s><li\n>%s</li></ul\n>"
+                     (if props
+                         (est-format-props props)
+                       "")
+                     (est-format-list
+                      children output-format
+                      without-edit as-property "</li\n><li\n>")
+                     )
+             
+             )
+            (t
              (format "<%s%s>%s</%s>"
                      name
                      (if props
                      (est-format-list
                       children output-format
                       without-edit as-property separator)
-                     name))
+                     name)
+             ))
          (if (eq output-format 'plain-text)
              ""
            (format "<%s%s/>"
 
 (defun est-format-list (format-list
                        &optional output-format without-edit as-property
-                       separator)
-  (if (atom format-list)
-      (est-format-unit
-       format-list output-format without-edit as-property separator)
+                       separator subtype)
+  (cond
+   ((atom format-list)
+    (est-format-unit
+     format-list output-format without-edit as-property separator)
+    )
+   ((eq subtype 'unordered-list)
+    (concat "<ul\n><li>"
+           (mapconcat (lambda (unit)
+                        (est-format-unit
+                         unit output-format without-edit as-property separator))
+                      format-list "</li\n><li>")
+           "</li\n></ul\n>")
+    )
+   (t
     (mapconcat (lambda (unit)
                 (est-format-unit
-                 unit output-format without-edit as-property separator))
-              format-list separator)))
+                 unit output-format without-edit as-property))
+              format-list separator)
+    )))
 
 
 ;;; @ End.