From: Steve Youngs Date: Wed, 15 Apr 2020 08:26:55 +0000 (+1000) Subject: Tweak my htmlize code in prep for adding my inits to SXEmacs website. X-Git-Url: http://cgit.sxemacs.org/?p=syinit;a=commitdiff_plain;h=8f49674691c81118af696afe31b0302625ff30c8 Tweak my htmlize code in prep for adding my inits to SXEmacs website. * 07-html.el (sy-htmlize-appendix): Remove the Valid CSS Add 'target' to links Don't use 'uri=referer'. Use a URL instead. (url-hexify-string): Autoload it. (sy-htmlize-append): Compute the URL to use in the Valid XHTML validation URL. Signed-off-by: Steve Youngs --- diff --git a/07-html.el b/07-html.el index 40d121d..10155ba 100644 --- a/07-html.el +++ b/07-html.el @@ -5,7 +5,7 @@ ;; Author: Steve Youngs ;; Maintainer: Steve Youngs ;; Created: <2007-12-02> -;; Time-stamp: +;; Time-stamp: ;; Download: ;; HTMLised: ;; Git Repo: git clone https://git.sxemacs.org/syinit @@ -185,36 +185,38 @@ html tag. Done via `htmlize-after-hook'." (replace-match ""))) -;; I know that the pages generated by `htmlize.el' are valid HTML/CSS and +;; I know that the pages generated by `htmlize.el' are valid HTML and ;; are created by SXEmacs. So I announce the fact by adding the appropriate ;; logos to the bottom of the page, together with a copyright notice. This ;; is the raw HTML for that. -(defconst sy-htmlize-appendix +;; Used to have valid CSS as well but that is way too much mucking +;; about to get the validator to work from within an iframe. In case +;; you are wondering, the CSS produced from htmlize is definitely +;; valid. +;; +;; \"Valid +;; +(defvar sy-htmlize-appendix (concat " - - +
Copyright © " (format-time-string "%Y") " Steve Youngs
@@ -228,11 +230,15 @@ html tag. Done via `htmlize-after-hook'." )) ;; Appends the above to each page. Run from `htmlize-after-hook'. +(autoload 'url-hexify-string "url-util") (defun sy-htmlize-append () "Append some things to the end of files produced by `htmlize.el'." - (goto-char (point-max)) - (re-search-backward "" nil t) - (insert sy-htmlize-appendix)) + (let ((html (url-hexify-string + (concat "https://www.sxemacs.org/SYinits/" + (buffer-name))))) + (goto-char (point-max)) + (re-search-backward "" nil t) + (insert (format sy-htmlize-appendix html)))) ;; Set a couple of basic things. (setq