improve nox make session docs

Co-authored-by: Don Naro <dnaro@redhat.com>
This commit is contained in:
Maxwell G
2023-12-01 11:50:25 -06:00
parent 696286e0fc
commit 352c8e9e47
2 changed files with 8 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ This project includes a `nox` configuration to automate tests, checks, and other
You can use these automated tests to help you verify changes before you submit a PR. You can use these automated tests to help you verify changes before you submit a PR.
You can manually You can manually
[set up your environment](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#setting-up-your-environment-to-build-documentation-locally) [set up your environment](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#setting-up-your-environment-to-build-documentation-locally)
if you prefer, but the `nox` configuration significantly simplifies this process. if you prefer, but `nox` is more straightforward and create an isolated environment for you.
* Install `nox` using `python3 -m pip install nox` or your distribution's package manager. * Install `nox` using `python3 -m pip install nox` or your distribution's package manager.
@@ -29,8 +29,7 @@ if you prefer, but the `nox` configuration significantly simplifies this process
The different Makefile targets used to build the documentation are outlined in The different Makefile targets used to build the documentation are outlined in
[Building the documentation locally](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#building-the-documentation-locally). [Building the documentation locally](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#building-the-documentation-locally).
The `nox` configuration has a `make` session to automate setting up a docs build The `nox` configuration has a `make` session that creates a build environment and uses the Makefile to generate HTML.
environment and running the Makefile.
* Clone required parts of the `ansible/ansible` repository. * Clone required parts of the `ansible/ansible` repository.
@@ -40,13 +39,13 @@ environment and running the Makefile.
See [Periodically cloning Ansible core](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#periodically-cloning-ansible-core) for more information. See [Periodically cloning Ansible core](https://docs.ansible.com/ansible/latest/community/documentation_contributions.html#periodically-cloning-ansible-core) for more information.
* Run a minimal Ansible Core docs build. * Build minimal Ansible Core docs.
``` bash ``` bash
nox -s make nox -s make
``` ```
* Run a specific Makefile target with options * Run a specific Makefile target:
``` bash ``` bash
nox -s make -- clean htmlsingle rst=community/documentation_contributions.rst nox -s make -- clean htmlsingle rst=community/documentation_contributions.rst

View File

@@ -165,10 +165,12 @@ def checkers(session: nox.Session, test: str):
@nox.session @nox.session
def make(session: nox.Session): def make(session: nox.Session):
""" """
Run the docs build Makefile in an isolated environment Generate HTML from documentation source using the Makefile
""" """
parser = _relaxed_parser(session) parser = _relaxed_parser(session)
parser.add_argument("make_args", nargs="*", help="Arguments to pass on to make") parser.add_argument(
"make_args", nargs="*", help="Specify make targets as arguments"
)
args = parser.parse_args(session.posargs) args = parser.parse_args(session.posargs)
install(session, req="requirements-relaxed" if args.relaxed else "requirements") install(session, req="requirements-relaxed" if args.relaxed else "requirements")