bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTML self links to anchor points


From: Raymond Toy
Subject: Re: HTML self links to anchor points
Date: Mon, 2 Nov 2020 14:32:13 -0800



On Sun, Nov 1, 2020 at 1:02 PM Gavin Smith <gavinsmith0123@gmail.com> wrote:
On Sun, Nov 01, 2020 at 05:18:24PM +0000, Gavin Smith wrote:
> On Sat, Oct 31, 2020 at 03:16:26PM -0700, Per Bothner wrote:
> > On 10/31/20 2:26 PM, Gavin Smith wrote:
> > > Feel free not to consider it if you find implementing your desired
> > > functionality enough, but there has also been discussion of outputting
> > > an "anchor" at def items to provide a link that could be copied:
> > >
> > > https://lists.gnu.org/archive/html/bug-texinfo/2020-09/msg00022.html
> > >
> > > It would be good if this could be implemented with CSS too.
> >
> > I'm dubious CSS can add a link, but it can easily be done with _javascript_.
> > Or you can have makeinfo create the link.
>
> You're right, there doesn't seem to any way to do it with CSS.  The
> ::after and ::before selectors only support adding plain text, no tags.
>
> I am not sure if an anchor link should be output by default, or even
> if there should be an option for it.  It could make the experience
> worse when browsing the HTML in a text terminal, e.g. with lynx.  They
> could get in the way of selecting another link with the keyboard.  Where
> CSS is not available the anchor links would be visible all the time.
>
> Perhaps anchor links could be generated by _javascript_ for those who
> want to use them.  They could also postprocess the output of texi2any.

Not everyone has _javascript_ enabled either.

I've gone and implemented it anyway (in commit b9920b16), because I
wanted to see what it would be like.  It is for @def* commands only
at the moment, not for @anchor or for section headings.  Turn it off
with the -c PERMALINKS=0 option (variable name subject to change).

I'll try this out soon.  I think having such links is really important for the html version.

I think links for @anchor is important since it's something the author had to say explicitly, so having that available in html seems appropriate.  Perhaps I'll change my mind after I see what you've done so far.


--
Ray

reply via email to

[Prev in Thread] Current Thread [Next in Thread]