Xah Talk Show 2024-05-03 Ep551 Emacs Lisp Coding, html add related box
- Timestamp
- 04:11 task 1, xahhtml-add-related-box
- 14:07 writing html manually
- 16:29 fix linkify path with query string
- 39:38 order of query string and hash fragment
- 46:29 correction. the xah-cite code is correct.
- task 1. emacs lisp, html, write command to warp div.rltd box to current text block.
(defun xahhtml-add-related-box () "add a html div tag with class name rltd, to current text block. Version: 2024-05-03" (interactive) (let (xp1 xp2 xtext) (seq-setq (xp1 xp2) (xah-get-pos-of-block-or)) (setq xtext (buffer-substring-no-properties xp1 xp2)) (delete-region xp1 xp2) (insert "<div class=\"rltd\">\n" xtext "\n</div>")))
task 2. fix this function xah-html-local-file-to-link. When a local file link contains a query string, you need to first remove the query string, then link the file, then add back the query string.
e.g.
file:///C:/Users/xah/web/xahlee_info/comp/unicode_index.html?q=power+-tel