emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: html-preamble doesn't work with a function [8.3.2 (8.3.2-39


From: Robert Klein
Subject: Re: [O] Bug: html-preamble doesn't work with a function [8.3.2 (8.3.2-39-gd537a3-elpa @ /home/pillow/.emacs.d/elpa/org-20151123/)]
Date: Tue, 15 Dec 2015 14:14:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

Hi,

I only use a function name, e.g.

(defun my-html-preamble (options)
        "my preamble")

and

(setq org-publish-project-alist
      '(
        ("org-notes"
         :base-directory "~/org/"
         :base-extension "org"
         :publishing-directory "~/public_html/"
         :recursive t
         :publishing-function org-html-publish-to-html
         :html-preamble my-html-preamble)))

Does this work for you?

Best regards
Robert


On 12/12/2015 08:26 PM, Pillow Kuda Sai wrote:
> My setup:
> ;;; Minimal setup to load latest 'org-mode'
> ;; activate debugging
> (setq debug-on-error t
>       debug-on-signal nil
>       debug-on-quit nil)
> 
> ;; add latest org-mode to load path
> (add-to-list 'load-path (expand-file-name "~/.emacs.d/elpa/org-20151123/"))
> (add-to-list 'load-path (expand-file-name
> "~/.emacs.d/elpa/org-20151123/" t))
> 
> What I did:
> (require 'ox-publish)
> (setq org-publish-project-alist
>       '(
>       ("org-notes"
>        :base-directory "~/org/"
>        :base-extension "org"
>        :publishing-directory "~/public_html/"
>        :recursive t
>        :publishing-function org-html-publish-to-html
>        :headline-levels 4             ; Just the default for this project.
>        :auto-preamble t
>        ;; :html-preamble "Howdy" ; does work
>        :html-preamble (concat "Howdy")
>        )
>       ("org-static"
>        :base-directory "~/org/"
>        :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
>        :publishing-directory "~/public_html/"
>        :recursive t
>        :publishing-function org-publish-attachment
>        )
>       ("org" :components ("org-notes" "org-static"))))
> 
> What I expected: All off the above code is from
> http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.html
> except for the :html-preamble part. I want to add my own preamble by
> using a function. :html-preamble sets org-html-preamble (the options
> are: nil, t, string, function that must return a string). When using a
> string (:html-preamble "Howdy") it works. When using a function that
> returns a string (:html-preamble (concat "Howdy")) it doesn't work.
> 
> I'm not entirely sure if this is a bug or if I'm missing something but
> hopefully the mailing-list can help me out :)
> 
> Thanks in advance, Pillow
> ------------------------------------------------------------------------
> 
> 
> 
> Emacs  : GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
>  of 2015-10-09
> Package: Org-mode version 8.3.2 (8.3.2-39-gd537a3-elpa @
> /home/pillow/.emacs.d/elpa/org-20151123/)
> 
> current state:
> ==============
> (setq
>  org-src-lang-modes '(("ocaml" . tuareg) ("elisp" . emacs-lisp) ("ditaa"
> . artist) ("asymptote" . asy)
>                     ("dot" . fundamental) ("sqlite" . sql) ("calc" . 
> fundamental)
> ("C" . c) ("cpp" . c++)
>                     ("C++" . c++) ("screen" . shell-script))
>  org-tab-first-hook '(org-hide-block-toggle-maybe
> org-src-native-tab-command-maybe
>                     org-babel-hide-result-toggle-maybe 
> org-babel-header-arg-expand)
>  org-sparse-tree-default-date-type 'scheduled-or-deadline
>  org-latex-default-packages-alist '(("AUTO" "inputenc" t) ("T1"
> "fontenc" t) ("" "fixltx2e" nil) ("" "graphicx" t)
>                                   ("" "longtable" nil) ("" "float" nil) ("" 
> "wrapfig" nil) (""
> "rotating" nil)
>                                   ("normalem" "ulem" t) ("" "amsmath" t) ("" 
> "textcomp" t) (""
> "marvosym" t)
>                                   ("" "wasysym" t) ("" "amssymb" t) ("" 
> "hyperref" nil)
> "\\tolerance=1000")
>  org-speed-command-hook '(org-speed-command-default-hook
> org-babel-speed-command-hook)
>  org-occur-hook '(org-first-headline-recenter)
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  org-html-format-drawer-function '(lambda (name contents) contents)
>  org-clock-into-drawer nil
>  org-latex-format-inlinetask-function 'ignore
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
>  org-latex-text-markup-alist '((bold . "\\textbf{%s}") (code . verb)
> (italic . "\\emph{%s}")
>                              (strike-through . "\\sout{%s}") (underline . 
> "\\uline{%s}")
>                              (verbatim . protectedtexttt))
>  org-latex-format-headline-function
> 'org-latex-format-headline-default-function
>  org-after-todo-state-change-hook '(org-clock-out-if-current)
>  org-latex-format-drawer-function '(lambda (name contents) contents)
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> org-src-mode-configure-edit-buffer)
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-html-allow-name-attribute-in-anchors t
>  org-latex-logfiles-extensions '("aux" "idx" "log" "out" "toc" "nav"
> "snm" "vrb")
>  org-export-copy-to-kill-ring 'if-interactive
>  org-mode-hook '(#[nil "\300\301\302\303\304$\207"
>                  [org-add-hook change-major-mode-hook org-show-block-all 
> append
> local] 5]
>                #[nil "\300\301\302\303\304$\207"
>                  [org-add-hook change-major-mode-hook 
> org-babel-show-result-all
> append local] 5]
>                org-babel-result-hide-spec org-babel-hide-all-hashes)
>  org-archive-hook '(org-attach-archive-delete-maybe)
>  org-ascii-format-drawer-function '(lambda (name contents width) contents)
>  org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
> org-babel-execute-safely-maybe)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees
> org-cycle-hide-drawers org-cycle-hide-inline-tasks
>                 org-cycle-show-empty-lines 
> org-optimize-window-after-visibility-change)
>  org-html-mathjax-template "<script type=\"text/javascript\"
> src=\"%PATH\"></script>\n<script
> type=\"text/javascript\">\n<!--/*--><![CDATA[/*><!--*/\n
> MathJax.Hub.Config({\n        // Only one of the two following lines,
> depending on user settings\n        // First allows browser-native
> MathML display, second forces HTML/CSS\n        :MMLYES: config:
> [\"MMLorHTML.js\"], jax: [\"input/TeX\"],\n        :MMLNO: jax:
> [\"input/TeX\", \"output/HTML-CSS\"],\n        extensions:
> [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",\n
>         \"TeX/noUndefined.js\"],\n        tex2jax: {\n
> inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],\n            displayMath: [
> ['$$','$$'], [\"\\\\[\",\"\\\\]\"],
> [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],\n
> skipTags:
> [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],\n
>         ignoreClass: \"tex2jax_ignore\",\n            processEscapes:
> false,\n            processEnvironments: true,\n            preview:
> \"TeX\"\n        },\n        showProcessingMessages: true,\n
> displayAlign: \"%ALIGN\",\n        displayIndent: \"%INDENT\",\n\n
>   \"HTML-CSS\": {\n             scale: %SCALE,\n
> availableFonts: [\"STIX\",\"TeX\"],\n             preferredFont:
> \"TeX\",\n             webFont: \"TeX\",\n             imageFont:
> \"TeX\",\n             showMathMenu: true,\n        },\n
> MMLorHTML: {\n             prefer: {\n                 MSIE:
> \"MML\",\n                 Firefox: \"MML\",\n                 Opera:
> \"HTML\",\n                 other:   \"HTML\"\n             }\n
> }\n    });\n/*]]>*///-->\n</script>"
>  org-html-mathjax-options '((path
> "http://orgmode.org/mathjax/MathJax.js";) (scale "100") (align "center")
>                           (indent "2em") (mathml nil))
>  org-export-with-creator 'comment
>  org-html-creator-string "<a
> href=\"http://www.gnu.org/software/emacs/\";>Emacs</a> 25.0.50.2 (<a
> href=\"http://orgmode.org\";>Org</a> mode 8.2.10)"
>  org-latex-with-hyperref "\\hypersetup{\n pdfauthor={%a},\n
> pdftitle={%t},\n pdfkeywords={%k},\n pdfsubject={%d},\n pdfcreator={%c},
> \n pdflang={%L}}\n"
>  org-timer-default-timer 0
>  org-babel-process-comment-text 'org-babel-trim
>  org-babel-tangle-lang-exts '(("emacs-lisp" . "el"))
>  org-confirm-elisp-link-function 'yes-or-no-p
>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-latex-listings-langs '((emacs-lisp "Lisp") (lisp "Lisp") (clojure
> "Lisp") (c "C") (cc "C++")
>                           (fortran "fortran") (perl "Perl") (cperl "Perl") 
> (python
> "Python") (ruby "Ruby")
>                           (html "HTML") (xml "XML") (tex "TeX") (latex 
> "[LaTeX]TeX")
> (shell-script "bash")
>                           (gnuplot "Gnuplot") (ocaml "Caml") (caml "Caml") 
> (sql "SQL")
> (sqlite "sql"))
>  org-effort-durations '(("h" . 60) ("d" . 480) ("w" . 2400) ("m" . 9600)
> ("y" . 96000))
>  org-html-format-headline-function 'ignore
>  org-structure-template-alist '(("s" "#+BEGIN_SRC ?\n\n#+END_SRC" "<src
> lang=\"?\">\n\n</src>")
>                               ("e" "#+BEGIN_EXAMPLE\n?\n#+END_EXAMPLE" 
> "<example>\n?\n</example>")
>                               ("q" "#+BEGIN_QUOTE\n?\n#+END_QUOTE" 
> "<quote>\n?\n</quote>")
>                               ("v" "#+BEGIN_VERSE\n?\n#+END_VERSE" 
> "<verse>\n?\n</verse>")
>                               ("V" "#+BEGIN_VERBATIM\n?\n#+END_VERBATIM" 
> "<verbatim>\n?\n</verbatim>")
>                               ("c" "#+BEGIN_CENTER\n?\n#+END_CENTER" 
> "<center>\n?\n</center>")
>                               ("l" "#+BEGIN_LaTeX\n?\n#+END_LaTeX" "<literal
> style=\"latex\">\n?\n</literal>")
>                               ("L" "#+LaTeX: " "<literal 
> style=\"latex\">?</literal>")
>                               ("h" "#+BEGIN_HTML\n?\n#+END_HTML" "<literal
> style=\"html\">\n?\n</literal>")
>                               ("H" "#+HTML: " "<literal 
> style=\"html\">?</literal>")
>                               ("a" "#+BEGIN_ASCII\n?\n#+END_ASCII" "") ("A" 
> "#+ASCII: " "")
>                               ("i" "#+INDEX: ?" "#+INDEX: ?")
>                               ("I" "#+INCLUDE: %file ?" "<include file=%file 
> markup=\"?\">"))
>  org-export-creator-string "Emacs 25.0.50.2 (Org mode 8.2.10)"
>  org-html-format-inlinetask-function 'ignore
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-src-fontify-natively nil
>  org-publish-project-alist '(("org-notes" :base-directory "~/org/"
> :base-extension "org" :publishing-directory
>                             "~/public_html/" :recursive t :publishing-function
> org-html-publish-to-html
>                             :headline-levels 4 :auto-preamble t 
> :html-preamble (concat
> "Howdy"))
>                            ("org-static" :base-directory "~/org/" 
> :base-extension
>                             
> "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
> :publishing-directory
>                             "~/public_html/" :recursive t :publishing-function
> org-publish-attachment)
>                            ("org" :components ("org-notes" "org-static")))
>  )
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]