From: Gavin Smith
Date: Wed, 12 Jul 2023 14:00:40 +0000 (+0200)
Subject: gendocs: support chapter- and section-level split
X-Git-Tag: v1.0~1127
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=32fcd39429a19af8e80cb2c9f899781db6eefba6;p=gnulib.git
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.
Remove obsolete comment about ranges of years in copyright notice
(as per Karl).
* build-aux/gendocs.sh
[!texi2html]: Strip out parts of the template depending on --split.
[texi2html] Include all of the template as before.
---
diff --git a/ChangeLog b/ChangeLog
index e55bfec8ed..324be4a6ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-07-12 Gavin Smith
+
+ 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.
+ Remove obsolete comment about ranges of years in copyright notice
+ (as per Karl).
+ * build-aux/gendocs.sh
+ [!texi2html]: Strip out parts of the template depending on --split.
+ [texi2html] Include all of the template as before.
+
2023-07-11 Bruno Haible
mbsrtoc32s, mbsnrtoc32s: Small optimization.
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
index 1ad5cf4f5d..0e470bf7ce 100755
--- a/build-aux/gendocs.sh
+++ b/build-aux/gendocs.sh
@@ -2,7 +2,7 @@
# gendocs.sh -- generate a GNU manual in many formats. This script is
# mentioned in maintain.texi. See the help message below for usage details.
-scriptversion=2023-01-21.00
+scriptversion=2023-07-12.10
# Copyright 2003-2023 Free Software Foundation, Inc.
#
@@ -466,11 +466,25 @@ 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"
+ # for texi2html, we do not take account of --split and simply output
+ # all variants
+ CONDS="/%%IF.*%%/d;/%%ENDIF.*%%/d;"
fi
curdate=`$SETLANG date '+%B %d, %Y'`
diff --git a/doc/gendocs_template b/doc/gendocs_template
index a101977dfc..0e6e8e767b 100644
--- a/doc/gendocs_template
+++ b/doc/gendocs_template
@@ -22,8 +22,10 @@ without any warranty.
+ with the webmasters first. -->
-Copyright © 2022 Free Software Foundation, Inc.
+Copyright © 2023 Free Software Foundation, Inc.
This page is licensed under a Creative