Function: kexport:princ-cell

kexport:princ-cell is a byte-compiled function defined in kexport.el.

Signature

(kexport:princ-cell IS-PARENT SEPARATOR SOFT-NEWLINES-FLAG)

Documentation

Export the contents of a cell.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kexport.el
;;; ************************************************************************
;;; Private functions
;;; ************************************************************************

(defun kexport:princ-cell (is-parent separator soft-newlines-flag)
  "Export the contents of a cell."
  (let (contents label)
    (setq contents
          (let ((cnt1 (kcell-view:contents)))
            (concat
	     (when (string-match "\\`\\([-_$%#@~^&*=+|/A-Za-z0-9 ]+\\):.*\\S-" cnt1)
	       (format "<div id=\"%s\"></div>"
                       (replace-regexp-in-string "[ \t]" "_" (substring cnt1 0 (match-end 1)))))
	     (let ((cnt2 (kexport:html-markup cnt1)))
	       (if soft-newlines-flag
		   cnt2
                 (concat "<pre>" cnt2 "</pre>"))))))
    (setq label (kcell-view:label))
    (setq contents
          (concat "<table><tr>\n<td class=\"tdone\">\n"
                  (format "<span class=\"fas fa-chevron-down fa-fw\"%s></span>\n"
                          (if is-parent " " " style=\"visibility:hidden\""))
                  "</td>\n<td class=\"tdtwo\">"
                  (format "<span id=\"k%s\"></span>" label)
                  (format "<span id=\"k%s\"></span>" (kcell-view:idstamp))
                  (format "<pre class=\"label\">%s%s</pre>" label separator)
                  "</td>\n<td>"
                  contents
                  "</td>\n</tr>\n</table>\n"))
    (princ (format "<div class=\"%scontent\">\n%s</div>\n" (if is-parent "btn " "") contents))))