From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [ox-html] Multiple wraps around sections Date: Sun, 16 Mar 2014 14:01:18 +0100 Message-ID: <87pplm5mch.fsf@gmx.us> References: <87eh233unt.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPAgz-0004bm-Cx for emacs-orgmode@gnu.org; Sun, 16 Mar 2014 09:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPAgt-0001UM-3p for emacs-orgmode@gnu.org; Sun, 16 Mar 2014 09:01:29 -0400 Received: from mout.gmx.net ([212.227.17.21]:62905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPAgs-0001UG-Q1 for emacs-orgmode@gnu.org; Sun, 16 Mar 2014 09:01:23 -0400 In-Reply-To: (Christian Moe's message of "Sun, 16 Mar 2014 09:15:04 +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: mail@christianmoe.com Cc: n.goaziou@gmail.com, emacs-orgmode@gnu.org Hi Christian and Nicolas, Christian Moe writes: > Rasmus writes: > >> Is there any way I can easily get an /extra/ container around my >> sections? > > You would probably want to create an export filter for sections. See the > manual, Export > Advanced configuration > Filters. The thing is semantics are pretty easy to mess up in HTML-like languages compared to, say, LaTeX, since I have to figure out the ending point. Thus, it'd obviously prefer not touch it. Hence the question. A short trial suggests that this filter does the job: #+begin_src html (defun rasmus/org-html-headline-add-extra-div (headline backend info) "Add an extra :html-container around top level sections." (when (org-export-derived-backend-p backend 'html) (let ((element (plist-get (text-properties-at (next-property-change 0 headline)= headline) :parent))) (when (=3D 1 (org-element-property :level element)) (save-match-data (string-match "\n" headline) (concat (replace-match (format "\n<%s class=3D\"outline-container-top\">\n" (org-html-= -container element info)) t nil headline) (format "\n" (org-html--container element info)))))))) #+end_html The critical part is the next-property-change. I assume that the first element is always the headline in question. (Do you know if this is generally true, Nicolas?) >> Note, my knowledge of HTML(5) & CSS is very limited so maybe I'm >> overlooking something obvious here. > > I don't think you're overlooking any way to add a container.=20 Thanks, I also couldn't find anything else, examining ox-html.el. > But since the exporter already provides a fair set of containers, it is > possible that you are overlooking a way to accomplish whatever you want > to do with the existing output and CSS. Quite possibly. I did HTML back in gymnasium, but I really haven't followed the "trends" in this area. =E2=80=94Rasmus --=20 Evidence suggests Snowden used a powerful tool called monospaced fonts