HTML via the vendored marked.js). * Self-contained: no build step and no external requests, so it also works * from an unpacked ZIP. */ $docsDir = __DIR__; $docMap = []; foreach (glob($docsDir . "/*.md") ?: [] as $path) { $base = basename($path, ".md"); if (preg_match('/^[A-Z0-9_]+$/', $base) !== 1) { continue; } $docMap[$base] = $path; } ksort($docMap); function docTitle(string $key): string { // Drop a leading sort prefix like "01_" for display only. $key = preg_replace('/^\d+_/', "", $key) ?? $key; return ucwords(strtolower(str_replace("_", " ", $key))); } function docEscape(string $value): string { return htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8"); } $docsTitle = basename(dirname($docsDir)) === "client-package" ? "Manage Client" : "Manage Server"; $requested = isset($_GET["doc"]) ? (string) $_GET["doc"] : ""; $activeDoc = null; $markdown = null; $pageTitle = "Dokumentation"; if ($requested !== "") { if (!isset($docMap[$requested])) { http_response_code(404); $pageTitle = "Nicht gefunden"; } else { $activeDoc = $requested; $markdown = file_get_contents($docMap[$requested]); if ($markdown === false) { http_response_code(500); $pageTitle = "Fehler"; $markdown = null; } else { $pageTitle = docTitle($activeDoc); } } } // Works both when docs/ is a subdirectory and when it is served as the web // root (php -S localhost:8080 -t docs), where dirname() yields "/". $baseHref = rtrim(str_replace("\\", "/", dirname($_SERVER["SCRIPT_NAME"] ?? "")), "/") . "/"; if ($baseHref === "") { $baseHref = "/"; } ?> <?php echo docEscape($pageTitle); ?> – <?php echo docEscape($docsTitle); ?>

Dokumentation

Alle Dokumente in empfohlener Lesereihenfolge.

Das angeforderte Dokument ist nicht verfügbar.

Zur Übersicht