1 ;; -*- coding: utf-8-mcs-er -*-
2 (require 'cwiki-format)
3 (require 'char-db-json)
4 (require 'concord-turtle-dump)
6 (defvar chise-wiki-view-url "view.cgi")
7 (defvar chise-wiki-edit-url "edit.cgi")
8 (defvar chise-wiki-add-url "add.cgi")
10 (defun www-edit-display-feature-input-box (char feature-name
11 &optional format value)
13 (setq char (or (concord-decode-object '=id char 'feature)
14 (concord-make-object 'feature char))))
16 (setq format 'default))
18 (setq value (www-get-feature-value char feature-name)))
19 (if (and (symbolp value)
20 (eq format 'wiki-text))
21 (setq value (list (list value))))
23 (format "<p><input type=\"text\" name=\"feature-name\"
24 size=\"32\" maxlength=\"256\" value=\"%s\">"
26 (princ (encode-coding-string " \u2190 " 'utf-8-mcs-er))
28 (format "%s<input type=\"text\" name=\"%s\"
29 size=\"64\" maxlength=\"256\" value=\"%s\">
30 <input type=\"submit\" value=\"set\" /></p>
32 (if (or (eq format 'HEX)(eq format 'hex))
36 (mapconcat (lambda (c)
38 ;; ((eq c ?<) "&lt;")
39 ;; ((eq c ?>) "&gt;")
40 ((eq c ?\u0022) """)
43 (est-format-list value format nil nil " ")
47 (defun www-display-object-desc (genre uri-object &optional uri-feature-name
50 uri-feature-name-to-edit editing-format)
53 (let ((object (www-uri-decode-object genre uri-object))
54 (est-eval-list-feature-items-limit est-eval-list-feature-items-limit)
55 (est-view-url-prefix (if uri-feature-name
58 (rdf-uri-object (if est-hide-cgi-mode
59 (if (string-match "=" uri-object)
61 (est-uri-decode-feature-name-body
62 (substring uri-object 0 (match-beginning 0)))
64 (est-uri-decode-feature-name-body
65 (substring uri-object (match-end 0))))
67 feature-name-to-display feature-name-to-edit
68 base-name-to-edit metadata-name-to-edit
70 logical-feature chise-wiki-displayed-features
72 GlyphWiki-id HNG-card HNG-card-id HNG-card-cobj ret object-spec
74 item-code page char-num glyph-image-id
75 width height image-cobj base-image x y w h)
79 (setq without-header t))
81 (when uri-feature-name-to-edit
82 (setq feature-name-to-edit
83 (www-uri-decode-feature-name uri-feature-name-to-edit))
84 (setq ret (symbol-name feature-name-to-edit))
85 (if (string-match "\\*" ret)
86 (setq base-name-to-edit (intern
87 (substring ret 0 (match-beginning 0)))
88 metadata-name-to-edit (intern
89 (substring ret (match-end 0))))
90 (setq base-name-to-edit feature-name-to-edit))
91 (when (stringp editing-format)
92 (setq editing-format (intern editing-format))))
93 (when (and (eq genre 'character)
94 (= (length uri-object) 1))
95 (setq uri-object (www-uri-encode-object object)))
100 <style type=\"text/css\">
102 h1 { font-size: 60px; vertical-align: super; }
104 .ids { vertical-align: middle; font-size: 40px; line-height: 100%%; }
105 a { text-decoration: none; }
106 .ids a { color: black; }
107 ul { margin: 0 0; color: black; }
108 li { margin: 0 0 0 2em; }
109 .feature-name { font-family: sans-serif; font-weight: bold; }
110 .feature-name a { color: black; }
114 display: inline-block;
115 border-bottom: 1px dotted black;
118 .tooltip .tooltiptext {
124 background-color: black;
134 .value .image-list img { height: 320px; vertical-align: top; }
136 .list .tooltip:hover .tooltiptext {
143 src=\"https://image.chise.org/openseadragon/openseadragon.min.js\"></script>
145 <title>EsT %s = %s</title>
148 (decode-uri-string uri-object 'utf-8-mcs-er))
151 (when (eq genre 'character)
152 (dolist (feature (char-feature-property '$object 'additional-features))
153 (mount-char-attribute-table
154 (char-feature-name-at-domain feature '$rev=latest))))
158 (if est-hide-cgi-mode
159 "<div style=\"text-align:right;\">
160 <a href=\"../../edit/view.cgi?%s=%s\">
161 <input type=\"submit\" value=\"Edit\" />
163 "<div style=\"text-align:right;\">
164 <a href=\"edit/view.cgi?%s=%s\">
165 <input type=\"submit\" value=\"Edit\" />
167 genre rdf-uri-object)
169 "<div style=\"text-align:right;\">
170 <a href=\"../view/%s/%s\">
171 <input type=\"submit\" value=\"Simple\" />
174 (if (string-match ":" uri-object)
176 (est-uri-encode-feature-name-body
177 (substring uri-object 0 (match-beginning 0)))
179 (est-uri-encode-feature-name-body
180 (substring uri-object (match-end 0))))))))
182 (format "<input type=\"submit\" value=\"New Account\" />
183 <a href=\"./%s/index.ttl\"><input type=\"submit\" value=\"RDF (Turtle)\" /></a>
184 <a href=\"http://www.chise.org/est/rdf.cgi?%s=%s\">
185 <input type=\"submit\" value=\"XML (old RDF)\" />
191 (if (eq genre 'character)
193 <a href=\"/est/view/%s/%s/data.json\">
194 <input type=\"submit\" value=\"JSON\" />
197 (if (and (or (char-feature object '->HNG@CN/manuscript)
198 (char-feature object '->HNG@CN/printed)
199 (char-feature object '->HNG@JP/manuscript)
200 (char-feature object '->HNG@JP/printed)
201 (char-feature object '->HNG@KR)
202 (char-feature object '->HNG@MISC))
203 (setq ucs (char-ucs object))
204 (setq ret (decode-char '=ucs ucs))
206 (if (setq ucs (get-char-attribute
208 (decode-char '=ucs ucs)
211 <a href=\"https://search.hng-data.org/search/%s\">
212 <input type=\"submit\" value=\"HNG-data\" />
214 (www-uri-encode-object ret))
217 (when (setq parents (www-get-feature-value object '<-denotational))
218 (if (characterp parents)
219 (setq parents (list parents)))
220 (princ (format "<p>%s %s</p>\n<hr>\n"
221 (www-format-value-as-char-list parents)
222 (www-format-feature-name '->denotational lang))))
223 (when (setq parents (www-get-feature-value object '<-subsumptive))
224 (if (characterp parents)
225 (setq parents (list parents)))
226 (princ (format "<p>%s %s</p>\n<hr>\n"
227 (www-format-value-as-char-list parents)
228 (www-format-feature-name '->subsumptive lang))))
229 (when (eq genre 'character)
230 (setq GlyphWiki-id (char-GlyphWiki-id object)))
232 ((eq genre 'image-resource)
234 (if (setq ret (concord-object-get object '=location@iiif))
236 (car (concord-object-get object '<-image-segment)))
237 (format "<a href=\"%s...$.zoom-xywh=%d,%d,%d,%d\"
238 ><img alt=\"%s\" src=\"%s\" /></a>"
239 (www-uri-encode-object base-image)
240 (concord-object-get object 'image-offset-x)
241 (concord-object-get object 'image-offset-y)
242 (concord-object-get object 'image-width)
243 (concord-object-get object 'image-height)
245 (if (and image-selection
246 (string-match "\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\),\\([0-9]+\\)" image-selection))
248 (setq x (string-to-int (match-string 1 image-selection))
249 y (string-to-int (match-string 2 image-selection))
250 w (string-to-int (match-string 3 image-selection))
251 h (string-to-int (match-string 4 image-selection)))
253 (concord-object-get object 'image-width)))
254 ;; (setq height (float
255 ;; (concord-object-get object 'image-height)))
256 (format "<div id=\"openseadragon1\"
257 style=\"width: 800px; height: 600px;\"></div>
259 <script type=\"text/javascript\">
261 viewer = OpenSeadragon({
262 id: \"openseadragon1\",
263 prefixUrl: \"https://image.chise.org/openseadragon/images/\",
264 preserveViewport: true,
269 tileSources: [ \"%s/info.json\" ]
271 viewer.addHandler('open', function () {
272 var newBounds = new OpenSeadragon.Rect( %f, %f, %f, %f, 0 );
273 viewer.viewport.fitBounds(newBounds, true);
274 viewer.viewport.applyConstraints();
284 (format "<div id=\"openseadragon1\"
285 style=\"width: 800px; height: 600px;\"></div>
287 <script type=\"text/javascript\">
289 id: \"openseadragon1\",
290 prefixUrl: \"https://image.chise.org/openseadragon/images/\",
291 preserveViewport: true,
296 tileSources: [ \"%s/info.json\" ]
301 (setq ret (concord-object-get object '=location))
302 (format "<img alt=\"%s\" src=\"%s\" />"
305 ((and (eq genre 'character)
306 (setq ret (or (encode-char object '=chise-hdic-tsj)
307 (encode-char object '===chise-hdic-tsj)))
308 (setq ret (decode-char '===chise-hdic-tsj ret))
309 (setq ret (get-char-attribute ret '=hdic-tsj-entry-id)))
311 (format "<a href=\"https://viewer.hdic.jp/tsj2/%s\"
314 (www-format-encode-string
315 (est-format-object object 'readable))))
317 ((and (eq genre 'character)
318 (setq ret (or (encode-char object '=chise-hdic-syp)
319 (encode-char object '===chise-hdic-syp)))
320 (setq ret (decode-char '===chise-hdic-syp ret))
321 (setq ret (get-char-attribute ret '=hdic-syp-entry-id)))
323 (format "<a href=\"https://viewer.hdic.jp/syp/%s\"
326 (www-format-encode-string
327 (est-format-object object 'readable))))
329 ((or (and (eq genre 'glyph-image)
331 (car (concord-object-get object '->image-resource))))
332 (and (eq genre 'character)
333 ;; (setq ret (www-format-encode-string
334 ;; (est-format-object object 'readable)))
336 ;; "<img alt=\"SW-JIGUGE\\([45]\\)-\\([0-9][0-9][0-9]\\)\\([0-9][0-9]\\)"
338 ;; (setq item-code (string-to-int (match-string 1 ret))
339 ;; page (string-to-int (match-string 2 ret))
340 ;; char-num (string-to-int (match-string 3 ret)))
341 (cond ((setq ret (or (encode-char object '=shuowen-jiguge)
342 (encode-char object '===shuowen-jiguge5)))
345 char-num (% ret 100)))
346 ((setq ret (encode-char object '===shuowen-jiguge4))
349 char-num (% ret 100))))
351 (cond ((eq item-code 4)
353 (format "zinbun/toho/A024/A024%04d/char=%d"
354 (+ page 18) char-num))
358 (format "zinbun/toho/A020/A020%04d/char=%d"
359 (+ page 16) char-num))
362 (concord-decode-object '=id glyph-image-id 'glyph-image))
364 (car (concord-object-get image-cobj '->image-resource)))
366 (if (and (setq ret (concord-object-get image-cobj '=location@iiif))
368 (car (concord-object-get image-cobj '<-image-segment))))
370 (format "<a href=\"../image-resource/%s...$.zoom-xywh=%d,%d,%d,%d\"
371 ><img alt=\"%s\" src=\"%s\" /></a>"
372 (www-uri-encode-object base-image)
373 (concord-object-get image-cobj 'image-offset-x)
374 (concord-object-get image-cobj 'image-offset-y)
375 (concord-object-get image-cobj 'image-width)
376 (concord-object-get image-cobj 'image-height)
378 (setq ret (concord-object-get image-cobj '=location))
379 (princ (format "<img alt=\"%s\" src=\"%s\" />"
382 ((and (eq genre 'hng-card)
383 (setq ret (concord-object-get object '=hng-card))
384 (setq ret (symbol-name ret))
385 (string-match "\\([0-9]+\\)-\\([0-9]+\\)" ret))
388 "<img alt=\"HNG-card:%s\"
389 src=\"https://image.hng-data.org/images/HNG/%03d/card/%04d.jpg\"
390 style=\"height: 480px;\" />"
392 (string-to-int (match-string 1 ret))
393 (string-to-int (match-string 2 ret))))
396 (car (concord-object-get object '->image-resource)))
397 (format "<a href=\"../image-resource/%s\">%s</a>"
398 (www-uri-encode-object image-cobj)
403 (setq ret (www-format-encode-string
404 (est-format-object object 'readable)))
406 "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)[a-z]?\"" ret)
410 (string-to-int (match-string 1 ret))
411 (string-to-int (match-string 2 ret)))))
413 (format "hng-card/rep.id=%s" HNG-card-id)))
415 (format "<h%d>%s%s</h%d>\n"
419 (format "<a href=\"%s\">%s</a>"
420 ;; (if est-hide-cgi-mode
421 ;; "<a href=\"../%s\">%s</a>"
422 ;; "<a href=\"%s\">%s</a>")
423 (www-uri-make-object-url object uri-object)
428 "<a href=\"../%s\">%s</a>"
434 " <a href=\"https://glyphwiki.org/wiki/%s\"><img alt=\"%s\" src=\"%s/%s.svg\" style=\"vertical-align:middle; width: 60px; height: 60px\"/></a>"
437 chise-wiki-glyphwiki-glyph-image-url
444 (when feature-name-to-edit
445 (princ "<form action=\"set.cgi\" method=\"GET\">\n")
447 (encode-coding-string
448 (format "<p>(%s : <input type=\"text\" name=\"%s\"
449 size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
452 (decode-uri-string uri-object 'utf-8-mcs-er))
454 (when (and HNG-card-id
455 (eq genre 'character)
457 (concord-decode-object
460 (put-char-attribute object 'sources@HNG/card (list HNG-card-cobj))
461 (cond ((setq ret (concord-object-get
463 '->glyph-image@zinbun/takuhon))
464 (put-char-attribute object 'sources@zinbun/takuhon ret)
466 ((setq ret (concord-object-get
468 '->glyph-image@gallica))
469 (put-char-attribute object 'sources@gallica ret)
475 (setq feature-name-to-display
476 (www-uri-decode-feature-name uri-feature-name))
477 (setq est-eval-list-feature-items-limit nil)
479 (cons feature-name-to-display
480 (if (eq genre 'character)
481 (get-char-attribute object feature-name-to-display)
482 (concord-object-get object feature-name-to-display)))))
484 (if (eq genre 'character)
485 (char-attribute-alist object)
486 (concord-object-spec object)))))
487 (when feature-name-to-edit
488 (unless (assq base-name-to-edit object-spec)
489 (setq object-spec (cons (cons base-name-to-edit nil)
491 (dolist (cell (sort object-spec
493 (char-attribute-name<
494 (char-feature-name-sans-versions (car a))
495 (char-feature-name-sans-versions (car b))))))
496 (setq logical-feature (char-feature-name-sans-versions (car cell)))
497 (unless (memq logical-feature chise-wiki-displayed-features)
498 (push logical-feature chise-wiki-displayed-features)
500 ((and feature-name-to-edit
501 (eq (car cell) feature-name-to-edit))
502 (www-edit-display-feature-input-box
503 object feature-name-to-edit editing-format)
508 "<div class=\"feature\" style=\"line-height:150%\">\n"
511 (www-format-eval-list
512 (www-feature-format logical-feature)
514 logical-feature ; (car cell)
519 (format " <a href=\"%s?%s=%s&feature=%s&format=wiki-text\"
520 ><input type=\"submit\" value=\"note\" /></a>"
523 (www-format-encode-string uri-object)
524 (www-format-encode-string
525 (www-uri-encode-feature-name
526 (intern (format "%s*note"
527 logical-feature ; (car cell)
529 (when (and feature-name-to-edit
530 (eq base-name-to-edit (car cell)) metadata-name-to-edit)
533 (www-edit-display-feature-input-box
534 object feature-name-to-edit editing-format)
547 (when feature-name-to-edit
551 (format "<a href=\"%s?%s=%s\"
552 ><input type=\"submit\" value=\"add feature\" /></a>
556 (www-format-encode-string uri-object))))
561 (when (eq genre 'character)
562 (let ((object-str (est-format-object object))
563 encoded-object-for-form)
565 "<form action=\"https://www.chise.org/ids-find\">\n")
566 (princ (www-format-encode-string object-str))
567 (setq encoded-object-for-form
569 (insert (encode-coding-string object-str 'utf-8-jp-er))
570 (goto-char (point-min))
571 (while (search-forward ">-" nil t)
572 (replace-match "&GT-" t t)
577 " <input type=\"text\" name=\"components\"
578 size=\"30\" maxlength=\"30\" value=\"%s\" />"
579 encoded-object-for-form))
581 (www-format-encode-string
582 "を\u542Bむ\u6F22\u5B57を\u63A2す"))
583 (princ " <input type=\"submit\" value=\"search\" />\n")
587 "<form action=\"https://www.chise.org/hng-ids-find\">\n")
588 (princ (www-format-encode-string object-str))
592 " <input type=\"text\" name=\"components\"
593 size=\"30\" maxlength=\"30\" value=\"%s\" />"
594 encoded-object-for-form))
596 (www-format-encode-string
597 "を\u542Bむ HNG の\u6F22\u5B57を\u63A2す"))
598 (princ " <input type=\"submit\" value=\"search\" />\n")
607 (defun www-display-feature-desc (uri-feature-name genre uri-object
608 &optional lang simple)
609 (let ((rdf-uri-object (if est-hide-cgi-mode
611 (string-match "=" uri-object)
613 (est-uri-decode-feature-name-body
614 (substring uri-object 0 (match-beginning 0)))
616 (est-uri-decode-feature-name-body
617 (substring uri-object (match-end 0)))))
619 (feature-name (www-uri-decode-feature-name uri-feature-name))
620 (name@lang (intern (format "name@%s" lang))))
622 (encode-coding-string
624 <title>EsT feature: %s</title>
632 (if est-hide-cgi-mode
633 "<div style=\"text-align:right;\">
634 <a href=\"../../../edit/view.cgi?feature=%s&%s=%s\">
635 <input type=\"submit\" value=\"Edit\" />
637 <input type=\"submit\" value=\"New Account\" />
640 "<div style=\"text-align:right;\">
641 <a href=\"edit/view.cgi?feature=%s&%s=%s\">
642 <input type=\"submit\" value=\"Edit\" />
644 <input type=\"submit\" value=\"New Account\" />
647 uri-feature-name genre rdf-uri-object)
649 "<div style=\"text-align:right;\">
650 <a href=\"../view/feature/%s&%s/%s\">
651 <input type=\"submit\" value=\"Simple\" />
655 uri-feature-name genre uri-object)))
657 (format "<h1>%s</h1>\n"
658 (www-format-encode-string
659 (symbol-name feature-name))))
660 (princ (format "<p>name : %s "
661 (or (www-format-feature-name feature-name) "")))
665 " <a href=\"%s?feature=%s&property=name&format=string&%s=%s\">"
670 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
675 (www-format-encode-string
678 (or (char-feature-property feature-name name@lang) ""))))
682 " <a href=\"%s?feature=%s&property=%s&format=string&%s=%s\">"
688 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
690 (www-html-display-paragraph
692 (or (www-feature-type feature-name)
693 ;; (char-feature-property feature-name 'type)
695 (princ (format "<p>value-format : %s "
698 (or (www-feature-value-format feature-name)
706 " <a href=\"%s?feature=%s&property=value-format&format=wiki-text&%s=%s\"
712 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
715 (princ (format "<p>value-presentation-format : %s "
717 nil 'value-presentation-format
718 (or (www-feature-value-format feature-name)
726 " <a href=\"%s?feature=%s&property=value-presentation-format&format=wiki-text&%s=%s\"
732 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
735 (princ "<p>format : ")
736 (www-html-display-text
737 (decode-coding-string
739 (www-feature-format feature-name))
744 " <a href=\"%s?feature=%s&property=format&format=wiki-text&%s=%s\"
750 (princ "<input type=\"submit\" value=\"edit\" /></a>\n"))
753 (www-html-display-paragraph
754 (format "description : %s"
755 (or (decode-coding-string
756 (or (char-feature-property feature-name 'description)
761 (www-html-display-paragraph
762 (format "description@%s : %s"
764 (or (char-feature-property
766 (intern (format "description@%s" lang)))
770 (defun www-batch-view ()
771 (setq terminal-coding-system 'binary)
773 (let* ((target (pop command-line-args-left))
774 (user (pop command-line-args-left))
775 (accept-language (pop command-line-args-left))
776 (mode (intern (pop command-line-args-left)))
781 (car (split-string accept-language ","))
785 (princ "Content-Type: text/html; charset=UTF-8
787 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
788 \"http://www.w3.org/TR/html4/loose.dtd\">
793 (when (string-match "^char=\\(&[^&;]+;\\)" target)
794 (setq ret (match-end 0))
797 (www-uri-encode-object
798 (www-uri-decode-object
799 'character (match-string 1 target)))
800 (substring target ret))))
802 (mapcar (lambda (cell)
803 (if (string-match "=" cell)
805 (setq genre (substring cell 0 (match-beginning 0))
806 ret (substring cell (match-end 0)))
809 (decode-uri-string genre 'utf-8-mcs-er))
811 (list (decode-uri-string cell 'utf-8-mcs-er))))
812 (split-string target "&")))
813 (setq ret (car target))
814 (cond ((eq (car ret) 'char)
815 (www-display-object-desc
816 'character (cdr ret) (cdr (assq 'feature target))
821 ((eq (car ret) 'feature)
822 (www-display-feature-desc
823 (decode-uri-string (cdr ret) 'utf-8-mcs-er)
830 (www-display-object-desc
831 (car ret) (cdr ret) (cdr (assq 'feature target))
838 (princ (format "mode=%S\n" mode))
839 (princ (format "user=%s\n" user))
840 ;; (princ (format "local user=%s\n" (user-login-name)))
841 (princ (format "lang=%S\n" lang))
842 (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
844 ;; (princ xemacs-chise-version)
850 (princ (format "%S" err)))
853 (defun www-batch-view-smart ()
854 (setq debug-on-error t)
855 (setq terminal-coding-system 'binary)
857 (let* ((est-hide-cgi-mode t)
858 (target (pop command-line-args-left))
859 (user (pop command-line-args-left))
860 (accept-language (pop command-line-args-left))
861 (mode (intern (pop command-line-args-left)))
866 (car (split-string accept-language ","))
869 ret genre feature obj-url json turtle obj)
873 ((string-match "/data\\.json$" target)
875 target (substring target 0 (match-beginning 0)))
877 ((string-match "/index\\.ttl$" target)
879 target (substring target 0 (match-beginning 0)))
881 ((string-match "/index\\.\\(...*\\)\\.html$" target)
882 (setq lang (intern (match-string 1 target))
883 target (substring target 0 (match-beginning 0)))
885 (when (string-match "^char/\\(&[^&;]+;\\)" target)
886 (setq ret (match-end 0))
889 (www-uri-encode-object
890 (www-uri-decode-object
891 'character (match-string 1 target)))
892 (substring target ret))))
896 (if (string-match "/" cell)
898 (setq genre (substring cell 0 (match-beginning 0))
899 ret (substring cell (match-end 0)))
901 (intern (decode-uri-string genre 'utf-8-mcs-er))
903 ((string-match "/feature=" ret)
904 (list (substring ret 0 (match-beginning 0))
905 (substring ret (match-end 0)))
907 ((string-match "...$.zoom-xywh=" ret)
908 (list (substring ret 0 (match-beginning 0))
910 (substring ret (match-end 0)))
914 (list (decode-uri-string cell 'utf-8-mcs-er)))
915 ;; (setq ret (split-string cell "/"))
917 ;; (decode-uri-string (car ret) 'utf-8-mcs-er))
920 (split-string target "&")))
921 (setq ret (car target))
923 (princ "Content-Type: text/turtle; charset=UTF-8
928 (princ "Content-Type: application/json; charset=UTF-8
933 (princ "Content-Type: text/html; charset=UTF-8
935 <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"
936 \"http://www.w3.org/TR/html4/loose.dtd\">
940 ;; (princ (format "<p>%S, %S, %S</p>"
941 ;; (car ret)(nth 1 ret)(nth 2 ret)))
942 ;; (princ (format "// %S %S\n" ret json))
945 (setq obj (www-uri-decode-object (car ret)(nth 1 ret)))
946 (concord-turtle-insert-char-data obj)
947 (goto-char (point-min))
948 (concord-turtle-insert-prefix)
950 (encode-coding-region
951 (point-min)(point-max)
952 char-db-file-coding-system)
953 (princ (buffer-string)))
955 ((or (eq (car ret) 'char)
956 (eq (car ret) 'character))
958 (setq obj (www-uri-decode-object
959 (car ret)(nth 1 ret)))
962 ;; (princ (encode-coding-string
963 ;; (format "// %S\n" obj)
964 ;; char-db-file-coding-system))
965 (char-db-json-char-data-with-variant obj 'printable)
966 (encode-coding-region
967 (point-min)(point-max)
968 char-db-file-coding-system)
969 (princ (buffer-string))
971 (www-display-object-desc
972 'character (nth 1 ret) (nth 2 ret)
977 ((eq (car ret) 'feature)
978 (www-display-feature-desc
979 (decode-uri-string (nth 1 ret) 'utf-8-mcs-er)
981 (nth 1 (nth 1 target))
985 ;; ((eq (car ret) 'image-resource)
987 ;; ;; ((string-match "^\\.iiif=" (nth 1 ret))
988 ;; ;; (setq obj-url (decode-uri-string
989 ;; ;; (substring (nth 1 ret) (match-end 0))
990 ;; ;; 'utf-8-mcs-er))
991 ;; ;; (setq obj (concord-images-add-iiif obj-url))
992 ;; ;; (www-display-object-desc
993 ;; ;; 'image-resource
994 ;; ;; (www-uri-encode-object obj)
997 ;; ;; (eq mode 'simple))
1000 ;; (princ (nth 1 ret))
1001 ;; (www-display-object-desc
1002 ;; 'image-resource (nth 1 ret) (nth 2 ret)
1004 ;; (eq mode 'simple))
1008 (www-display-object-desc
1009 (car ret) (nth 1 ret) (nth 2 ret)
1015 (unless (or json turtle)
1017 (princ (format "mode=%S\n" mode))
1018 (princ (format "user=%s\n" user))
1019 ;; (princ (format "local user=%s\n" (user-login-name)))
1020 (princ (format "lang=%S\n" lang))
1021 (princ (encode-coding-string (emacs-version) 'utf-8-jp-er))
1022 ;; (princ " CHISE ")
1023 ;; (princ xemacs-chise-version)
1030 (princ (format "%S" err)))
1033 (provide 'cwiki-view)