X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=cwiki-view.el;h=669f5bf9f35d071a74ca9346b396a7d92fe6db7c;hb=ff1dae13d988279765f1f77c81c62b71224ed946;hp=23f6469e23cd7b8e020dfc51effc3dc14530afbe;hpb=600491dd3cef170306832c8a029931480dd5dd85;p=chise%2Fest.git diff --git a/cwiki-view.el b/cwiki-view.el index 23f6469..669f5bf 100644 --- a/cwiki-view.el +++ b/cwiki-view.el @@ -1,136 +1,210 @@ ;; -*- coding: utf-8-mcs-er -*- -(require 'cwiki-common) +(require 'cwiki-format) (defvar chise-wiki-view-url "view.cgi") -(defvar chise-wiki-edit-url "edit/edit.cgi") -(defvar chise-wiki-add-url "edit/add.cgi") +(defvar chise-wiki-edit-url "edit.cgi") +(defvar chise-wiki-add-url "add.cgi") -;; (defun www-char-display-feature-default (char feature-name &optional value -;; lang uri-char) -;; (unless value -;; (setq value (www-char-feature char feature-name))) -;; (unless uri-char -;; (setq uri-char (char-to-string char))) -;; (www-html-display-paragraph -;; (format "[[%s|%?feature=%s&char=%s]] : %s [[[edit|%s?char=%s&feature=%s]]]" -;; (www-format-feature-name feature-name lang) -;; chise-wiki-view-url -;; (www-uri-encode-feature-name feature-name) -;; uri-char -;; (www-format-value value feature-name) -;; chise-wiki-edit-url -;; uri-char -;; (www-uri-encode-feature-name feature-name) -;; ))) - -;; (defun www-char-display-feature-as-ucs (char feature-name &optional value) -;; (unless value -;; (setq value (www-char-feature char feature-name))) -;; (www-html-display-paragraph -;; (format "= [[U+%s|http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=%s]] (%d)" -;; (www-format-value-as-HEX value) -;; (www-format-value-as-HEX value) -;; value))) - -(defun www-display-char-desc (uri-char &optional lang level) +(defun www-display-object-desc (genre uri-object &optional lang level simple) (unless level (setq level 1)) - (let ((char (www-uri-decode-char uri-char)) - logical-feature displayed-features) - (when (characterp char) - (when (= (length uri-char) 1) - (setq uri-char (www-uri-encode-char char))) + (let ((object (www-uri-decode-object genre uri-object)) + logical-feature chise-wiki-displayed-features + parents + GlyphWiki-id) + (when object + (when (and (eq genre 'character) + (= (length uri-object) 1)) + (setq uri-object (www-uri-encode-object object))) (when (= level 1) (princ (encode-coding-string (format " -CHISE-wiki character: %s +EsT %s = %s \n" - (decode-uri-string uri-char 'utf-8-mcs-er)) + genre + (decode-uri-string uri-object 'utf-8-mcs-er)) 'utf-8-mcs-er)) (princ "\n")) - (princ (format "%s\n" + (when (eq genre 'character) + (dolist (feature (char-feature-property '$object 'additional-features)) + (mount-char-attribute-table + (char-feature-name-at-domain feature '$rev=latest)))) + (princ + (format + (if simple + "
+ + + + +
+
\n" + "
+ + + +
+
\n") + genre + uri-object)) + (when (setq parents (www-get-feature-value object '<-denotational)) + (princ (format "

%s %s

\n
\n" + (www-format-value-as-char-list parents) + (www-format-feature-name '->denotational lang)))) + (when (setq parents (www-get-feature-value object '<-subsumptive)) + (princ (format "

%s %s

\n
\n" + (www-format-value-as-char-list parents) + (www-format-feature-name '->subsumptive lang)))) + (when (eq genre 'character) + (setq GlyphWiki-id (char-GlyphWiki-id object))) + (princ (format "%s%s\n" level - (www-format-encode-string (char-to-string char)) + (www-format-encode-string + (est-format-object object) + ;; (if (eq genre 'character) + ;; (char-to-string object) + ;; (format "%s" (concord-object-id object))) + ) + (if GlyphWiki-id + (format + " \"%s\"" + GlyphWiki-id + GlyphWiki-id GlyphWiki-id) + "") level)) (if (> level 1) (princ "