浏览代码

HTML export: New option to turn off Javascript inclusion

It is now possible to turn off the inclusion of any javascript into
the HTML file.
Carsten Dominik 16 年之前
父节点
当前提交
6d6a7cb916
共有 2 个文件被更改,包括 19 次插入1 次删除
  1. 8 0
      lisp/ChangeLog
  2. 11 1
      lisp/org-exp.el

+ 8 - 0
lisp/ChangeLog

@@ -1,3 +1,11 @@
+2009-03-07  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-exp.el (org-export-html-style-include-scripts): New option.
+	(org-export-plist-vars): Add new option
+	`org-export-html-style-include-scripts'.
+	(org-export-as-html): Honor new option
+	`org-export-html-style-include-scripts'.
+
 2009-03-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-publish.el (org-publish-attachment): Only copy file when the

+ 11 - 1
lisp/org-exp.el

@@ -535,6 +535,13 @@ in this way, it will be wrapped."
   :group 'org-export-html
   :type '(string :tag "File or URL"))
 
+(defcustom org-export-html-style-include-scripts t
+  "Non-nil means, include the javascript snippets in exported HTML files.
+The actual script is defined in `org-export-html-scripts' and should
+not be modified."
+  :group 'org-export-html
+  :type 'boolean)
+
 (defconst org-export-html-scripts
 "<script type=\"text/javascript\">
 <!--/*--><![CDATA[/*><!--*/
@@ -943,6 +950,7 @@ or if they are only using it locally."
     (:tables		      "|"	  org-export-with-tables)
     (:table-auto-headline     nil	  org-export-highlight-first-table-line)
     (:style-include-default   nil	  org-export-html-style-include-default)
+    (:style-include-scripts   nil	  org-export-html-style-include-scripts)
     (:style		      nil	  org-export-html-style)
     (:style-extra	      nil	  org-export-html-style-extra)
     (:agenda-style	      nil	  org-agenda-export-html-style)
@@ -3318,7 +3326,9 @@ PUB-DIR is set, use this as the publishing directory."
 			    org-export-html-style-default)
 			(plist-get opt-plist :style)
 			(plist-get opt-plist :style-extra)
-			"\n" org-export-html-scripts))
+			"\n"
+			(if (plist-get opt-plist :style-include-scripts)
+			    org-export-html-scripts)))
 	 (html-extension (plist-get opt-plist :html-extension))
 	 (link-validate (plist-get opt-plist :link-validation-function))
 	 valid thetoc have-headings first-heading-pos