[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
@defblock and @defline in texi2any
From: |
Gavin Smith |
Subject: |
@defblock and @defline in texi2any |
Date: |
Sat, 18 Feb 2023 17:15:21 +0000 |
On Sat, Feb 11, 2023 at 08:16:18PM +0000, Gavin Smith wrote:
> OK, I know that dynamically updating command lists or handling
> command macro expansion can add a lot of complexity to texi2any.
> The next step now is probably to add @defblock to texi2any.
(switching to bug-texinfo which is a more appropriate mailing list)
I've added a basic implementation of this.
The input can look like
@defblock
@defline Funnyction odd (bob, job)
@deflinex Funoid argle (bargle, jargle)
description
here
@end defblock
The output is as you would expect and I've tested this basic case
with Info, LaTeX, DocBook, HTML and Texinfo-XML formats. There are
no index entries made by default.
The next step is to get copiable anchors to work in HTML. I imagine
there should always be a copiable anchor even if there is no index
entry, as the definition line is a kind of heading. Then if there
are further index entries, like
@defcodeindex fy
@defcodeindex fd
@defblock
@fyindex odd
@defline Funnyction odd (bob, job)
@fdindex argle
@deflinex Funoid argle (bargle, jargle)
description
here
@end defblock
the index entries would all refer to the first line.
It's similar to copiable anchors in @table, and would be
implemented in a similar way. (For example, with a function like
'relate_index_entries_to_table_items_in_tree' in Texinfo/Common.pm
to set 'entry_associated_element' for the index commands, and use
this in Texinfo/Convert/HTML.pm in '_prepare_index_entries' or other
functions.)
Does this all sound okay?
Then we could add tests involving the new commands. It may not
be necessary to have both @defline and @deflinex.
> I still don't think that
>
> @defMac{macro1, (arg1@comma{} arg2)}
>
> is a very good syntax, though. Maybe we could come back to this.
>
- @defblock and @defline in texi2any,
Gavin Smith <=