Function: htmlize-many-files
htmlize-many-files is an autoloaded, interactive and byte-compiled
function defined in htmlize.el.
Signature
(htmlize-many-files FILES &optional TARGET-DIRECTORY)
Documentation
Convert FILES to HTML and save the corresponding HTML versions.
FILES should be a list of file names to convert. This function calls
htmlize-file on each file; see that function for details. When
invoked interactively, you are prompted for a list of files to convert,
terminated with RET.
If TARGET-DIRECTORY is specified, the HTML files will be saved to that directory. Normally, each HTML file is saved to the directory of the corresponding source file.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
;;;###autoload
(defun htmlize-many-files (files &optional target-directory)
"Convert FILES to HTML and save the corresponding HTML versions.
FILES should be a list of file names to convert. This function calls
`htmlize-file' on each file; see that function for details. When
invoked interactively, you are prompted for a list of files to convert,
terminated with RET.
If TARGET-DIRECTORY is specified, the HTML files will be saved to that
directory. Normally, each HTML file is saved to the directory of the
corresponding source file."
(interactive
(list
(let (list file)
;; Use empty string as DEFAULT because setting DEFAULT to nil
;; defaults to the directory name, which is not what we want.
(while (not (equal (setq file (read-file-name
"HTML-ize file (RET to finish): "
(and list (file-name-directory
(car list)))
"" t))
""))
(push file list))
(nreverse list))))
;; Verify that TARGET-DIRECTORY is indeed a directory. If it's a
;; file, htmlize-file will use it as target, and that doesn't make
;; sense.
(and target-directory
(not (file-directory-p target-directory))
(error "target-directory must name a directory: %s" target-directory))
(dolist (file files)
(htmlize-file file target-directory)))