wip
This commit is contained in:
parent
c4f7349e59
commit
c23e2333d1
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
||||
.vscode/
|
39
README.md
39
README.md
@ -0,0 +1,39 @@
|
||||
# Admin´s Log
|
||||
|
||||
## Inhalt
|
||||
|
||||
- [Admin´s Log](#admins-log)
|
||||
- [Inhalt](#inhalt)
|
||||
- [Informationen](#informationen)
|
||||
- [Themen](#themen)
|
||||
- [AsciiDoc](#asciidoc)
|
||||
- [Git](#git)
|
||||
- [Neue Dokumente](#neue-dokumente)
|
||||
|
||||
---
|
||||
|
||||
## Informationen
|
||||
|
||||
---
|
||||
|
||||
## Themen
|
||||
|
||||
---
|
||||
|
||||
### AsciiDoc
|
||||
|
||||
- [Asciidoctor PDF: Kapitel bleibt „Chapter“ – Fehleranalyse & Workaround](dokus/asciidoc/asciidoctor-theme-bug-workaround.md)
|
||||
|
||||
---
|
||||
|
||||
### Git
|
||||
|
||||
- [Artikel: git](dokus/git/git.md)
|
||||
- [SSH-Zugriff auf Git-Repository in WSL einrichten](dokus/git/git-ssh-remote.md)
|
||||
|
||||
---
|
||||
|
||||
## Neue Dokumente
|
||||
|
||||
> führe `scan.cmd` oder [`link_collector.py`](./tools/collector/link_collector.py) aus um nach neuen Dateien zu suchen!
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
Beim Generieren von PDFs mit `asciidoctor-pdf` (Version 2.3.19) wird die Kapitelüberschrift trotz korrekt gesetztem deutschen Theme und Sprache **nicht lokalisiert**:
|
||||
|
||||
```
|
||||
```text
|
||||
Chapter 1. Einführung
|
||||
```
|
||||
|
||||
…statt:
|
||||
|
||||
```
|
||||
```text
|
||||
Kapitel 1. Einführung
|
||||
```
|
||||
|
||||
@ -33,6 +33,7 @@ Folgendes wurde korrekt gesetzt:
|
||||
## ❌ Ergebnis
|
||||
|
||||
Trotz aller Korrektheit:
|
||||
|
||||
- Ausgabe bleibt auf Englisch
|
||||
- Lokalisierung über Theme wird ignoriert
|
||||
- Das Verhalten ist **reproduzierbar auf mehreren Rechnern und Installationen**
|
||||
@ -42,8 +43,9 @@ Trotz aller Korrektheit:
|
||||
## 🧨 Vermutete Ursache
|
||||
|
||||
Ein Bug oder ein Regressionseffekt in `asciidoctor-pdf` ab Version `2.3.0`, bei dem:
|
||||
- entweder `chapter.title` aus Theme nicht mehr greift
|
||||
- oder durch eine andere Sprachverarbeitung überschrieben wird
|
||||
|
||||
- entweder `chapter.title` aus Theme nicht mehr greift
|
||||
- oder durch eine andere Sprachverarbeitung überschrieben wird
|
||||
|
||||
---
|
||||
|
||||
@ -78,4 +80,3 @@ Statt auf automatische Kapitelüberschriften zu setzen, diese manuell überschre
|
||||
- `asciidoctor 2.0.23`
|
||||
- `ruby 3.1.x`
|
||||
- UTF-8 / Linux / WSL – identisches Verhalten
|
||||
|
||||
|
@ -0,0 +1,122 @@
|
||||
# SSH-Zugriff auf Git-Repository in WSL einrichten
|
||||
|
||||
Diese Anleitung beschreibt, wie man innerhalb von WSL (z. B. Ubuntu) ein Git-Repository per SSH nutzen kann, z. B. bei einem selbst gehosteten Gitea-Server auf `dns.lan` mit Port `2222`.
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Voraussetzungen
|
||||
|
||||
- WSL ist eingerichtet (z. B. Ubuntu)
|
||||
- Ein Git-Server ist erreichbar (z. B. `git@dns.lan:2222`)
|
||||
- Du hast bereits Zugriff über Windows (z. B. via PowerShell)
|
||||
- OpenSSH ist in der WSL-Distribution installiert
|
||||
|
||||
---
|
||||
|
||||
## 🧱 Schritt 1: SSH-Verzeichnis in WSL anlegen
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🗝️ Schritt 2: SSH-Schlüssel aus Windows in WSL übernehmen
|
||||
|
||||
Falls du in Windows bereits einen Schlüssel hast, z. B. `C:\Users\NAME\.ssh\id_ed25519`, kopiere ihn:
|
||||
|
||||
```bash
|
||||
cp /mnt/c/Users/NAME/.ssh/id_ed25519 ~/.ssh/
|
||||
cp /mnt/c/Users/NAME/.ssh/id_ed25519.pub ~/.ssh/
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
chmod 644 ~/.ssh/id_ed25519.pub
|
||||
```
|
||||
|
||||
🔁 Ersetze `NAME` mit deinem Windows-Benutzernamen.
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Schritt 3: SSH-Konfiguration (optional, empfohlen)
|
||||
|
||||
Erstelle (oder bearbeite) die Datei `~/.ssh/config`:
|
||||
|
||||
```bash
|
||||
nano ~/.ssh/config
|
||||
```
|
||||
|
||||
Füge ein:
|
||||
|
||||
```ssh
|
||||
Host gitea
|
||||
HostName dns.lan
|
||||
Port 2222
|
||||
User git
|
||||
IdentityFile ~/.ssh/id_ed25519
|
||||
```
|
||||
|
||||
→ Damit kannst du den Hostname `gitea` als Alias verwenden.
|
||||
|
||||
---
|
||||
|
||||
## 🧪 Schritt 4: Verbindung testen
|
||||
|
||||
```bash
|
||||
ssh -T gitea
|
||||
```
|
||||
|
||||
Erwartete Ausgabe:
|
||||
|
||||
```text
|
||||
Hi there, realAscot! You've successfully authenticated...
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🐙 Schritt 5: Git-Remote setzen oder klonen
|
||||
|
||||
### ✅ Bestehendes Repo umstellen
|
||||
|
||||
```bash
|
||||
git remote set-url origin gitea:realAscot/mein-projekt.git
|
||||
```
|
||||
|
||||
### ✅ Neues Repo klonen
|
||||
|
||||
```bash
|
||||
git clone gitea:realAscot/mein-projekt.git
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🛡️ Hinweis: Keine Shell-Zugänge über Git-SSH
|
||||
|
||||
Wenn du folgende Meldung siehst:
|
||||
|
||||
```text
|
||||
You've successfully authenticated, but Gitea does not provide shell access.
|
||||
```
|
||||
|
||||
→ Das ist normal und **kein Fehler** – Push/Pull funktioniert trotzdem.
|
||||
|
||||
---
|
||||
|
||||
## ✅ Fertig
|
||||
|
||||
Du kannst jetzt in WSL wie gewohnt per SSH arbeiten:
|
||||
|
||||
```bash
|
||||
git pull
|
||||
git push
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔁 Optional: Globale Git-Konfiguration absichern
|
||||
|
||||
```bash
|
||||
git config --global core.autocrlf input
|
||||
git config --global core.eol lf
|
||||
```
|
||||
|
||||
Damit vermeidest du Konflikte durch Windows-Zeilenenden.
|
@ -0,0 +1 @@
|
||||
# Artikel: git
|
29
scan.cmd
Normal file
29
scan.cmd
Normal file
@ -0,0 +1,29 @@
|
||||
@echo off
|
||||
REM ------------------------------------------------------------
|
||||
REM Python-Wrapper für ein definiertes Skript mit Parametern
|
||||
REM Führt ein festgelegtes Python-Skript aus und prüft, ob Python installiert ist
|
||||
REM ------------------------------------------------------------
|
||||
|
||||
REM ==== KONFIGURATION =====
|
||||
set SCRIPT=tools\collector\link_collector.py
|
||||
set PYTHON=python
|
||||
REM ========================
|
||||
|
||||
chcp 65001 >nul
|
||||
|
||||
where %PYTHON% >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo.
|
||||
echo ❌ Python wurde nicht gefunden.
|
||||
echo.
|
||||
echo Bitte installiere Python von:
|
||||
echo https://www.python.org/downloads/windows/
|
||||
echo.
|
||||
echo Alternativ: Stelle sicher, dass python.exe im PATH ist.
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Skript ausführen mit allen übergebenen Parametern
|
||||
%PYTHON% %SCRIPT% %*
|
||||
pause
|
15
tools/collector/config.jsonc
Normal file
15
tools/collector/config.jsonc
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
// Verzeichnis relativ zum Script, das durchsucht wird
|
||||
"root_dirs": [
|
||||
"dokus"
|
||||
],
|
||||
|
||||
// Nur Dateien mit dieser Endung (wird erweitert)
|
||||
"extensions": [".md"],
|
||||
|
||||
// Zielpfad für die Linkausgabe (Markdown-Datei)
|
||||
"output_file": "README.md",
|
||||
|
||||
// Optional: Log für bereits verarbeitete Dateien
|
||||
"processed_log": "processed.log"
|
||||
}
|
145
tools/collector/link_collector.py
Normal file
145
tools/collector/link_collector.py
Normal file
@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
|
||||
def script_dir():
|
||||
return Path(__file__).parent.resolve()
|
||||
|
||||
def load_config(filename="config.jsonc"):
|
||||
config_path = script_dir() / filename
|
||||
if not config_path.exists():
|
||||
print(" ⚠ Konfigurationsdatei nicht gefunden:", config_path)
|
||||
sys.exit(1)
|
||||
with open(config_path, encoding="utf-8") as f:
|
||||
return json.loads("".join(line for line in f if not line.strip().startswith("//")))
|
||||
|
||||
def parse_args():
|
||||
args = sys.argv[1:]
|
||||
parsed = {
|
||||
"scan": None,
|
||||
"ignore": [],
|
||||
"reset": False,
|
||||
"hilfe": False,
|
||||
}
|
||||
|
||||
while args:
|
||||
arg = args.pop(0)
|
||||
if arg in ("-h", "--hilfe"):
|
||||
parsed["hilfe"] = True
|
||||
elif arg == "--reset":
|
||||
parsed["reset"] = True
|
||||
elif arg in ("-s", "--scan") and args:
|
||||
parsed["scan"] = [entry.strip() for entry in args.pop(0).split(",") if entry.strip()]
|
||||
elif arg in ("-x", "--ignore") and args:
|
||||
parsed["ignore"] = [entry.strip() for entry in args.pop(0).split(",") if entry.strip()]
|
||||
else:
|
||||
print(f" ⚠ Unbekannter Parameter: {arg}")
|
||||
parsed["hilfe"] = True
|
||||
break
|
||||
|
||||
return parsed
|
||||
|
||||
def show_help():
|
||||
print("""
|
||||
(C) 2025 - Adam Skotarczak (ionivation.com)
|
||||
|
||||
🛈 Tool das Verzeichnisse nach Markdown-Dateien duchsucht und diese an eine definierte Liste anhängt als Markdown-Link.
|
||||
Verwendung: python3 link_collector.py [OPTIONEN]
|
||||
|
||||
-s, --scan Kommagetrennte Liste von Verzeichnissen zum Durchsuchen (relativ zum Aufrufpfad)
|
||||
-x, --ignore Kommagetrennte Liste von Verzeichnissen, die ignoriert werden sollen
|
||||
--reset Löscht das Logfile 'processed.log' und beendet sich
|
||||
-h, --hilfe Zeigt diese Hilfe
|
||||
|
||||
Beispiel:
|
||||
python3 link_collector.py -s docs,notes -x "docs/alt"
|
||||
""")
|
||||
|
||||
def find_md_files(root_dirs, ignore_dirs, extensions):
|
||||
for root in root_dirs:
|
||||
for dirpath, _, filenames in os.walk(root):
|
||||
if any(str(Path(dirpath)).startswith(str(ignored)) for ignored in ignore_dirs):
|
||||
continue
|
||||
for fname in filenames:
|
||||
if any(fname.endswith(ext) for ext in extensions):
|
||||
yield Path(dirpath) / fname
|
||||
|
||||
def extract_title(filepath):
|
||||
try:
|
||||
with open(filepath, encoding="utf-8") as f:
|
||||
for line in f:
|
||||
if line.strip().startswith("#"):
|
||||
return line.strip("# ").strip()
|
||||
except Exception as e:
|
||||
print(f"⚠ Fehler beim Lesen von {filepath}: {e}")
|
||||
return filepath.stem
|
||||
|
||||
def load_processed(logfile):
|
||||
if not logfile.exists():
|
||||
return set()
|
||||
with open(logfile, encoding="utf-8") as f:
|
||||
return set(line.strip() for line in f)
|
||||
|
||||
def append_to_output(output_path, links):
|
||||
with open(output_path, "a", encoding="utf-8") as f:
|
||||
for line in links:
|
||||
f.write(line + "\n")
|
||||
|
||||
def update_processed(log_path, new_paths):
|
||||
with open(log_path, "a", encoding="utf-8") as f:
|
||||
for path in new_paths:
|
||||
f.write(str(path) + "\n")
|
||||
|
||||
def main():
|
||||
config = load_config()
|
||||
args = parse_args()
|
||||
|
||||
if args["hilfe"]:
|
||||
show_help()
|
||||
return
|
||||
|
||||
log_path = script_dir() / config.get("processed_log", "processed.log")
|
||||
|
||||
if args["reset"]:
|
||||
if log_path.exists():
|
||||
log_path.unlink()
|
||||
print("🧹 Logfile gelöscht:", log_path)
|
||||
else:
|
||||
print("ℹ Logfile existierte nicht:", log_path)
|
||||
return
|
||||
|
||||
cwd = Path.cwd()
|
||||
output_file = cwd / config.get("output_file", "output.md")
|
||||
|
||||
root_dirs = args["scan"] or config.get("root_dirs", [])
|
||||
root_dirs = [Path(d).resolve() for d in root_dirs if d.strip()]
|
||||
ignore_dirs = [Path(x).resolve() for x in args["ignore"]]
|
||||
|
||||
extensions = config.get("extensions", [".md"])
|
||||
processed = load_processed(log_path)
|
||||
|
||||
new_links = []
|
||||
new_processed = []
|
||||
|
||||
for md_file in find_md_files(root_dirs, ignore_dirs, extensions):
|
||||
if md_file.resolve() == output_file.resolve():
|
||||
continue
|
||||
rel_path = md_file.relative_to(cwd)
|
||||
if str(rel_path) in processed:
|
||||
continue
|
||||
title = extract_title(md_file)
|
||||
new_links.append(f"- [{title}]({rel_path.as_posix()})")
|
||||
new_processed.append(rel_path)
|
||||
|
||||
if new_links:
|
||||
append_to_output(output_file, new_links)
|
||||
update_processed(log_path, new_processed)
|
||||
print(f"✔ {len(new_links)} neue Links hinzugefügt.")
|
||||
else:
|
||||
print(" ℹ Keine neuen Dateien gefunden.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
3
tools/collector/processed.log
Normal file
3
tools/collector/processed.log
Normal file
@ -0,0 +1,3 @@
|
||||
dokus\asciidoc\asciidoctor-theme-bug-workaround.md
|
||||
dokus\git\git-ssh-remote.md
|
||||
dokus\git\git.md
|
Loading…
x
Reference in New Issue
Block a user