Function: org-html--build-meta-info

org-html--build-meta-info is a byte-compiled function defined in ox-html.el.gz.

Signature

(org-html--build-meta-info INFO)

Documentation

Return meta tags for exported document.

INFO is a plist used as a communication channel.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-html.el.gz
(defun org-html--build-meta-info (info)
  "Return meta tags for exported document.
INFO is a plist used as a communication channel."
  (let* ((title (org-html-plain-text
		 (org-element-interpret-data (plist-get info :title)) info))
	 ;; Set title to an invisible character instead of leaving it
	 ;; empty, which is invalid.
	 (title (if (org-string-nw-p title) title "‎"))
	 (charset (or (and org-html-coding-system
			   (symbol-name
			    (coding-system-get org-html-coding-system
					       'mime-charset)))
		      "iso-8859-1")))
    (concat
     (when (plist-get info :time-stamp-file)
       (format-time-string
	(concat "<!-- "
		(plist-get info :html-metadata-timestamp-format)
		" -->\n")))

     (if (org-html-html5-p info)
	 (org-html--build-meta-entry "charset" charset)
       (org-html--build-meta-entry "http-equiv" "Content-Type"
				   (concat "text/html;charset=" charset)))

     (let ((viewport-options
	    (cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell)))
			      (plist-get info :html-viewport))))
       (if viewport-options
	   (org-html--build-meta-entry "name" "viewport"
				       (mapconcat
					(lambda (elm)
                                          (format "%s=%s" (car elm) (cadr elm)))
					viewport-options ", "))))

     (format "<title>%s</title>\n" title)

     (mapconcat
      (lambda (args) (apply #'org-html--build-meta-entry args))
      (delq nil (if (functionp org-html-meta-tags)
		    (funcall org-html-meta-tags info)
		  org-html-meta-tags))
      ""))))