From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: TOC local for specified heading and its subheadings (in HTML export)? Date: Sun, 29 Nov 2015 14:05:44 +0100 Message-ID: <87two5lzvb.fsf@nicolasgoaziou.fr> References: <86si3qra8m.fsf@sachachua.com> <87bnae2av0.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]:43516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a31e7-0004os-Ov for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 08:04:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a31e2-0005sc-Gn for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 08:04:03 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:46643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a31e2-0005s7-B2 for emacs-orgmode@gnu.org; Sun, 29 Nov 2015 08:03:58 -0500 In-Reply-To: <87bnae2av0.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 28 Nov 2015 20:16:19 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > Further, IMO it might be better to extend the =E2=80=99#+toc: headlines l= ocal=E2=80=99 > declaration. Of course you could argue that =E2=80=99local=E2=80=99 beco= mes a special > case of the above "id:whatever-is-the-name-of-the-local-headline". > > Personally, I would like a more explicit syntax, though I recognize that > it doesn=E2=80=99t necessarily make a difference if it=E2=80=99s an exten= sion, in the > sense of suffixing. E.g.: > > #+toc: headlines local 1 :headline "* my headline" > #+toc: headlines local 1 :headline "#headline" > > Or closer to your suggestion, > > #+toc: headlines 1 :headline "#headline" > #+toc: headlines 1 :headline local > > Which as a special case can be written as, > > #+toc: headlines 1 local I agree. However, I suggest to ignore quotes: #+toc: headlines 1 :headline #headline or=20 #+toc: headlines 1 :target #headline since TOC keywords always refer to headlines. Using quotes may also be supported for destinations containing spaces. >> + (org-html-toc depth info >> + (or >> + (and local-id >> + (car (org-element-map (plist-get info :parse-tree) >> + 'headline >> + (lambda (element) >> + (and (string=3D (org-element-property :CUSTOM_ID element) local-i= d) >> + element))))) > > Wouldn=E2=80=99t it better to use org-link-search and get the element at > point? Or even work at the parse tree level and use `org-export-resolve-id-link' and `org-export-resolve-fuzzy-link'. Regards, --=20 Nicolas Goaziou