diff --git a/mkdocs copy.yml b/mkdocs copy.yml new file mode 100644 index 0000000..7fa533b --- /dev/null +++ b/mkdocs copy.yml @@ -0,0 +1,143 @@ +site_name: Sthope Wiki +repo_url: https://git.sthope.dev/sthope/wiki +repo_name: sthope/wiki +edit_uri: _edit/master/docs/ +site_url: https://wiki.sthope.dev +site_author: sthope + + +theme: + name: material + language: en + logo: images/sthope_wiki.png + favicon: images/assets/favicon.png + icon: + repo: fontawesome/brands/github + logo: fontawesome/regular/folder-open + palette: + - scheme: slate + toggle: + icon: material/weather-sunny + name: Switch to light mode + - scheme: default + toggle: + icon: material/weather-night + name: Switch to dark mode + + font: + code: Jet Brains Mono + features: + - navigation.instant + #- navigation.sections # prevents collapsible sections + #- navigation.expand #expands sections by default + # insiders only + - search.suggest + +plugins: + - git-revision-date + - search + - minify: + minify_html: true + - external-markdown + +markdown_extensions: + - abbr + - admonition # enables coloured blocks mid article + - attr_list # improves image handling + - pymdownx.details # enables collapsible admonitions + - footnotes + - meta # adds support for front matter + - toc: + permalink: true + toc_depth: 4 + - pymdownx.highlight: # code highlighting + linenums: true + # anchor_linenums: true + - pymdownx.tabbed # enables tabs for embedded blocks + # - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences # allows for the nesting of code blocks inside other blocks + - pymdownx.keys + +copyright: Sthope © 2022 +extra: + social: + - icon: 'fontawesome/brands/github' + link: 'https://github.com/sthopeless' + name: GitHub + - icon: 'fontawesome/brands/git' + link: 'https://git.sthope.dev/sthope' + name: Gitea + - icon: 'fontawesome/brands/discord' + link: 'https://discordapp.com/users/365825462074605569/' + name: Message me on Discord + +nav: + # - Tutorials: + # - MKDocs with Gitea and Drone: tutorials/mkdocs-with-gitea-and-drone.md + - Proxmox: + # - Debian VM: proxmox/Debian-VM.md + - Home Assistant on Proxmox: proxmox/how-to-install-home-assistant.md + - LXC Debian: proxmox/LXC-Debian.md + - LXC Passthrough: proxmox/Passthrough.md + - Proxmox send CPU Temp to Home-Assistant/MQTT: proxmox/send-cpu-temp-to-ha.md + - Ubuntu VM Resize Disk: proxmox/ubuntu-vm-resize-disk.md + # - 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 + - CrowdSec: portainer-stacks/CrowdSec.md + - cryptpad: portainer-stacks/cryptpad.md + - dashy: portainer-stacks/dashy.md + - digiKam: portainer-stacks/digiKam.md + - Dillinger: portainer-stacks/Dillinger.md + - Drone: portainer-stacks/Drone.md + - ethercalc: portainer-stacks/ethercalc.md + - Gitea: portainer-stacks/Gitea.md + - guacamole: portainer-stacks/guacamole.md + - heimdall: portainer-stacks/heimdall.md + - invidious: portainer-stacks/invidious.md + - jellyfin: portainer-stacks/jellyfin.md + - LibrePhotos: portainer-stacks/LibrePhotos.md + - Librespeed: portainer-stacks/Librespeed.md + - mealie: portainer-stacks/mealie.md + - mqtt-explorer: portainer-stacks/mqtt-explorer.md + - MQTT-Mosquitto: portainer-stacks/MQTT-Mosquitto.md + - n8n: portainer-stacks/n8n.md + - Nextcloud: portainer-stacks/Nextcloud.md + - octoprint: portainer-stacks/octoprint.md + - Ombi: portainer-stacks/Ombi.md + - onlyoffice: portainer-stacks/onlyoffice.md + - Overseerr: portainer-stacks/Overseerr.md + - phoneinfoga: portainer-stacks/phoneinfoga.md + - PhotoView: portainer-stacks/PhotoView.md + - piped: portainer-stacks/piped.md + - Prowlarr: portainer-stacks/Prowlarr.md + - qbittorrent: portainer-stacks/qbittorrent.md + - 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 + - Transmission: portainer-stacks/Transmission.md + - tvheadend: portainer-stacks/tvheadend.md + - uptime-kuma: portainer-stacks/uptime-kuma.md + - VSCode: portainer-stacks/VSCode.md + - Whisparr: portainer-stacks/Whisparr.md + - WireGuard: portainer-stacks/WireGuard.md + - Zigbee2MQTT: portainer-stacks/Zigbee2MQTT.md + - Swag: + - Swag: portainer-stacks/Swag.md + - Swag MODs: portainer-stacks/Swag/Swag-MODS.md + - Authelia: portainer-stacks/authelia.md + - Theme-Park: portainer-stacks/Swag/adding-theme-park.md + - cmnds: + - 101: cmnds/101.md + - AddUser 1Line: cmnds/adduser-1line.md + - Tasmota Backlogs: cmnds/tasmota-backlogs.md + - sthope: '/portainer-stacks/' \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 7fa533b..16508a2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -131,6 +131,55 @@ nav: - Whisparr: portainer-stacks/Whisparr.md - WireGuard: portainer-stacks/WireGuard.md - Zigbee2MQTT: portainer-stacks/Zigbee2MQTT.md + - 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 + - CrowdSec: portainer-stacks/CrowdSec.md + - cryptpad: portainer-stacks/cryptpad.md + - dashy: portainer-stacks/dashy.md + - digiKam: portainer-stacks/digiKam.md + - Dillinger: portainer-stacks/Dillinger.md + - Drone: portainer-stacks/Drone.md + - ethercalc: portainer-stacks/ethercalc.md + - Gitea: portainer-stacks/Gitea.md + - guacamole: portainer-stacks/guacamole.md + - heimdall: portainer-stacks/heimdall.md + - invidious: portainer-stacks/invidious.md + - jellyfin: portainer-stacks/jellyfin.md + - LibrePhotos: portainer-stacks/LibrePhotos.md + - Librespeed: portainer-stacks/Librespeed.md + - mealie: portainer-stacks/mealie.md + - mqtt-explorer: portainer-stacks/mqtt-explorer.md + - MQTT-Mosquitto: portainer-stacks/MQTT-Mosquitto.md + - n8n: portainer-stacks/n8n.md + - Nextcloud: portainer-stacks/Nextcloud.md + - octoprint: portainer-stacks/octoprint.md + - Ombi: portainer-stacks/Ombi.md + - onlyoffice: portainer-stacks/onlyoffice.md + - Overseerr: portainer-stacks/Overseerr.md + - phoneinfoga: portainer-stacks/phoneinfoga.md + - PhotoView: portainer-stacks/PhotoView.md + - piped: portainer-stacks/piped.md + - Prowlarr: portainer-stacks/Prowlarr.md + - qbittorrent: portainer-stacks/qbittorrent.md + - 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 + - Transmission: portainer-stacks/Transmission.md + - tvheadend: portainer-stacks/tvheadend.md + - uptime-kuma: portainer-stacks/uptime-kuma.md + - VSCode: portainer-stacks/VSCode.md + - Whisparr: portainer-stacks/Whisparr.md + - WireGuard: portainer-stacks/WireGuard.md + - Zigbee2MQTT: portainer-stacks/Zigbee2MQTT.md + - Airsonic: portainer-stacks/Airsonic.md + - Zigbee2MQTT: portainer-stacks/Zigbee2MQTT.md - Swag: - Swag: portainer-stacks/Swag.md - Swag MODs: portainer-stacks/Swag/Swag-MODS.md diff --git a/scripts/1.py b/scripts/1.py index 60a7eb7..8b06382 100644 --- a/scripts/1.py +++ b/scripts/1.py @@ -1,10 +1,15 @@ import os +import argparse # Define the directory containing Portainer Stack Markdown files -markdown_dir = "./docs/proxmox" +markdown_dir = "./docs/portainer-stacks" # Define the relative path prefix used in mkdocs.yml -relative_path_prefix = "proxmox/" +relative_path_prefix = "portainer-stacks/" + +# Read the existing mkdocs.yml content +with open("mkdocs.yml", "r") as f: + mkdocs_content = f.read() # Generate navigation entries nav_entries = [] @@ -23,6 +28,20 @@ filtered_nav_entries = [entry for entry in nav_entries if not any(name in entry # 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) +# Combine all the sorted navigation entries into a single string +new_section_content = "\n".join(sorted_nav_entries) + +# Parse command-line arguments +parser = argparse.ArgumentParser(description="Generate navigation entries for mkdocs.yml") +parser.add_argument("--replace", action="store_true", help="Replace mkdocs.yml with new content") +args = parser.parse_args() + +# If --replace option is provided, replace the existing "Portainer Stacks" section +if args.replace: + updated_mkdocs_content = mkdocs_content.replace(" - Portainer Stacks:\n", f" - Portainer Stacks:\n{new_section_content}\n") + with open("mkdocs.yml", "w") as f: + f.write(updated_mkdocs_content) +else: + # 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 index 6a29163..5c554cf 100644 --- a/scripts/git.py +++ b/scripts/git.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import os import subprocess import argparse @@ -13,6 +15,9 @@ if args.COMMIT_MSG: else: commit_msg = input("Enter commit message: ") +# Add changes to the staging area +subprocess.run(["python3", "./scripts/list_new_docker_files.py", "--replace"], check=True) + # Add changes to the staging area subprocess.run(["git", "add", "."], check=True) diff --git a/scripts/list_new_docker_files.py b/scripts/list_new_docker_files.py index f59d87d..8b06382 100644 --- a/scripts/list_new_docker_files.py +++ b/scripts/list_new_docker_files.py @@ -1,4 +1,5 @@ import os +import argparse # Define the directory containing Portainer Stack Markdown files markdown_dir = "./docs/portainer-stacks" @@ -6,6 +7,10 @@ markdown_dir = "./docs/portainer-stacks" # Define the relative path prefix used in mkdocs.yml relative_path_prefix = "portainer-stacks/" +# Read the existing mkdocs.yml content +with open("mkdocs.yml", "r") as f: + mkdocs_content = f.read() + # Generate navigation entries nav_entries = [] for filename in os.listdir(markdown_dir): @@ -23,6 +28,20 @@ filtered_nav_entries = [entry for entry in nav_entries if not any(name in entry # 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) +# Combine all the sorted navigation entries into a single string +new_section_content = "\n".join(sorted_nav_entries) + +# Parse command-line arguments +parser = argparse.ArgumentParser(description="Generate navigation entries for mkdocs.yml") +parser.add_argument("--replace", action="store_true", help="Replace mkdocs.yml with new content") +args = parser.parse_args() + +# If --replace option is provided, replace the existing "Portainer Stacks" section +if args.replace: + updated_mkdocs_content = mkdocs_content.replace(" - Portainer Stacks:\n", f" - Portainer Stacks:\n{new_section_content}\n") + with open("mkdocs.yml", "w") as f: + f.write(updated_mkdocs_content) +else: + # Print the sorted navigation entries with 4 spaces + for entry in sorted_nav_entries: + print(entry)