Hello, Toon Claes <t...@iotcl.com> 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 "<a href=\"#%s\">%s</a>" id full-text) > + text))) Why `text' and not `full-text' as a fall-back? Regards, -- Nicolas Goaziou