From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Suggestion to self-link headlines exported to HTML Date: Wed, 19 Dec 2018 22:38:39 +0100 Message-ID: <871s6dyz6o.fsf@nicolasgoaziou.fr> References: <874lbdw4h1.fsf@iotcl.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZjYF-0004wK-Ec for emacs-orgmode@gnu.org; Wed, 19 Dec 2018 16:38:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZjYA-0007nG-Eu for emacs-orgmode@gnu.org; Wed, 19 Dec 2018 16:38:47 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53703) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZjYA-0007mW-6V for emacs-orgmode@gnu.org; Wed, 19 Dec 2018 16:38:42 -0500 In-Reply-To: <874lbdw4h1.fsf@iotcl.com> (Toon Claes's message of "Sun, 16 Dec 2018 22:23:38 +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" To: Toon Claes Cc: emacs-orgmode@gnu.org Hello, Toon Claes writes: > Recently I wrote a blog post on making headlines clickable when Org mode > is exported to HTML: > https://writepermission.com/org-blogging-clickable-headlines.html > > With this mail, I'd like to suggest a change to bring this feature to > the Org mode core. > > It's my first contribution to Org mode, but I've already completed the > paperwork to contribute to Emacs core in the past. > > Of course any comment is welcome. Thank you. Comments, indeed, follow :) > | ~:html-postamble~ | ~org-html-postamble~ | > | ~:html-preamble-format~ | ~org-html-preamble-format~ | > | ~:html-preamble~ | ~org-html-preamble~ | > +| ~:html-self-link-headlines~ | ~org-html-self-link-headlines~ | > | ~:html-table-align-individual-field~ | ~de{org-html-table-align-individual-fields~ | > | ~:html-table-attributes~ | ~org-html-table-default-attributes~ | > | ~:html-table-caption-above~ | ~org-html-table-caption-above~ | Could this also be documented somewhere in "HTML Export" section of the manual? > +(defcustom org-html-self-link-headlines nil > + "When set, the headlines contain a hyperlink to themselves." When non-nil, ... > + :group 'org-export-html > + :version "27.1" No need for :version keyword if :package-version is provided. > + :package-version '(Org . "9.2") It should be "9.3" actually, since 9.2 is feature-freeze. > + :type 'boolean) Please also add :safe #'booleanp > ;;;; Inlinetasks > > (defcustom org-html-format-inlinetask-function > @@ -2592,7 +2600,11 @@ holding contextual information." > todo todo-type priority text tags info)) > (contents (or contents "")) > (id (or (org-element-property :CUSTOM_ID headline) > - (org-export-get-reference headline info)))) > + (org-export-get-reference headline info))) > + (formatted-text > + (if (and id (plist-get info :html-self-link-headlines)) `id' cannot be nil, so you only need (plist-get ...) > + (format "%s" id full-text) > + text))) Why `text' and not `full-text' as a fall-back? Regards, -- Nicolas Goaziou