From mboxrd@z Thu Jan 1 00:00:00 1970 From: "*" Subject: Re: How to omit h1 title heading in HTML export? Date: Wed, 5 Jun 2013 13:48:32 -0500 Message-ID: References: <87ppw13i2x.fsf@pank.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkIlA-0005bA-3S for emacs-orgmode@gnu.org; Wed, 05 Jun 2013 14:48:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkIl7-0006WT-8z for emacs-orgmode@gnu.org; Wed, 05 Jun 2013 14:48:36 -0400 Received: from mail-vb0-x233.google.com ([2607:f8b0:400c:c02::233]:38493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkIl7-0006WH-4A for emacs-orgmode@gnu.org; Wed, 05 Jun 2013 14:48:33 -0400 Received: by mail-vb0-f51.google.com with SMTP id x17so1324777vbf.24 for ; Wed, 05 Jun 2013 11:48:32 -0700 (PDT) In-Reply-To: <87ppw13i2x.fsf@pank.eu> 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: Rasmus Cc: emacs-orgmode@gnu.org On 6/4/13, Rasmus wrote: > "*" writes: > >> Hey Basile >> Thanks for your reply! >> >> Yes, the suggestion helps :-) >> A blank TITLE option seems to produce some empty tags like so: >>

>> >> And maybe there are also some jquery fixes, for instance... >> $("#content h1:first-child").hide(); >> >> Sometimes tricks are fun, >> but I guess one of my questions was: Do all documents generated by >> HTML export contain the

blabla

markup? > > Yes seems like it. check ox-html.el and org-html--build-meta-info. > > If you are very unhappy with blank title solution proposed by > Bastien you could use a filter. Here's a filter I use for headlines; > you can easily adapt it to your case: > > (defun rasmus/org-html-ignore-title-if-present (string backend info) > "Strip title if it's already there for html." > (when (and (org-export-derived-backend-p backend 'html) > (string-match "h1 class=\"mytitle\"" string)) > (replace-regexp-in-string "

.*?

" "" string))) > > (add-to-list 'org-export-filter-final-output-functions > 'rasmus/org-html-ignore-title-if-present) > > > > > -- > I hear there's rumors on the, uh, Internets. . . > > > Thanks for your reply! Yes, perhaps this is what I was looking for :-) See below for the snippet that I added to the publishing configuration file. Modulo very small tweaks, it's your snippet... errors are mine... In the configuration file I also have to now explicitly say (require 'ox-html) I'm new at this, so perhaps I ask more questions: Should filters be defined in the publishing configuration file, like I've done? (require 'ox-html) (defun rasmus/org-html-ignore-title-if-present (string backend info) "Strip title if it's already there for html." (when (and (org-export-derived-backend-p backend 'html) (string-match "h1 class=\"title\"" string)) (replace-regexp-in-string "

.*?

\n+" "" string))) (add-to-list 'org-export-filter-final-output-functions 'rasmus/org-html-ignore-title-if-present)