org-html-htmlize-generate-css: Do not omit faces without :inherit property

* lisp/ox-html.el (org-html-htmlize-generate-css): Fix not adding
faces without :inherit property to the generated css.  Update the
docstring, detailing that the css class names are the face names with
`org-html-htmlize-font-prefix' prepended.
This commit is contained in:
Ihor Radchenko 2024-04-04 14:17:27 +03:00
parent 0f11d21cb6
commit c8d1338365
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 7 additions and 3 deletions

View File

@ -1828,6 +1828,9 @@ This command just produces a buffer that contains class definitions for all
faces used in the current Emacs session. You can copy and paste the ones you faces used in the current Emacs session. You can copy and paste the ones you
need into your CSS file. need into your CSS file.
The face definitions are prepended with
`org-html-htmlize-font-prefix'.
If you then set `org-html-htmlize-output-type' to `css', calls If you then set `org-html-htmlize-output-type' to `css', calls
to the function `org-html-htmlize-region-for-paste' will to the function `org-html-htmlize-region-for-paste' will
produce code that uses these same face definitions." produce code that uses these same face definitions."
@ -1836,11 +1839,12 @@ produce code that uses these same face definitions."
(and (get-buffer "*html*") (kill-buffer "*html*")) (and (get-buffer "*html*") (kill-buffer "*html*"))
(with-temp-buffer (with-temp-buffer
(let ((fl (face-list)) (let ((fl (face-list))
(htmlize-css-name-prefix "org-") (htmlize-css-name-prefix org-html-htmlize-font-prefix)
(htmlize-output-type 'css) (htmlize-output-type 'css)
f i) f i)
(while (setq f (pop fl) (while fl
i (and f (face-attribute f :inherit))) (setq f (pop fl)
i (and f (face-attribute f :inherit)))
(when (and (symbolp f) (or (not i) (not (listp i)))) (when (and (symbolp f) (or (not i) (not (listp i))))
(insert (org-add-props (copy-sequence "1") nil 'face f)))) (insert (org-add-props (copy-sequence "1") nil 'face f))))
(htmlize-region (point-min) (point-max)))) (htmlize-region (point-min) (point-max))))