From 5ecfdde737079e42cc61382990103817ef9bab5a Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Wed, 15 Jan 2020 15:55:56 -0800 Subject: [PATCH] build Octave 5 docs with Texinfo 6.6 and later This is a combination of the following upstream commits. Applied to Octave version 5, this commit allows the documentation to be built with Texinfo 6.6 and later versions. * 1dbe839bedcb doc: fix '.' Operator Index entry to build with Texinfo 6.7 * 466e61c5fb4b build: adapt mk-qthelp.pl to changes in Texinfo 6.7 * 6acb713f8231 avoid conflict with @seealso macro in Texinfo 6.6 --- doc/interpreter/container.txi | 3 +-- doc/interpreter/macros.texi | 9 +++++++-- doc/interpreter/mk-qthelp.pl | 2 +- doc/interpreter/munge-texi.pl | 6 +++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/interpreter/container.txi b/doc/interpreter/container.txi index bb84e1f94e4e..252d6ade1b89 100644 --- a/doc/interpreter/container.txi +++ b/doc/interpreter/container.txi @@ -67,8 +67,7 @@ x.c = "string"; @end group @end example -@c The following line should have a trailing space. -@opindex . @ @ @ +@opindex @code{.} structure field access @noindent create a structure with three elements. The @samp{.} character separates the structure name (in the example above @code{x}) from the field name and diff --git a/doc/interpreter/macros.texi b/doc/interpreter/macros.texi index f47853a655d9..291bcc4dd117 100644 --- a/doc/interpreter/macros.texi +++ b/doc/interpreter/macros.texi @@ -46,9 +46,14 @@ @c Implementation Note: @c For TeX, @vskip produces a nice separation. @c For Texinfo, '@sp 1' should work, but in practice produces ugly results -@c for HTML. We use a simple blank line to produce the correct behavior. +@c for HTML. We use a simple blank line to produce the correct +@c behavior. +@c +@c We use @xseealso now because Texinfo introduced its own @seealso +@c command. But instead of modifying all source files, we'll have the +@c munge-texi script convert @seealso to @xseealso. -@macro seealso {args} +@macro xseealso {args} @iftex @vskip 2pt @end iftex diff --git a/doc/interpreter/mk-qthelp.pl b/doc/interpreter/mk-qthelp.pl index e9d617c6ae82..a5403db7239b 100755 --- a/doc/interpreter/mk-qthelp.pl +++ b/doc/interpreter/mk-qthelp.pl @@ -34,7 +34,7 @@ while (<$HTML>) { if (/^\s*
  • /) { - ($href, $text) = m|href="([^"]*)">(.*)|; + ($href, $text) = m|href="([^"]*)"[^<>]*>(.*)|; # Sanitize text $text =~ s/<[^>]*>//g; # remove xml-looking blocks like $text =~ s/’/’/g; # Code for apostrophe diff --git a/doc/interpreter/munge-texi.pl b/doc/interpreter/munge-texi.pl index ecd705f11f29..1a999690bace 100755 --- a/doc/interpreter/munge-texi.pl +++ b/doc/interpreter/munge-texi.pl @@ -73,6 +73,8 @@ print '@c DO NOT EDIT! Generated automatically by munge-texi.pl.',"\n\n"; TXI_LINE: while () { + s/\@seealso/\@xseealso/g; + if (/^\s*\@DOCSTRING\((\S+)\)/) { $func = $1; @@ -139,7 +141,9 @@ sub extract_docstring $repl .= "\@ref{XREF$node,,$func}, "; } substr($repl,-2) = ""; # Remove last ', ' - $_ = "\@seealso{$repl}$rest_of_line"; + # write out @xseealso because we have our own macro that conflicts + # with the one introduced in Texinfo 6. + $_ = "\@xseealso{$repl}$rest_of_line"; } $docstring .= $_; -- 2.24.1