This change fixes bugs in the manpage generator that existed since it
was first added.
It exposes CLI `ARGUMENTS` value to manpage templates.
Before this change, the code contained a typo, causing the `for`-loop
iterate over individual characters of the `'ARGUMENTS'` string rather
than iterating over a tuple. A missing comma was at fault.
The updated code gets rid of the `for`-loop and conditionals since it
seems to have been a premature complexity increase and no other things
than `'ARGUMENTS'` were ever added into the broken iterable.
The functional change is that `arguments` is now always present in the
Jinja2 context, unlike being missing sometimes because of the previous
design (not that it was ever present, because of the bug! sigh...)
The Jinja2 templates perform an `{% if arguments %}` check, letting
the template engine silently ignore the missing variable. The clause
was always falsy, meaning that the arguments section was not included
in the manpages for at least the last 6 years. With this fix, it will
be.
This patch also deduplicates calling `opt_doc_list` @ generate_man.
It was called late in the execution, more times than necessary. This
patch makes sure it happens once by putting it at the top of the scope.
It fixes rendering library and inventory in manpages.
The corresponding Jinja2 templates have blocks wrapped with
conditionals like `{% if inventory %}` and `{% if library %}` but said
variables were never injected into the context, nor were they even
deduced on the Python side of the generator. This means that the
conditional clauses were always falsy, never showing the portions of
the manpages.
The Python script has hints for how the `inventory` variable was to be
calculated, which is confirmed through the Git paleontology efforts.
The block of code that references to the `inventory` bit was
incorrectly checking a variable with a list of nested objects for the
presence of a string which was never going to work.
This patch fixes this check by verifying the CLI flag against the
correct variable containing a list of options and exposes it to the
Jinja2 templates.
It also exposes the `library` variable in a similar way.
The block displaying other binaries in Sphinx CLI docs has been
synchronized with the manpage template.
Previously, the current binary was displayed also. This patch gets rid
of the unwanted trailing comma there too.
Finally, the CLI executables list in the manpage template now reuses
the same variable as the RST template that doesn't need any
post-processing in Jinja2.
Before, it was already used in the RST template so this patch aligns
both templates to use the same logic as they got out-of-sync over time.
PR #80450.
(cherry picked from commit a84b3a4e72)
Co-authored-by: Sviatoslav Sydorenko <webknjaz@redhat.com>
* [stable-2.14] Convert non-docs *.rst files to *.md (#81217)
* Rename README.rst to README.md
* Change README format from reStructuredText to Markdown
* Fix whitespace in README.md
* Update setup.cfg to use README.md
* Replace changelog placeholder with README.md
* Update package-data sanity test
(cherry picked from commit 38e50c9f81)
Co-authored-by: Matt Clay <matt@mystile.com>
* Remove README.rst from MANIFEST.in
* [stable-2.14] Cache field attributes list on the playbook classes (#79091)
* Cache field attributes list on the playbook classes
(cherry picked from commit 5863770)
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
* Replace deprecated stacked `@classmethod` and `@property` (#79952)
(cherry picked from commit 243d1b5e3d)
---------
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
* during interim docs/ (and related dirs) split to separate repo, prevent merges that might require a rebase of the target repo
(cherry picked from commit 9117762358)
* [stable-2.14] Remove docs dir dependency from man page build (#81003)
(cherry picked from commit b3f1290bcd)
Co-authored-by: Matt Clay <matt@mystile.com>
* Update path in Makefile
* uri: fixed search for json types to include strings in the format xxx/yyy+json
(cherry picked from commit 0c7361d)
Co-authored-by: Brent Barbachem <barbacbd@dukes.jmu.edu>
* Fix installing signed collections by using the fqcn, version, source, and type as a unique identifier.
Define __hash__ and __eq__ methods to handle Candidate/Requirement comparison excluding signatures which aren't fully populated until install time.
* Remove PinnedCandidateRequests since it is redundant now.
* Fix verifying against a signed remote when the keyring isn't configured
(cherry picked from commit d5e2e7a0a8)
Instead of using Templar.environment in Templar.do_template for
accessing/mutating the environment, myenv local variable should be used
because it is the environment used for actual templating. It can either
point to Templar.environment or newly created environment overlay.
Fixes#80605
(cherry picked from commit 8cd95a8e66)