From 4cb861303e3b8cf986cf41748e86b10f8f4c52af Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Fri, 19 Aug 2011 01:44:19 +0530 Subject: [PATCH 2/6] htmlfontify.el: Add new output option - `body-text-only' * contrib/lisp/htmlfontify.el (hfy-optimisations): Define new option `body-text-only' (hfy-fontify-buffer): Honor above setting. --- contrib/lisp/htmlfontify.el | 34 ++++++++++++++++++++++------------ 1 files changed, 22 insertions(+), 12 deletions(-) diff --git a/contrib/lisp/htmlfontify.el b/contrib/lisp/htmlfontify.el index c8e9558..5415e58 100755 --- a/contrib/lisp/htmlfontify.el +++ b/contrib/lisp/htmlfontify.el @@ -450,6 +450,12 @@ and so on." keep-overlays : More of a bell (or possibly whistle) than an optimization - If on, preserve overlay highlighting (cf ediff or goo-font-lock) as well as basic faces.\n + body-text-only : Emit only body-text. In concrete terms, + 1. Suppress calls to `hfy-page-header'and + `hfy-page-footer' + 2. Pretend that `div-wrapper' option above is + turned off + 3. Don't enclose output in
 
tags And the following are planned but not yet available:\n kill-context-leak : Suppress hyperlinking between files highlighted by different modes.\n @@ -463,7 +469,8 @@ which can never slow you down, but may result in incomplete fontification." (const :tag "skip-refontification" skip-refontification) (const :tag "kill-context-leak" kill-context-leak ) (const :tag "div-wrapper" div-wrapper ) - (const :tag "keep-overlays" keep-overlays )) + (const :tag "keep-overlays" keep-overlays ) + (const :tag "body-text-only" body-text-only )) :group 'htmlfontify :tag "optimizations") @@ -1697,17 +1704,20 @@ FILE, if set, is the file name." ;; so we have to do this after we use said properties: ;; (message "munging dangerous characters") (hfy-html-dekludge-buffer) - ;; insert the stylesheet at the top: - (goto-char (point-min)) - ;;(message "inserting stylesheet") - (insert (hfy-sprintf-stylesheet css-sheet file)) - (if (hfy-opt 'div-wrapper) (insert "
")) - (insert "\n
")
-    (goto-char (point-max))
-    (insert "
\n") - (if (hfy-opt 'div-wrapper) (insert "
")) - ;;(message "inserting footer") - (insert (funcall hfy-page-footer file)) + (unless (hfy-opt 'body-text-only) + ;; insert the stylesheet at the top: + (goto-char (point-min)) + + ;;(message "inserting stylesheet") + (insert (hfy-sprintf-stylesheet css-sheet file)) + + (if (hfy-opt 'div-wrapper) (insert "
")) + (insert "\n
")
+      (goto-char (point-max))
+      (insert "
\n") + (if (hfy-opt 'div-wrapper) (insert "
")) + ;;(message "inserting footer") + (insert (funcall hfy-page-footer file))) ;; call any post html-generation hooks: (run-hooks 'hfy-post-html-hooks) ;; return the html buffer -- 1.7.2.3