emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Toon Claes <toon@iotcl.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Suggestion to self-link headlines exported to HTML
Date: Wed, 19 Dec 2018 22:38:39 +0100	[thread overview]
Message-ID: <871s6dyz6o.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <874lbdw4h1.fsf@iotcl.com> (Toon Claes's message of "Sun, 16 Dec 2018 22:23:38 +0100")

Hello,

Toon Claes <toon@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

  reply	other threads:[~2018-12-19 21:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-16 21:23 [PATCH] Suggestion to self-link headlines exported to HTML Toon Claes
2018-12-19 21:38 ` Nicolas Goaziou [this message]
2018-12-28 21:32   ` Toon Claes
2018-12-29 14:00     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s6dyz6o.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=toon@iotcl.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).