From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: Overriding org-html-headline or other export functions? Date: Mon, 29 May 2017 10:38:06 -0700 Message-ID: References: <8637bn3l9o.fsf@bnl.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFOcQ-0005XU-OB for emacs-orgmode@gnu.org; Mon, 29 May 2017 13:38:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFOcM-0002XG-NR for emacs-orgmode@gnu.org; Mon, 29 May 2017 13:38:14 -0400 Received: from iport-bcv4-out.ucsd.edu ([132.239.0.122]:33102) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1dFOcM-0002Vd-5j for emacs-orgmode@gnu.org; Mon, 29 May 2017 13:38:10 -0400 In-Reply-To: <8637bn3l9o.fsf@bnl.gov> 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" To: Brett Viren Cc: "emacs-orgmode@gnu.org" On Mon, 29 May 2017, Brett Viren wrote: > Hi, > > I am writing a manual in Org which gets exported/published to HTML and > styled with org-html-themes. I want the HTML to include a little icon > next to each headline which is a direct link to the headline itself. > Basically, I want to rip off what GitHub does when it renders Org. > > First, is there some way to achieve this headline link without > explicitly adding it in the Org text or diving into Org Elisp? > > I couldn't find one so I took the latter route by copying out the whole > of org-html-headline into the Emacs init Elisp file I used for > publishing and fiddle with it until I got more or less what I wanted. > Here are the lines tweaked: > > https://github.com/WireCell/wire-cell-docs/blob/master/manuals/publish.el#L69 > > Here is an example of the result: > > http://www.phy.bnl.gov/~bviren/wirecell.github.io/manual.html > > Is this copy+hack the proper way to tweak the exporting in this case? > In particular, I worry about my copy of org-html-headline diverging from > the real. > > > I read about export filters and extending an existing back-end, but I > think these do not apply, but maybe I have that wrong. > You do have that wrong. This is exactly what export filters and derived backends are for. In fact, you can use both. For an example, see http://orgmode.org/worg/exporters/filter-markup.html You will want to change `latex' to `html' in the `(org-export-define-derived-backend ...)' call and delete all filters except for `:filter-headline'. And revise `ox-mrkup-filter-headline' accordingly. And of course, you will want to look at http://orgmode.org/worg/dev/org-export-reference.html HTH, Chuck