From: MORIOKA Tomohiko Date: Mon, 17 Jan 2022 07:13:00 +0000 (+0900) Subject: (est-eval-value-as-ndl-page-by-tify): New function. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9603cc5596c6e94e57a6859d4bb10ad78c762724;p=chise%2Fest.git (est-eval-value-as-ndl-page-by-tify): New function. (est-eval-apply-value): Use `est-eval-value-as-ndl-page-by-tify' for format `tify-url-for-ndl'. (est-eval-unit): Treat `tify-url-for-ndl' as a value getter. --- diff --git a/est-eval.el b/est-eval.el index 7d5b55a..8a9a838 100644 --- a/est-eval.el +++ b/est-eval.el @@ -456,6 +456,18 @@ (daijiten-page-number-to-ndl-950498 value))) value))) +(defun est-eval-value-as-ndl-page-by-tify (value) + (if (symbolp value) + (setq value (symbol-name value))) + (if (stringp value) + (if (string-match "/" value) + (format "http://image.chise.org/tify/?manifest=https://www.dl.ndl.go.jp/api/iiif/%s/manifest.json&tify={%%22pages%%22:[%s]}" + (substring value 0 (match-beginning 0)) + (substring value (match-end 0))) + (format "http://image.chise.org/tify/?manifest=https://www.dl.ndl.go.jp/api/iiif/%s/manifest.json" + value)) + value)) + (defun est-eval-value-as-Web-yunzi-char (value) (if (char-or-char-int-p value) (list 'link @@ -851,6 +863,9 @@ (est-eval-value-as-kuten value)) ((eq format 'kangxi-radical) (est-eval-value-as-kangxi-radical value)) + ((eq format 'tify-url-for-ndl) + (est-eval-value-as-ndl-page-by-tify value) + ) ((eq format 'shuowen-radical) (est-eval-value-as-shuowen-radical value)) ((eq format 'ids) @@ -949,7 +964,7 @@ (cond ((memq (car exp) '(value decimal hex HEX ku-ten kangxi-radical shuowen-radical - S-exp string default)) + S-exp string default tify-url-for-ndl)) (let ((fn (plist-get (nth 1 exp) :feature)) domain domain-fn ret) (when fn