Browse Source

ox-html.el (org-html-scripts, org-html-style-default): Use defcustom

* ox-html.el (org-html-scripts, org-html-style-default): Turn
into configurable options.
Bastien Guerry 4 years ago
parent
commit
a51c0f22b8
2 changed files with 15 additions and 4 deletions
  1. 5 0
      etc/ORG-NEWS
  2. 10 4
      lisp/ox-html.el

+ 5 - 0
etc/ORG-NEWS

@@ -109,6 +109,11 @@ By default ox-html now inlines webp images.
 
 
 This is the CSS class name to use for the top level content wrapper.
 This is the CSS class name to use for the top level content wrapper.
 
 
+*** You can now configure ~org-html-scripts~ and ~org-html-style-default~
+
+~org-html-scripts~ and ~org-html-style-default~ used to be constants,
+you can now configure them.
+
 *** Some faces now use fixed-pitch
 *** Some faces now use fixed-pitch
 
 
 See https://orgmode.org/list/875z8njaol.fsf@protesilaos.com.
 See https://orgmode.org/list/875z8njaol.fsf@protesilaos.com.

+ 10 - 4
lisp/ox-html.el

@@ -232,7 +232,7 @@ property on the headline itself.")
     ("\\.\\.\\." . "…"))		; hellip
     ("\\.\\.\\." . "…"))		; hellip
   "Regular expressions for special string conversion.")
   "Regular expressions for special string conversion.")
 
 
-(defconst org-html-scripts
+(defcustom org-html-scripts
   "<script type=\"text/javascript\">
   "<script type=\"text/javascript\">
 // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
 // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
      function CodeHighlightOn(elem, id)
      function CodeHighlightOn(elem, id)
@@ -255,9 +255,12 @@ property on the headline itself.")
      }
      }
 // @license-end
 // @license-end
 </script>"
 </script>"
-  "Basic JavaScript that is needed by HTML files produced by Org mode.")
+  "Basic JavaScript that is needed by HTML files produced by Org mode."
+  :group 'org-export-html
+  :package-version '(Org . "9.5")
+  :type 'string)
 
 
-(defconst org-html-style-default
+(defcustom org-html-style-default
   "<style type=\"text/css\">
   "<style type=\"text/css\">
   #content { max-width: 60em; margin: auto; }
   #content { max-width: 60em; margin: auto; }
   .title  { text-align: center;
   .title  { text-align: center;
@@ -444,7 +447,10 @@ property on the headline itself.")
   "The default style specification for exported HTML files.
   "The default style specification for exported HTML files.
 You can use `org-html-head' and `org-html-head-extra' to add to
 You can use `org-html-head' and `org-html-head-extra' to add to
 this style.  If you don't want to include this default style,
 this style.  If you don't want to include this default style,
-customize `org-html-head-include-default-style'.")
+customize `org-html-head-include-default-style'."
+  :group 'org-export-html
+  :package-version '(Org . "9.5")
+  :type 'string)
 
 
 
 
 ;;; User Configuration Variables
 ;;; User Configuration Variables