yatex
changeset 627:f294195d0d3f dev tip
Add details add-in, which fills <summary>.
| author | HIROSE Yuuji <yuuji@gentei.org> |
|---|---|
| date | Tue, 11 Aug 2026 20:43:46 +0900 |
| parents | 0018833906a1 |
| children | |
| files | yahtml.el |
| diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line diff
1.1 --- a/yahtml.el Sat Aug 01 13:57:31 2026 +0900 1.2 +++ b/yahtml.el Tue Aug 11 20:43:46 2026 +0900 1.3 @@ -3040,15 +3040,16 @@ 1.4 (open-line 1) 1.5 (YaTeX-reindent c)))) 1.6 1.7 -(defun yahtml-intelligent-newline-head () 1.8 - (let ((title (read-string-with-history "Document title: ")) 1.9 - (b "<title>") (e "</title>") p) 1.10 +(defun yahtml-intelligent-newline-head (&optional elem) 1.11 + (let*((elem (or elem "title")) 1.12 + (title (read-string-with-history (concat (capitalize elem) ": "))) 1.13 + (b (format "<%s>" elem)) (e (format "</%s>" elem)) p) 1.14 (yahtml-indent-line) 1.15 (insert (format "%s" (if yahtml-prefer-upcases (upcase b) b))) 1.16 (setq p (point)) 1.17 (insert (format "%s%s" title (if yahtml-prefer-upcases (upcase e) e))) 1.18 (if (string= "" title) (goto-char p)) 1.19 - (setq yahtml-last-begend "body"))) 1.20 + (setq yahtml-last-begend (if elem "p" "body")))) 1.21 1.22 (defun yahtml-intelligent-newline-script () 1.23 (let ((p (point)) b) 1.24 @@ -3139,6 +3140,9 @@ 1.25 (defun yahtml-intelligent-newline-iframe () 1.26 (insert "<p>Your browser does not support iframes.</p>")) 1.27 1.28 +(defun yahtml-intelligent-newline-details () 1.29 + (yahtml-intelligent-newline-head "summary")) 1.30 + 1.31 ;;; ---------- Marking ---------- 1.32 (defun yahtml-mark-begend () 1.33 "Mark current tag"
