mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-02-03 23:41:51 +00:00
Extra docs: generate Ansible outputs with 'antsibull-docs ansible-output' (#10421)
* Generate many Ansible outputs with 'antsibull-docs ansible-output'. * Generate YAML output as well. * Check ansible-output from CI instead of updating. * Use reset-previous-blocks meta action; generate more code blocks. * Use set-template meta action. * Run ansible-output in CI if anything in docs/ is changed. * Remove unnecessary allow_duplicate_keys.
This commit is contained in:
parent
38d1b47115
commit
1c04218434
17 changed files with 740 additions and 66 deletions
21
noxfile.py
21
noxfile.py
|
|
@ -6,10 +6,14 @@
|
|||
# dependencies = ["nox>=2025.02.09", "antsibull-nox"]
|
||||
# ///
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import nox
|
||||
|
||||
# Whether the noxfile is running in CI:
|
||||
IN_CI = os.environ.get("CI") == "true"
|
||||
|
||||
|
||||
try:
|
||||
import antsibull_nox
|
||||
|
|
@ -32,6 +36,23 @@ def botmeta(session: nox.Session) -> None:
|
|||
session.run("python", "tests/sanity/extra/botmeta.py")
|
||||
|
||||
|
||||
@nox.session(name="ansible-output", default=False)
|
||||
def ansible_output(session: nox.Session) -> None:
|
||||
session.install(
|
||||
"ansible-core",
|
||||
"antsibull-docs",
|
||||
# Needed libs for some code blocks:
|
||||
"jc",
|
||||
"hashids",
|
||||
# Tools for post-processing
|
||||
"ruamel.yaml", # used by docs/docsite/reformat-yaml.py
|
||||
)
|
||||
args = []
|
||||
if IN_CI:
|
||||
args.append("--check")
|
||||
session.run("antsibull-docs", "ansible-output", *args, *session.posargs)
|
||||
|
||||
|
||||
# Allow to run the noxfile with `python noxfile.py`, `pipx run noxfile.py`, or similar.
|
||||
# Requires nox >= 2025.02.09
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue