This commit is contained in:
28
scripts/list_new_docker_files.py
Normal file
28
scripts/list_new_docker_files.py
Normal file
@ -0,0 +1,28 @@
|
||||
import os
|
||||
|
||||
# Define the directory containing Portainer Stack Markdown files
|
||||
markdown_dir = "./docs/portainer-stacks"
|
||||
|
||||
# Define the relative path prefix used in mkdocs.yml
|
||||
relative_path_prefix = "portainer-stacks/"
|
||||
|
||||
# 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)
|
Reference in New Issue
Block a user