119 lines
4.2 KiB
Python
119 lines
4.2 KiB
Python
r"""Copie la documentation de docs/ vers un clone du wiki Gitea (les pages du wiki sont générées).
|
|
|
|
git clone https://git.linkatplug.be/linkatplug/DoubleTroubleRecomp.wiki.git ..\wiki
|
|
python tools/wiki_sync.py ..\wiki
|
|
cd ..\wiki && git add -A && git commit -m "Mise à jour depuis docs/" && git push
|
|
|
|
docs/ reste la source : on modifie les fichiers du dépôt, puis on relance ce script.
|
|
"""
|
|
import os
|
|
import re
|
|
import sys
|
|
|
|
REPO = "https://git.linkatplug.be/linkatplug/DoubleTroubleRecomp"
|
|
|
|
# fichier de docs/ -> page du wiki
|
|
PAGES = {
|
|
"GUIDE.md": "Guide",
|
|
"GUIDE.en.md": "Guide-EN",
|
|
"SETTINGS.md": "Reglages",
|
|
"MODS.md": "Mods",
|
|
"ROADMAP.md": "Feuille-de-route",
|
|
"ROADMAP.en.md": "Roadmap",
|
|
}
|
|
|
|
HOME = """<p align="center"><img src="{repo}/raw/branch/main/docs/images/logo-fr.png" alt="DoubleTroubleRecomp"></p>
|
|
|
|
# DoubleTroubleRecomp
|
|
|
|
**Bud Tucker in Double Trouble** (Merit Studios, 1996), recompilé en C natif : plus de DOSBox, une image
|
|
nette et fluide de 1080p à 4K, des filtres, un pack HD des décors et des mods.
|
|
*Static recompilation to native C: no DOSBox, a sharp and smooth picture from 1080p to 4K, filters,
|
|
an HD background pack and mods.*
|
|
|
|
> Il faut posséder le jeu original : le dépôt ne contient aucun fichier du jeu.
|
|
> *You must own the original game: the repository contains no game files.*
|
|
|
|
## 🇫🇷 Français
|
|
|
|
- **[Guide complet](Guide)** : outils à installer, launcher, compilation, jeu, filtres, pack HD,
|
|
mods, sauvegardes, dépannage.
|
|
- [Réglages](Reglages) : `settings.ini`, menu F12, options de ligne de commande.
|
|
- [Mods et pack HD](Mods) : format des mods et des décors HD.
|
|
- [Feuille de route](Feuille-de-route)
|
|
|
|
## 🇺🇸 English
|
|
|
|
- **[Complete guide](Guide-EN)**: tools to install, launcher, build, playing, filters, HD pack,
|
|
mods, saved games, troubleshooting.
|
|
- [Settings](Reglages) and [Mods](Mods) reference pages (in French).
|
|
- [Roadmap](Roadmap)
|
|
|
|
## En bref / In short
|
|
|
|
1. Installer / install **Visual Studio Build Tools 2022** (C++), **Python 3.12** (PATH), **Rust**.
|
|
2. `git clone {repo}.git`
|
|
3. `cd DoubleTroubleRecomp\\launcher` → `cargo build --release` → `target\\release\\DoubleTroubleLauncher.exe`
|
|
4. Choisir le jeu, **Générer et compiler**, **JOUER** / pick the game, **Generate and build**, **PLAY**.
|
|
|
|
<p align="center"><img src="{repo}/raw/branch/main/docs/images/launcher-fr-3-accueil.jpg" alt="Launcher" width="800"></p>
|
|
|
|
Code : [{repo}]({repo})
|
|
"""
|
|
|
|
SIDEBAR = """**DoubleTroubleRecomp**
|
|
|
|
- [Accueil / Home](Home)
|
|
|
|
🇫🇷
|
|
- [Guide complet](Guide)
|
|
- [Réglages](Reglages)
|
|
- [Mods et pack HD](Mods)
|
|
- [Feuille de route](Feuille-de-route)
|
|
|
|
🇺🇸
|
|
- [Complete guide](Guide-EN)
|
|
- [Roadmap](Roadmap)
|
|
|
|
[Code source]({repo})
|
|
"""
|
|
|
|
|
|
def convert(text, name):
|
|
def link(m):
|
|
target = m.group(1)
|
|
path, _, anchor = target.partition("#")
|
|
if path in PAGES:
|
|
return "](" + PAGES[path] + ("#" + anchor if anchor else "") + ")"
|
|
if path and not re.match(r"[a-z]+:", path):
|
|
# autre fichier du dépôt : lien vers sa version en ligne
|
|
return "](" + REPO + "/src/branch/main/docs/" + target + ")"
|
|
return m.group(0)
|
|
|
|
text = re.sub(r"\]\(([^)\s]+)\)", link, text)
|
|
# images : servies depuis le dépôt
|
|
text = text.replace('src="images/', 'src="' + REPO + "/raw/branch/main/docs/images/")
|
|
note = f"*Page générée depuis [docs/{name}]({REPO}/src/branch/main/docs/{name}).*\n\n"
|
|
return text.rstrip() + "\n\n---\n\n" + note
|
|
|
|
|
|
def main():
|
|
if len(sys.argv) != 2:
|
|
sys.exit(__doc__)
|
|
wiki = sys.argv[1]
|
|
docs = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "docs")
|
|
for src, page in PAGES.items():
|
|
with open(os.path.join(docs, src), encoding="utf-8") as f:
|
|
text = convert(f.read(), src)
|
|
with open(os.path.join(wiki, page + ".md"), "w", encoding="utf-8", newline="\n") as f:
|
|
f.write(text)
|
|
print(f"{src} -> {page}.md")
|
|
for page, text in (("Home", HOME), ("_Sidebar", SIDEBAR)):
|
|
with open(os.path.join(wiki, page + ".md"), "w", encoding="utf-8", newline="\n") as f:
|
|
f.write(text.format(repo=REPO))
|
|
print(f"{page}.md")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|