From 5792ba3dd6b28f08986b63f7cf71ba1980fac6b4 Mon Sep 17 00:00:00 2001 From: sthope Date: Sat, 19 Aug 2023 23:03:35 +0200 Subject: [PATCH] cleaning --- docs/portainer-stacks/{Swag => }/Swag.md | 0 docs/portainer-stacks/{Swag => }/authelia.md | 0 mkdocs.yml | 6 +++-- scripts/1.py | 28 ++++++++++++++++++++ scripts/git.py | 25 +++++++++++++++++ 5 files changed, 57 insertions(+), 2 deletions(-) rename docs/portainer-stacks/{Swag => }/Swag.md (100%) rename docs/portainer-stacks/{Swag => }/authelia.md (100%) create mode 100644 scripts/1.py create mode 100644 scripts/git.py diff --git a/docs/portainer-stacks/Swag/Swag.md b/docs/portainer-stacks/Swag.md similarity index 100% rename from docs/portainer-stacks/Swag/Swag.md rename to docs/portainer-stacks/Swag.md diff --git a/docs/portainer-stacks/Swag/authelia.md b/docs/portainer-stacks/authelia.md similarity index 100% rename from docs/portainer-stacks/Swag/authelia.md rename to docs/portainer-stacks/authelia.md diff --git a/mkdocs.yml b/mkdocs.yml index 9d73ed0..7fa533b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -85,6 +85,7 @@ nav: # - VM Passthrough Harddrives: proxmox/vm-passthrough-harddrives.md - Portainer Stacks: - Airsonic: portainer-stacks/Airsonic.md + - authelia: portainer-stacks/authelia.md - Authentik: portainer-stacks/Authentik.md - bazarr: portainer-stacks/bazarr.md - Bitwarden: portainer-stacks/Bitwarden.md @@ -119,6 +120,7 @@ nav: - rustdesk: portainer-stacks/rustdesk.md - samba: portainer-stacks/samba.md - shlink: portainer-stacks/shlink.md + - Swag: portainer-stacks/Swag.md - tailscale: portainer-stacks/tailscale.md - TasmoBackup: portainer-stacks/TasmoBackup.md - Tasmota-Device-Manager: portainer-stacks/Tasmota-Device-Manager.md @@ -130,9 +132,9 @@ nav: - WireGuard: portainer-stacks/WireGuard.md - Zigbee2MQTT: portainer-stacks/Zigbee2MQTT.md - Swag: - - Swag: portainer-stacks/Swag/Swag.md + - Swag: portainer-stacks/Swag.md - Swag MODs: portainer-stacks/Swag/Swag-MODS.md - - Authelia: portainer-stacks/Swag/authelia.md + - Authelia: portainer-stacks/authelia.md - Theme-Park: portainer-stacks/Swag/adding-theme-park.md - cmnds: - 101: cmnds/101.md diff --git a/scripts/1.py b/scripts/1.py new file mode 100644 index 0000000..60a7eb7 --- /dev/null +++ b/scripts/1.py @@ -0,0 +1,28 @@ +import os + +# Define the directory containing Portainer Stack Markdown files +markdown_dir = "./docs/proxmox" + +# Define the relative path prefix used in mkdocs.yml +relative_path_prefix = "proxmox/" + +# Generate navigation entries +nav_entries = [] +for filename in os.listdir(markdown_dir): + if filename.endswith(".md"): + title = filename[:-3] # Remove ".md" extension + relative_path = f"{relative_path_prefix}{filename}" # Generate relative path + nav_entries.append(f" - {title}: {relative_path}") # Add 4 spaces + +# List of names to ignore +names_to_ignore = ["template"] # Add names you want to ignore here + +# Filter out entries to ignore +filtered_nav_entries = [entry for entry in nav_entries if not any(name in entry for name in names_to_ignore)] + +# Sort the navigation entries alphabetically (case-insensitive) +sorted_nav_entries = sorted(filtered_nav_entries, key=lambda entry: entry.lower()) + +# Print the sorted navigation entries with 4 spaces +for entry in sorted_nav_entries: + print(entry) diff --git a/scripts/git.py b/scripts/git.py new file mode 100644 index 0000000..6a29163 --- /dev/null +++ b/scripts/git.py @@ -0,0 +1,25 @@ +import os +import subprocess +import argparse + +# Define and parse command-line arguments +parser = argparse.ArgumentParser(description="Automate Git add, commit, and push operations.") +parser.add_argument("--COMMIT-MSG", help="Commit message for the changes.") +args = parser.parse_args() + +# Get the commit message from command-line argument or prompt user +if args.COMMIT_MSG: + commit_msg = args.COMMIT_MSG +else: + commit_msg = input("Enter commit message: ") + +# Add changes to the staging area +subprocess.run(["git", "add", "."], check=True) + +# Commit changes +subprocess.run(["git", "commit", "-m", commit_msg], check=True) + +# Push changes +subprocess.run(["git", "push"], check=True) + +print("Changes have been added, committed, and pushed.")