From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Publishing HTML with style sheets Date: Sun, 10 Aug 2008 11:14:42 -0400 Message-ID: <8763q8uckd.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSCd5-0007vR-6J for emacs-orgmode@gnu.org; Sun, 10 Aug 2008 11:14:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSCd3-0007vF-Q8 for emacs-orgmode@gnu.org; Sun, 10 Aug 2008 11:14:46 -0400 Received: from [199.232.76.173] (port=43587 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSCd3-0007vC-Kd for emacs-orgmode@gnu.org; Sun, 10 Aug 2008 11:14:45 -0400 Received: from mho-02-bos.mailhop.org ([63.208.196.179]:56814) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSCd3-0003aG-HT for emacs-orgmode@gnu.org; Sun, 10 Aug 2008 11:14:45 -0400 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.148.180] helo=mail.norang.ca) by mho-02-bos.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KSCd2-0001or-He for emacs-orgmode@gnu.org; Sun, 10 Aug 2008 15:14:44 +0000 Received: from gollum.intra.norang.ca (gollum.intra.norang.ca [192.168.1.5]) by mail.norang.ca (8.13.8/8.13.8/Debian-3) with ESMTP id m7AFEgnn026649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 10 Aug 2008 11:14:43 -0400 Received: from gollum.intra.norang.ca (localhost [127.0.0.1]) by gollum.intra.norang.ca (8.14.3/8.14.3/Debian-4) with ESMTP id m7AFEg3O005896 for ; Sun, 10 Aug 2008 11:14:42 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, I've recently converted almost all of my in-house documents to the org-publishing system. I like this system a lot. I thought I would share some of my settings with the list. I use external stylesheets for document formatting and I noticed that all of the generated HTML pages have embedded style information that I want to get rid of. I don't think it makes sense to have a specified external stylesheet for the publishing project and embedded styles in the document - you would normally just put everything in the style sheet to make the documents shorter to download. I don't want to clobber the default style with ,---- | (setq org-export-html-style-default "") `---- because I want to keep the default style for single page exports but not for projects that specify a style sheet. My current work-around for this is to clear the default style before publishing my project. Here are my publishing settings ,----[ .emacs publishing settings ] | ;; Org publishing | (setq org-publish-project-alist | '(("doc-org" | :base-directory "~/git/org/doc.norang.ca/" | :publishing-directory "/ssh:www-data@www:~/doc.norang.ca/htdocs" | :recursive t | :section_numbers nil | :table-of-contents nil | :base-extention "org" | :publishing-function org-publish-org-to-html | :style "" | :author-info nil | :creator-info nil) | ("doc-css" | :base-directory "~/git/org/doc.norang.ca/" | :publishing-directory "/ssh:www-data@www:~/doc.norang.ca/htdocs" | :base-extension "css" | :publishing-function org-publish-attachment | :recursive t | :author nil) | | ("doc" | :components("doc-org" "doc-css")) | )) `---- and I have C-M-F12 bound to a function that saves the current buffer, clears the default style, and publishes the project like this: ,---- | (defun my-save-then-publish () | (interactive) | (save-buffer) | (org-save-all-org-buffers) | (let (org-export-html-style-default) | (setq org-export-html-style-default "") | (org-publish-current-project))) | | (global-set-key (kbd "C-M-") 'my-save-then-publish) | `---- Then I just edit the org file and hit C-M-f12 and I'm done. This works great for me. -Bernt