From 2e6cdf6fa27dde936494d8a84ea7f64a84a59f1e Mon Sep 17 00:00:00 2001 From: Xuan Hu Date: Sun, 7 Apr 2024 18:17:46 +0800 Subject: [PATCH 1/2] docs: refine docs generation script and template --- changelog.d/1325.doc.md | 1 + scripts/gen_doc_pages.py | 13 ++++++++---- scripts/templates/docs.md | 44 ++++++++++++++++++++++++++++++++------- 3 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 changelog.d/1325.doc.md diff --git a/changelog.d/1325.doc.md b/changelog.d/1325.doc.md new file mode 100644 index 0000000000..004de5cc27 --- /dev/null +++ b/changelog.d/1325.doc.md @@ -0,0 +1 @@ +Refine docs generation script and template. \ No newline at end of file diff --git a/scripts/gen_doc_pages.py b/scripts/gen_doc_pages.py index ecab566b14..80f9ed1407 100644 --- a/scripts/gen_doc_pages.py +++ b/scripts/gen_doc_pages.py @@ -19,24 +19,29 @@ def get_help(cmd: Optional[str]) -> str: content = content.replace(str(Path("~").expanduser()), "~") return f""" ``` -{" ".join(args[2:])} {content} ``` """ params = { - "runpip": get_help("runpip"), "install": get_help("install"), + "installall": get_help("install-all"), + "uninject": get_help("uninject"), + "inject": get_help("inject"), "upgrade": get_help("upgrade"), "upgradeall": get_help("upgrade-all"), - "inject": get_help("inject"), "uninstall": get_help("uninstall"), "uninstallall": get_help("uninstall-all"), + "reinstall": get_help("reinstall"), "reinstallall": get_help("reinstall-all"), "list": get_help("list"), + "interpreter": get_help("interpreter"), "run": get_help("run"), - "version": __version__, + "runpip": get_help("runpip"), + "ensurepath": get_help("ensurepath"), + "environment": get_help("environment"), + "completions": get_help("completions"), "usage": get_help(None), } diff --git a/scripts/templates/docs.md b/scripts/templates/docs.md index edf6b7e22f..138fbe5f9f 100644 --- a/scripts/templates/docs.md +++ b/scripts/templates/docs.md @@ -1,12 +1,20 @@ -{{ usage }} +{{usage}} ### pipx install -{{ install }} +{{install}} -### pipx run +### pipx install-all -{{run}} +{{installall}} + +### pipx uninject + +{{uninject}} + +### pipx inject + +{{inject}} ### pipx upgrade @@ -16,10 +24,6 @@ {{upgradeall}} -### pipx inject - -{{inject}} - ### pipx uninstall {{uninstall}} @@ -28,6 +32,10 @@ {{uninstallall}} +### pipx reinstall + +{{reinstall}} + ### pipx reinstall-all {{reinstallall}} @@ -36,6 +44,26 @@ {{list}} +### pipx interpreter + +{{interpreter}} + +### pipx run + +{{run}} + ### pipx runpip {{runpip}} + +### pipx ensurepath + +{{ensurepath}} + +### pipx environment + +{{environment}} + +### pipx completions + +{{completions}} From 44baff2b09f06e6d5140f99c6c4b07beb2907a27 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 7 Apr 2024 10:32:40 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- changelog.d/1325.doc.md | 2 +- scripts/gen_doc_pages.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/changelog.d/1325.doc.md b/changelog.d/1325.doc.md index 004de5cc27..94ec89bbca 100644 --- a/changelog.d/1325.doc.md +++ b/changelog.d/1325.doc.md @@ -1 +1 @@ -Refine docs generation script and template. \ No newline at end of file +Refine docs generation script and template. diff --git a/scripts/gen_doc_pages.py b/scripts/gen_doc_pages.py index 80f9ed1407..0e91c8e294 100644 --- a/scripts/gen_doc_pages.py +++ b/scripts/gen_doc_pages.py @@ -7,8 +7,6 @@ import mkdocs_gen_files from jinja2 import Environment, FileSystemLoader -from pipx.main import __version__ - def get_help(cmd: Optional[str]) -> str: base = ["pipx"]