emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David O'Toole <dto@gnu.org>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Adapting org-mode to my needs
Date: Thu, 20 Apr 2006 22:31:56 -0400	[thread overview]
Message-ID: <m3vet31wwz.fsf@gnu.org> (raw)
In-Reply-To: <8ad6e8e719e192f5101f6b5f2b9d651b@science.uva.nl> (Carsten Dominik's message of "Wed, 19 Apr 2006 08:10:15 +0200")


;; Hi Carsten. In this email you'll find my thoughts on improving the
;; html export features of org-mode. 

;; Contents: 
;;         + data structure for publishing configuration info
;;         + suggestions on how to get this data into org-export
;;           functions
;;         + other suggestions I consider really important

;; It will be very easy for me to write a publish-project function
;; that converts all org files to html via your code, and also uploads
;; auxiliary images etc. to create an entire site. I just want to work
;; out our data exchange details first :-)

;; I would like to contribute this and more, as I think of stuff. I'd
;; be happy to do the required paperwork with the FSF.

;; Read on and let me know what you think.

;;;; 1. The following is an example of a data structure that users
;;      could use to define a set of publishing configurations for an
;;      entire folder full of org files.

(setq org-publish-config-plist 
      (list :orgfiles-dir "~/org"
	    :html-dir "/ssh:dto@tty.freeshell.org:~/html"
	    
	    ; we don't actually customize the full html header here.
	    ; it would need to have %s %s %s in it. instead we let
	    ; org-publish-as-html fill in the header its own way, and
	    ; allow user to customize "preamble/postamble" (see
	    ; below.) this way people can add menu across the top, or
	    ; sidebar full of links, or javascript etc, to a group of
	    ; related pages all at once, without messing with <head>
	    
	    ; inserted just after <body> tag
	    :html-preamble  "my-preamble-string"   
	    ; inserted just before </body> tag
	    :html-postamble "my-postamble-string"  

	    ; allow user to turn off the printout of author, email,
	    ; date at the top of pages. I really want this. 
	   
	    :auto-preamble nil

	    ; the following are inserted into the right places in the
	    ; real html header by org-publish-as-html

	    :style "my-css-string"
	    :language "en"
	    :author user-full-name
	    :email user-mail-address

	    ; other options that should over-ride global variables
	    ; when publishing (of course, options set per orgfile
	    ; should override everything.)

	    :headline-levels 3
	    :toc nil

	    ; can you think of more? 
	    ))


;;;; 2. How to get the above data into the HTML exporter of Org-mode:

;; The function "org-export-as-html" should accept an optional plist
;; like the one above, and should honor the values in it (subject to
;; per-file override of course).
;;
;; You can retrieve the values like this: 
;; 
;; (plist-get org-publish-config-plist :style)
;; (plist-get org-publish-config-plist :html-preamble)

;; see also (info "(elisp)Other Plists")
;;
;; It seems like most of the changes would then be in the let* section
;; of org-export-as-html, simply checking whether the user has set a
;; given property in the plist, before assigning the current default.
;;
;; See below for an example of such a change.


;;;; 3. Other comments on org-export-as-html:

;; + Setting of "filename" should allow folders other than the same
;;   folder as the orgfile. It's a sensible default to use the same
;;   folder, but it should be configurable by respecting :html-dir
;;   from the org-publish-config-plist. 

;;   reasons: i do not want html files in my org folder. grep would
;;            find everything twice if I grep the folder.  we should
;;            be able to keep org files in the org folder, images in
;;            ../images, html in ../org-html if so desired. 

;;   in that case we'd change the line in the let* from:

(filename (concat (file-name-sans-extension buffer-file-name)
                           ".html"))

;;   to something like 

(filename (let ((html-dir (plist-get org-publish-config-plist :html-dir)))
	    (if html-dir
		(concat html-dir 
			(file-name-sans-extension buffer-name)
			".html")  ;; this will work with TRAMP!
	      (concat (file-name-sans-extension buffer-file-name)
		      ".html"))))
   
;; + Default page title should be set to 

(file-name-sans-extension (buffer-name)) 

;; instead of just 

(buffer-name)

;;   reasons: Most people will have TOPIC.org, so the page title
;;            should be TOPIC.  (who really wants ".org" at the end of
;;            a big page title?  this is not a useful default and it
;;            really surprised me the first time I saw .org at the end
;;            of the page title. it looks like a website address.)


Carsten Dominik <carsten.dominik@gmail.com> writes:

> I would propose the following strategy.  You start by creating a
> project, something like org-publish.el.  In that you define what is
> needed to do a publishing project, i.e. variables holding the root
> directory of a project, the directory where to publish the files, and
> anything else.  I guess you can let yourself guide by how Emacs wiki
> and Muse do these things.
>
> Then you write commands to visit each org-file in that directory in
> turn, call the exporter and ship off the resulting file to whatever
> destination you desire, along with any other non-.org files in the
> project directory.
>
> I would make the required hooks in the existing HTML exporter.  As far
> as I can see this mainly means honoring relative path specifications
> correctly, and changing links to .org files from file: to http:.
>
> You also think up a way to define the header and footers for these new
> files, and I would provide ways for you to pass these to the exporter.
>
> With a setup like this, we can develop this relatively independently.
> When the dust settles, we can integrate the new code into org.el, or
> distribute it with it, if that is what you want.
>
> - Carsten
>
>

-- 
Dave O'Toole
dto@gnu.org

  parent reply	other threads:[~2006-04-21  2:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 15:06 Adapting org-mode to my needs David O'Toole
2006-04-19  6:10 ` Carsten Dominik
2006-04-19 12:22   ` Carsten Dominik
2006-04-19 13:53   ` David O'Toole
2006-04-21  2:31   ` David O'Toole [this message]
2006-04-21  8:04     ` Carsten Dominik
2006-04-21  8:16       ` David Emery
2006-04-21 14:11       ` Carsten Dominik
2006-04-21 14:33         ` David O'Toole
2006-04-26 20:16   ` Interaction of org-mode and Muse (was: Adapting org-mode to my needs) Michael Olson
2006-04-27  7:31     ` Carsten Dominik
2006-04-27 12:56       ` [Emacs-orgmode] Interaction of org-mode and Muse Michael Olson
  -- strict thread matches above, loose matches on Subject: below --
2006-04-18 19:15 Adapting org-mode to my needs David O'Toole

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=m3vet31wwz.fsf@gnu.org \
    --to=dto@gnu.org \
    --cc=carsten.dominik@gmail.com \
    --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).