Browse Source

Allow to turn off the default style.

Carsten Dominik 16 years ago
parent
commit
73d6659faa
2 changed files with 28 additions and 9 deletions
  1. 12 6
      doc/org.texi
  2. 16 3
      lisp/org-exp.el

+ 12 - 6
doc/org.texi

@@ -7667,18 +7667,23 @@ document - your style specifications may change these:
 @end example
 
 Each exported files contains a compact default style that defines these
-classes in a basic way.  You may overwrite these settings, or add to them by
-using the variables @code{org-export-html-style} (for Org-wide settings) and
-@code{org-export-html-style-extra} (for more granular settings, like
-file-local settings).  To set the latter variable individually for each
-file, you can use
+classes in a basic way@footnote{This style is defined in the constant
+@code{org-export-html-style-default}, which you should not modify.  To turn
+inclusion of these defaults off, customize
+@code{org-export-html-style-include-default}}.  You may overwrite these
+settings, or add to them by using the variables @code{org-export-html-style}
+(for Org-wide settings) and @code{org-export-html-style-extra} (for more
+granular settings, like file-local settings).  To set the latter variable
+individually for each file, you can use
 
 @example
 #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
 @end example
 
 @noindent
-For longer style definitions, you can use several such lines.
+For longer style definitions, you can use several such lines.  You could also
+directly write a @code{<style>} @code{</style>} section in this way, without
+referring to an external file.
 
 @c FIXME: More about header and footer styles
 @c FIXME: Talk about links and targets.
@@ -8093,6 +8098,7 @@ respective variable for details.
 @item @code{:tags}                  @tab @code{org-export-with-tags}
 @item @code{:tables}                @tab @code{org-export-with-tables}
 @item @code{:table-auto-headline}   @tab @code{org-export-highlight-first-table-line}
+@item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
 @item @code{:style}                 @tab @code{org-export-html-style}
 @item @code{:style-extra}           @tab @code{org-export-html-style-extra}
 @item @code{:convert-org-links}     @tab @code{org-export-html-link-org-files-as-html}

+ 16 - 3
lisp/org-exp.el

@@ -522,7 +522,19 @@ Org-mode file."
 </style>"
   "The default style specification for exported HTML files.
 Please use the variables `org-export-html-style' and
-`org-export-html-style-extra' to add to this style.")
+`org-export-html-style-extra' to add to this style.  If you wish to not
+have the default style included, customize the variable
+`org-export-html-style-include-default'.")
+
+(defcustom org-export-html-style-include-default t
+  "Non-nil means, include the default style in exported HTML files.
+The actualy style is defined in `org-export-html-style-default' and should
+not be modified.  Use the variables `org-export-html-style' to add
+your own style information."
+  :group 'org-export-html
+  :type 'boolean)
+;;;###autoload
+(put 'org-export-html-style 'safe-local-variable 'booleanp)
 
 (defcustom org-export-html-style ""
   "Org-wide style definitions for exported HTML files.
@@ -812,6 +824,7 @@ or if they are only using it locally."
     (:time-stamp-file      . org-export-time-stamp-file)
     (:tables               . org-export-with-tables)
     (:table-auto-headline  . org-export-highlight-first-table-line)
+    (:style-include-default . org-export-html-style-include-default)
     (:style                . org-export-html-style)
     (:style-extra          . org-export-html-style-extra)
     (:agenda-style         . org-agenda-export-html-style)
@@ -2802,8 +2815,8 @@ PUB-DIR is set, use this as the publishing directory."
 	   (org-combine-plists (org-default-export-plist)
 			       ext-plist
 			       (org-infile-export-plist))))
-
-	 (style (concat org-export-html-style-default
+	 (style (concat (if (plist-get opt-plist :style-include-default)
+			    org-export-html-style-default)
 			(plist-get opt-plist :style)
 			(plist-get opt-plist :style-extra)))
 	 (html-extension (plist-get opt-plist :html-extension))