From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: Wrapping sections in html not possible Date: Sat, 29 Nov 2014 08:57:37 -0800 Message-ID: <877fyet05a.fsf@berkeley.edu> References: <20141129074326.GM21741@w3-net.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XulMD-0001DP-T4 for emacs-orgmode@gnu.org; Sat, 29 Nov 2014 11:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XulM7-0004ay-Lc for emacs-orgmode@gnu.org; Sat, 29 Nov 2014 11:58:53 -0500 Received: from plane.gmane.org ([80.91.229.3]:47865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XulM7-0004aq-EV for emacs-orgmode@gnu.org; Sat, 29 Nov 2014 11:58:47 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XulM5-0004vz-Ci for emacs-orgmode@gnu.org; Sat, 29 Nov 2014 17:58:45 +0100 Received: from c-67-169-117-151.hsd1.ca.comcast.net ([67.169.117.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2014 17:58:45 +0100 Received: from richard.lawrence by c-67-169-117-151.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Nov 2014 17:58:45 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: Henry Hirsch Hi Henry, Henry Hirsch writes: > So how can org mode support wrapping sections in html? > Especially for more complex cases where a section or > multiple sections will be wrapped in multiple divs. You can do this with an export filter or filters. See the "Advanced Configuration" section in the "Exporting" chapter of the manual. Here is a simple example to get you started: #+BEGIN_SRC elisp (defun my-html-headline-wrap-filter (text backend info) "Wrap headlines in div.jumbotron during export." (when (org-export-derived-backend-p backend 'html) (concat "
" text "
"))) (add-to-list 'org-export-filter-headline-functions 'my-html-headline-wrap-filter) #+END_SRC As written, this will wrap *all* sections (including their headline) in divs with the jumbotron class during HTML export. You probably want to do this for just some headlines, in just some documents. So, you'll need to add a test in my-html-headline-wrap-filter so that it only wraps the relevant headlines, and leaves others unchanged. Perhaps you can do this based on the title of the headline, or the presence of some tag or property. If you need help with this, just ask! Best, Richard