On Tue, Jul 08, 2025 at 10:21:33PM +0100, Gavin Smith wrote:
> This question has been asked so many times before that I wonder if
> we should just make WORDS_IN_PAGE equal to 0 by default as users seem
> to have difficulty finding out about it.
> 
> The default value is 300, currently set in tta/data/converters_defaults.txt.
> This means that if there are fewer than 300 words in a node, no footer
> panel will be output.

I tried playing around with changing the default WORDS_IN_PAGE setting,
but I like suppressing the footer for very short nodes so I do not want
to set the default to 0.  For example, a node like:

https://www.gnu.org/software/texinfo/manual/info-stnd/html_node/Xref-Commands.html

that just has a small amount of text, followed by a menu, looks "cleaner"
without the nav bar at the bottom.  

However, changing the default from 300 to 200 appears to have fairly
good results, in my testing - this still omits the bottom bar for very
short nodes while adding it in for some longer ones.

It is complicated by the fact that the word count is done on the HTML output,
including all tags.  This means the word count used can be much greater than
expected and it is not possible to calibrate the setting very precisely.

For example: '(info-stnd)Xref Commands' (*).  The text in the node you'd
expect to be counted is:

> 8 Selecting Cross-references
> We have already discussed the ‘Next’, ‘Prev’, and ‘Up’
> pointers which appear at the top of a node, referring you to a different
> node.
> 
> In addition, a node may contain a menu, as well as cross-references
> (xrefs for short) interspersed through the text of the
> node. Cross-references may possibly refer to a node in another Info file.
> 
> Parts of an Xref
> Selecting Xrefs

This is 66 words (more or less).  The number of words that texi2any finds?
124.

The navigation is included in the count.  Also included are any (invisible)
index anchors.

There's probably no point in trying to change this, as users may be relying
on the setting.  We could just add a brief mention to the manual that
the header and HTML tags are included in the count.


(*) file:///home/g/src/texinfo/GIT/test/info-stnd_html/Xref-Commands.html

Reply via email to