emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Subject: Publishing HTML with style sheets
Date: Sun, 10 Aug 2008 11:14:42 -0400	[thread overview]
Message-ID: <8763q8uckd.fsf@gollum.intra.norang.ca> (raw)

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 "<link rel=\"stylesheet\"
|                   href=\"/org.css\"
|                   type=\"text/css\">"
| 	 :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-<f12>") '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

                 reply	other threads:[~2008-08-10 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=8763q8uckd.fsf@gollum.intra.norang.ca \
    --to=bernt@norang.ca \
    --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).