[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-texinfo] Visible HTML anchors for options?
From: |
David Malcolm |
Subject: |
Re: [help-texinfo] Visible HTML anchors for options? |
Date: |
Fri, 15 Feb 2019 14:03:26 -0500 |
On Fri, 2019-02-15 at 09:25 +0200, Eli Zaretskii wrote:
> > From: David Malcolm <address@hidden>
> > Date: Thu, 14 Feb 2019 17:26:59 -0500
> >
> > I'm a GCC developer; we use texinfo for our documentation.
> >
> > GCC has a lot of options, so it's very useful to be able to provide
> > users with URLs to *specific* options in our documentation.
> >
> > For a long time I didn't think texinfo's HTML generator provided
> > anchors for these, but using "View Source" shows it does.
> >
> > For example, this .texi input:
> >
> > @item address@hidden
> > @opindex flive-patching
> > Control GCC's optimizations to provide a safe compilation for live-
> > patching.
> >
> > provides this HTML:
> >
> > <dt><code>-flive-patching=<var>level</var></code></dt>
> > <dd><a name="index-flive-patching"></a>
> > <p>Control GCC’s optimizations to provide a safe compilation
> > for
> > live-patching.
> > </p>
>
> Why not use @anchor and @xref? Those should produce visible links.
I'm hoping for some kind of way to get the toolchain to automatically
generate the HTML I want without having to touch all of the options in
our .texi source to get this. FWIW, these items are within a "@table
@gcctabopt", and, now I look at it, gcctabopt is a GCC-specific texinfo
macro [1].
So maybe it's possible to fix this at our end by making that macro
smarter, somehow? (I'm definitely not an expert here). Presumably I
want the macro I want to extract any opindex within the item, and
repeat it, within an @anchor. Is this kind of thing expressible via
texinfo macros?
Unfortunately, I run into things like:
../../src/gcc/doc/cpp.texi:4375: warning: @anchor should not appear in @table
(possibly involving @gcctabopt)
../../src/gcc/doc/cpp.texi:4375: empty argument in @anchor (possibly involving
@gcctabopt)
../../src/gcc/doc/cpp.texi:4375: table requires an argument: the formatter for
@item
when experimenting with e.g.:
@macro gcctabopt{body}
@anchor{\body\}
@end macro
as an alternative implementation of that macro.
Thanks; hope the above make sense.
Dave
[1]
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/doc/include/gcc-common.texi;hb=HEAD