From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: HTML export: How to export body only, as HTML "fragment"? Date: Thu, 01 Oct 2009 06:40:58 +0200 Message-ID: <87ws3fd8v9.fsf@gmx.de> References: <20091001014756.GA11179@billpowellisalive.com> 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 1MtDTV-0002OV-TU for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 00:41:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtDTR-0002LJ-6s for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 00:41:05 -0400 Received: from [199.232.76.173] (port=50805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtDTR-0002LC-1f for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 00:41:01 -0400 Received: from mail.gmx.net ([213.165.64.20]:43869) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MtDTQ-0001HR-E9 for emacs-orgmode@gnu.org; Thu, 01 Oct 2009 00:41:00 -0400 In-Reply-To: <20091001014756.GA11179@billpowellisalive.com> (Bill Powell's message of "Wed, 30 Sep 2009 21:47:56 -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: Bill Powell Cc: emacs-orgmode@gnu.org Bill Powell writes: > - get HTML export to just convert the text to HTML, > without wrapping a template and and and > tags around it. I can't find an option to do this, > but it seems like if there isn't one, it should be fairly > easy to implement. Pyblosxom needs HTML fragments so it can > wrap my custom templates with dynamic title lists, etc. (require 'org-publish) (setq org-publish-project-alist '(("org-notes" ... :body-only t ;; w.o. head and body tags ... > - tell org-mode to export the first few lines without > touching them. Pyblosxom uses these lines to store things > like the title, the tag list, and other variables. This > pyblosxom "header" looks like this: > > First line is the title. > #tags meta,about > #blurb A pyblosxom variable line begins with #. You could add a completion-function to the export project in question. OK, this is a hack, but using Org-mode to produce Pyblosxom somthing is too, isn't it? (require 'org-publish) (setq org-publish-project-alist '(("org-notes" ... :body-only t ;; w.o. head and body tags ... :completion-function my-re-add-header-lines (defun my-re-add-header-lines () "Docstring.." ;; You can access the project-plist, that the export functions have ;; set up for you. All those values are set in ;; `org-publish-project-alist'. (let* ((base-dir (file-name-as-directory (plist-get project-plist :base-directory))) (orig (expand-file-name (concat base-dir (plist-get project-plist :index-filename)))) (strip-suffix (or (plist-get project-plist :base-extension) "org")) (add-suffix (or (plist-get project-plist :html-extension) "html")) .... ) BTW: you could even define your own values in `org-publish-project-alist' since the list is used just as is. > HTML Export will slurp lines that begin with # by default: > is there a way to turn this feature off? No, they're considered comments. Sebastian