bug-texinfo
[Top][All Lists]
Advanced

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

Re: Take account of splitting option in gendocs.sh


From: Gavin Smith
Subject: Re: Take account of splitting option in gendocs.sh
Date: Sun, 26 Mar 2023 19:47:03 +0100

On Sun, Mar 26, 2023 at 06:53:21PM +0200, Bruno Haible wrote:
> > Is there any progress on applying this patch?
> 
> I can't review it, because the interplay between the script and the template
> is something I don't know about.
> 
> Also: What are the effects of the patch on the output, if no --split option
> is being passed to gendocs.sh?

It should be the same as if --split=node was given, as 'node' is the
default value of $split in this script.

I see now that for texi2html, all three splitting options are used
("node", "chapter" and "section").  This can be seen at the GNU
Anubis manuals page (https://www.gnu.org/software/anubis/manual/),
where all three of these versions of the manual are available.

Here's an updated patch that does not affect the behaviour when
used with texi2html.

diff --git a/ChangeLog b/ChangeLog
index a0de338759..41a27c6710 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-03-26  Gavin Smith <gavinsmith0123@gmail.com>
+
+       gendocs: support chapter- and section-level split
+       * doc/gendocs_template: Add lines to mark parts of file to output
+       only when splitting HTML by node.
+       * build-aux/gendocs.sh
+       [!texi2html]: Strip out parts of the template depending on --split.
+       [texi2html] Include all of the template as before.
+
 2023-03-25  Bruno Haible  <bruno@clisp.org>
 
        stdlib: ISO C 23: Document issue with once_flag and call_once.
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 1ad5cf4f5d..c7c9e2826c 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -466,11 +466,24 @@ fi
 # 
 printf "\nMaking index.html for %s...\n" "$PACKAGE"
 if test -z "$use_texi2html"; then
-  CONDS="/%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;\
-         /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d"
+  if test x$split = xnode; then
+    CONDS="/%%IF  *HTML_NODE%%/d;/%%ENDIF  *HTML_NODE%%/d;\
+           /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d;\
+           /%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;"
+  elif test x$split = xchapter; then
+    CONDS="/%%IF  *HTML_CHAPTER%%/d;/%%ENDIF  *HTML_CHAPTER%%/d;\
+           /%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;\
+           /%%IF  *HTML_NODE%%/,/%%ENDIF  *HTML_NODE%%/d;"
+  elif test x$split = xsection; then
+    CONDS="/%%IF  *HTML_SECTION%%/d;/%%ENDIF  *HTML_SECTION%%/d;\
+           /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d;\
+           /%%IF  *HTML_NODE%%/,/%%ENDIF  *HTML_NODE%%/d;"
+  else
+    CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;" # invalid split argument
+  fi
 else
   # should take account of --split here.
-  CONDS="/%%ENDIF.*%%/d;/%%IF  *HTML_SECTION%%/d;/%%IF  *HTML_CHAPTER%%/d"
+  CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;"
 fi
 
 curdate=`$SETLANG date '+%B %d, %Y'`
diff --git a/doc/gendocs_template b/doc/gendocs_template
index a101977dfc..0b959f0379 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -22,8 +22,10 @@ without any warranty.
 <ul>
 <li><a href="%%PACKAGE%%.html">HTML
     (%%HTML_MONO_SIZE%%K bytes)</a> - entirely on one web page.</li>
+%%IF HTML_NODE%%
 <li><a href="html_node/index.html">HTML</a> - with one web page per
     node.</li>
+%%ENDIF HTML_NODE%%
 %%IF HTML_SECTION%%
 <li><a href="html_section/index.html">HTML</a> - with one web page per
     section.</li>
@@ -35,9 +37,11 @@ without any warranty.
 <li><a href="%%PACKAGE%%.html.gz">HTML compressed
     (%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
     one web page.</li>
+%%IF HTML_NODE%%
 <li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
     (%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
     with one web page per node.</li>
+%%ENDIF HTML_NODE%%
 %%IF HTML_SECTION%%
 <li><a href="%%PACKAGE%%.html_section.tar.gz">HTML compressed
     (%%HTML_SECTION_TGZ_SIZE%%K gzipped tar file)</a> -






reply via email to

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