0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00

Delete htmlize.el from Org’s contrib directory

* lisp/ox-org.el (org-org-publish-to-org):
* lisp/ox-html.el (org-html-htmlize-generate-css):
(org-html-fontify-code):
* lisp/org-agenda.el (org-agenda-write): Throw an error
requesting the user to install htmlize.el.

* doc/org.texi (Exporting agenda views, Literal examples):
Don’t assume htmlize.el is available.

You need to install it from https://github.com/hniksic/emacs-htmlize

See https://github.com/hniksic/emacs-htmlize/issues/7 for this issue.
This commit is contained in:
Bastien 2017-08-18 09:54:19 +02:00
parent 90986a8e2f
commit d0ced98943
5 changed files with 20 additions and 1938 deletions

File diff suppressed because it is too large Load diff

View file

@ -9687,8 +9687,9 @@ See the docstring of the variable for more information.
If you are away from your computer, it can be very useful to have a printed If you are away from your computer, it can be very useful to have a printed
version of some agenda views to carry around. Org mode can export custom version of some agenda views to carry around. Org mode can export custom
agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's agenda views as plain text, HTML@footnote{You need to install
@file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the @file{htmlize.el} from @uref{https://github.com/hniksic/emacs-htmlize,Hrvoje
Niksic's repository.}, Postscript, PDF@footnote{To create PDF output, the
ghostscript @file{ps2pdf} utility must be installed on the system. Selecting ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
a PDF file will also create the postscript file.}, and iCalendar files. If a PDF file will also create the postscript file.}, and iCalendar files. If
you want to do this only occasionally, use the command you want to do this only occasionally, use the command
@ -9750,13 +9751,13 @@ or absolute.
@end lisp @end lisp
The extension of the file name determines the type of export. If it is The extension of the file name determines the type of export. If it is
@file{.html}, Org mode will use the @file{htmlize.el} package to convert @file{.html}, Org mode will try to use the @file{htmlize.el} package to
the buffer to HTML and save it to this file name. If the extension is convert the buffer to HTML and save it to this file name. If the extension
@file{.ps}, @code{ps-print-buffer-with-faces} is used to produce is @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
Postscript output. If the extension is @file{.ics}, iCalendar export is Postscript output. If the extension is @file{.ics}, iCalendar export is run
run export over all files that were used to construct the agenda, and export over all files that were used to construct the agenda, and limit the
limit the export to entries listed in the agenda. Any other export to entries listed in the agenda. Any other extension produces a plain
extension produces a plain ASCII file. ASCII file.
The export files are @emph{not} created when you use one of those The export files are @emph{not} created when you use one of those
commands interactively because this might use too much overhead. commands interactively because this might use too much overhead.
@ -10064,7 +10065,7 @@ If the example is source code from a programming language, or any other text
that can be marked up by font-lock in Emacs, you can ask for the example to that can be marked up by font-lock in Emacs, you can ask for the example to
look like the fontified Emacs buffer@footnote{This works automatically for look like the fontified Emacs buffer@footnote{This works automatically for
the HTML back-end (it requires version 1.34 of the @file{htmlize.el} package, the HTML back-end (it requires version 1.34 of the @file{htmlize.el} package,
which is distributed with Org). Fontified code chunks in @LaTeX{} can be which you need to install). Fontified code chunks in @LaTeX{} can be
achieved using either the achieved using either the
@url{https://www.ctan.org/tex-archive/macros/latex/contrib/listings/?lang=en, listings,} @url{https://www.ctan.org/tex-archive/macros/latex/contrib/listings/?lang=en, listings,}
or the or the

View file

@ -3410,7 +3410,8 @@ the agenda to write."
(kill-buffer (current-buffer)) (kill-buffer (current-buffer))
(message "Org file written to %s" file))) (message "Org file written to %s" file)))
((member extension '("html" "htm")) ((member extension '("html" "htm"))
(require 'htmlize) (or (require 'htmlize nil t)
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
(set-buffer (htmlize-buffer (current-buffer))) (set-buffer (htmlize-buffer (current-buffer)))
(when org-agenda-export-html-style (when org-agenda-export-html-style
;; replace <style> section with org-agenda-export-html-style ;; replace <style> section with org-agenda-export-html-style

View file

@ -1743,7 +1743,8 @@ 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."
(interactive) (interactive)
(require 'htmlize) (or (require 'htmlize nil t)
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
(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))
@ -2165,7 +2166,9 @@ is the language used for CODE, as a string, or nil."
;; Simple transcoding. ;; Simple transcoding.
(org-html-encode-plain-text code)) (org-html-encode-plain-text code))
;; Case 2: No htmlize or an inferior version of htmlize ;; Case 2: No htmlize or an inferior version of htmlize
((not (and (require 'htmlize nil t) (fboundp 'htmlize-region-for-paste))) ((not (and (or (require 'htmlize nil t)
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
(fboundp 'htmlize-region-for-paste)))
;; Emit a warning. ;; Emit a warning.
(message "Cannot fontify src block (htmlize.el >= 1.34 required)") (message "Cannot fontify src block (htmlize.el >= 1.34 required)")
;; Simple transcoding. ;; Simple transcoding.

View file

@ -312,7 +312,8 @@ publishing directory.
Return output file name." Return output file name."
(org-publish-org-to 'org filename ".org" plist pub-dir) (org-publish-org-to 'org filename ".org" plist pub-dir)
(when (plist-get plist :htmlized-source) (when (plist-get plist :htmlized-source)
(require 'htmlize) (or (require 'htmlize nil t)
(error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
(require 'ox-html) (require 'ox-html)
(let* ((org-inhibit-startup t) (let* ((org-inhibit-startup t)
(htmlize-output-type 'css) (htmlize-output-type 'css)