emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Andreas Rottmann <a.rottmann@gmx.at>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Allow functions for HTML export preamble and postamble
Date: Mon, 6 Jul 2009 18:13:44 +0200	[thread overview]
Message-ID: <5A522359-6AB3-4BE3-8B0C-5E75565350D4@gmail.com> (raw)
In-Reply-To: <87vdm9sch6.fsf@delenn.lan>

Hi Andreas,

I like the patch and have applied it.

This is on the border of something where I need a copyright assignment.
Mind to send one to the FSF?

- Carsten

On Jul 3, 2009, at 11:06 PM, Andreas Rottmann wrote:

> Hi!
>
> Well, the subject says it all -- attached is a rough patch to allow  
> more
> flexibility with the HTML export; I use it like this:
>
>    (defun rotty/homepage-preamble (opt-plist)
>      (insert "<div id=\"header\">")
>      (insert
>       "
>    <div id=\"navbar\">
>    <a class=\"menu\" href=\"/\">Home</a>
>    | <a class=\"menu\" href=\"/Writings.html\">Writings</a>
>    | <a class=\"menu\" href=\"/Software.html\">Software</a>
>    | <a class=\"menu\" href=\"/blog/\">Blog</a>
>    </div>
>    ")
>      (insert (format
>               "<h1 class=\"title\"><a href=\"/\">rotty</a> &gt; %s</ 
> h1>\n"
>               (plist-get opt-plist :title)))
>      (insert "</div>\n")
>      (insert "<div id=\"inner\">\n"))
>
> Note that this is my first real patch to org-mode, so be gentle ;-).
>
> From: Andreas Rottmann <a.rottmann@gmx.at>
> Subject: [PATCH] Allow functions for {pre/post}amble
>
>
> ---
> lisp/org-html.el |   13 +++++++++++--
> 1 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/org-html.el b/lisp/org-html.el
> index ee72065..be4ddfd 100644
> --- a/lisp/org-html.el
> +++ b/lisp/org-html.el
> @@ -606,6 +606,7 @@ PUB-DIR is set, use this as the publishing  
> directory."
> 			       (file-name-sans-extension
> 				(file-name-nondirectory buffer-file-name)))
> 			  "UNTITLED"))
> +         (custom-plist (org-combine-plists (list :title title) opt- 
> plist))
> 	 (html-table-tag (plist-get opt-plist :html-table-tag))
> 	 (quote-re0   (concat "^[ \t]*" org-quote-string "\\>"))
> 	 (quote-re    (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\ 
> \)"))
> @@ -745,7 +746,7 @@ lang=\"%s\" xml:lang=\"%s\">
> 		 date author description keywords
> 		 style))
>
> -	(insert (or (plist-get opt-plist :preamble) ""))
> +        (org-export-html-insert-plist-item opt-plist :preamble  
> custom-plist)
>
> 	(when (plist-get opt-plist :auto-preamble)
> 	  (if title (insert (format org-export-html-title-format
> @@ -1372,7 +1373,7 @@ lang=\"%s\" xml:lang=\"%s\">
>
> 	(if org-export-html-with-timestamp
> 	    (insert org-export-html-html-helper-timestamp))
> -	(insert (or (plist-get opt-plist :postamble) ""))
> +        (org-export-html-insert-plist-item opt-plist :postamble  
> custom-plist)
> 	(insert "\n</div>\n</body>\n</html>\n"))
>
>       (unless (plist-get opt-plist :buffer-will-be-killed)
> @@ -1425,6 +1426,14 @@ lang=\"%s\" xml:lang=\"%s\">
> 	    (kill-buffer (current-buffer)))
> 	(current-buffer)))))
>
> +(defun org-export-html-insert-plist-item (plist key &rest args)
> +  (let ((item (plist-get plist key)))
> +    (cond ((functionp item)
> +           (apply item args))
> +          (item
> +           (insert item)))))
> +
> +
> (defun org-export-html-format-href (s)
>   "Make sure the S is valid as a href reference in an XHTML document."
>   (save-match-data
> -- 
> tg: (0795e42..) t/html-export-amble-funtions (depends on: master)
>
> Regards, Rotty
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-07-06 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-03 21:06 [PATCH] Allow functions for HTML export preamble and postamble Andreas Rottmann
2009-07-06 16:13 ` Carsten Dominik [this message]
2009-07-07 21:21   ` Andreas Rottmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5A522359-6AB3-4BE3-8B0C-5E75565350D4@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=a.rottmann@gmx.at \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).