Unitystation-fork / Unitystation-WikiV2

un wiki plus agréable a regardé.
6 stars 3 forks source link

job menu #117

Open Fr-Dae opened 1 year ago

Fr-Dae commented 1 year ago

http://31.211.16.159:8203/docs/HowToPlay/Jobs/

http://31.211.16.159:8203/docs/HowToPlay/Jobs/Captain.md should Be http://31.211.16.159:8203/docs/HowToPlay/Jobs/Command_roles/Captain

http://31.211.16.159:8203/docs/HowToPlay/Jobs/Head-of-Security.md bould be http://31.211.16.159:8203/docs/HowToPlay/Jobs/Security_roles/Head-of-Security

Voici la proposition de ChatGPT

import os

#Définir le chemin d'accès à votre dossier de fichiers
path = "path/to/your/files"

#Parcourir tous les fichiers dans le dossier
for filename in os.listdir(path):
    #Vérifiez si le fichier est un fichier .md
    if filename.endswith(".md"):
        #Récupérer le nom du fichier sans l'extension
        file_without_ext = os.path.splitext(filename)[0]
        #Remplacer "Jobs" avec "Security_roles" ou "Command_roles"
        new_file_name = file_without_ext.replace("Jobs", "Security_roles")
        new_file_name = file_without_ext.replace("Jobs", "Command_roles")
        #Récupérer le chemin d'accès complet au fichier
        file_path = os.path.join(path, filename)
        #Créer le nouveau lien
        new_link = "http://31.211.16.159:8203/docs/HowToPlay/" + new_file_name
        print("Ancien lien : ", file_path)
        print("Nouveau lien : ", new_link)
Fr-Dae commented 1 year ago
#Définir le chemin d'accès à votre dossier de fichiers
path = "path/to/your/files"

#Définir la table de correspondance entre les départements et les rôles
departments_roles = {
    "Command": ["Captain", "Head of Personnel"],
    "Security": ["Head of Security", "Warden", "Security Officer", "Detective"],
    "Engineering": ["Chief Engineer", "Engineer", "Atmospherics Technician"],
    "Science": ["Research Director", "Scientist", "Geneticist", "Roboticist"],
    "Medical": ["Chief Medical Officer", "Medical Doctor", "Paramedic", "Chemist", "Virologist"],
    "Cargo": ["Quartermaster", "Cargo Technician", "Shaft Miner"],
    "Service": ["Botanist", "Bartender", "Cook", "Janitor", "Clown", "Mime", "Curator", "Lawyer", "Chaplain", "Assistant", "Psychologist"],
    "Synthetic": ["Station AI"],
    "Ghost Roles": ["Ancient Engineer", "Ash Walker", "Fugitive"],
    "Antagonist": ["Revolutionary", "Nuclear operative", "Traitor", "Blob", "Wizard"],
    "Centcom": ["Centcom Officer", "Death Squad", "Emergency Response Team", "Redshield Officer"]
}

#Parcourir tous les départements
for department, roles in departments_roles.items():
    #Parcourir tous les rôles dans chaque département
    for role in roles:
        #Créer le nouveau lien
        new_link = "http://31.211.16.159:8203/docs/HowToPlay/" + department + "/" + role
        print("Nouveau lien pour le rôle "+ role + ": ", new_link)
Fr-Dae commented 1 year ago

il manque "Entertainment_Roles" dans le rolebar