[PATCH rtems-docs] Add option --build-manuals to build multiple specific manuals.

Shashvat shashvatjain2002 at gmail.com
Fri Feb 11 08:37:40 UTC 2022


Hello all!!
This patch adds the --build-manuals option enabling one to build specific
documentation manuals. I also updated the README.

---
 README.txt | 10 +++++++---
 common/waf.py | 9 +++++++++
 wscript | 9 +++++++++
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/README.txt b/README.txt
index 828c9e7..8480b0c 100644
--- a/README.txt
+++ b/README.txt
@@ -407,7 +407,9 @@ To build enter in the top directory:
                     [--sphinx-nit-pick] \
                     [--plantuml] \
                     [--ditaa] \
- [--disable-extra-fonts]
+ [--disable-extra-fonts] \
+ [--build-manuals]
+

   $ ./waf

@@ -448,8 +450,10 @@ verbose level:
   $ ./waf configure --sphinx-options "-V -V"
   $ ./waf clean build

-You can enter a manual's directory and run the same configure command and
build
-just that manual.
+If you wish to build only some specific manuals,
+use the '--build-manuals=<manual-name-1>,<manual-name-2>' option with
+configure to build only those specific manuals.
+

 Documentation Standard
 ----------------------
diff --git a/common/waf.py b/common/waf.py
index fa9aecb..e6ae059 100644
--- a/common/waf.py
+++ b/common/waf.py
@@ -240,6 +240,11 @@ def cmd_configure(ctx):
         check_sphinx_extension(ctx, 'sphinxcontrib.bibtex')

     #
+ # Build specific manuals.
+ #
+ if ctx.options.build_manuals!="":
+ ctx.env.MANUALS = ctx.options.build_manuals.split(',')
+ #
     # Optional builds.
     #
     ctx.env.BUILD_PDF = 'no'
@@ -480,6 +485,10 @@ def cmd_options(ctx):
                    action = 'store',
                    default = "",
                    help = "Additional Sphinx options.")
+ ctx.add_option('--build-manuals',
+ action = 'store',
+ default = '',
+ help = "Build specific manuals. To build multiple manuals use ','
delimeter.")
     ctx.add_option('--sphinx-nit-pick',
                    action = 'store_true',
                    default = False,
diff --git a/wscript b/wscript
index fd8f10c..a887a95 100644
--- a/wscript
+++ b/wscript
@@ -96,6 +96,15 @@ def build(ctx):
     #
     ctx.recurse('images')
     ctx.add_group('images')
+
+ #
+ # Overwrite to new building list, if env.MANUALS is created during
configuration.
+ #
+ if ctx.env.MANUALS:
+ building = ctx.env.MANUALS
+ print("Building the following manuals:-")
+ for manual in building:
+ print(manual)

     for b in building:
         ctx.recurse(b)

--
2.33.0


More information about the devel mailing list