| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
- declare(strict_types=1);
- /**
- * Public client handbook: every document and every source file of
- * client-package/ on one page.
- *
- * Rendering happens in the browser with the vendored marked.js, exactly like
- * the two internal viewers. The Markdown source sits in the page as plain text
- * rather than in a script tag, so the page also works without JavaScript and so
- * that a tool extracting text from the HTML receives the whole handbook.
- *
- * A client that does not ask for HTML (curl, most agent fetchers) gets the
- * plain-text rendering instead; see llms.php.
- */
- require_once __DIR__ . "/inc/handbook.php";
- $accept = (string) ($_SERVER["HTTP_ACCEPT"] ?? "");
- $wantsText = isset($_GET["format"]) && $_GET["format"] === "md";
- // No Accept header at all, or one that never mentions HTML: not a browser.
- if (!$wantsText && !str_contains(strtolower($accept), "text/html")) {
- $wantsText = true;
- }
- if ($wantsText) {
- require __DIR__ . "/llms.php";
- return;
- }
- $inventory = handbookInventory();
- $markdown = handbookBuildMarkdown(true);
- $self = handbookSelfUrl();
- ?>
- <!DOCTYPE html>
- <html lang="de">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Manage Client – Handbuch</title>
- <meta name="description" content="Update- und Backup-Client für PHP-Projekte: vollständige Dokumentation, Quellcode und HTTP-Schnittstelle auf einer Seite.">
- <link rel="stylesheet" href="assets/docs.css">
- <link rel="alternate" type="text/markdown" href="llms.txt" title="Handbuch als reiner Text">
- <script>document.documentElement.className += ' has-js';</script>
- </head>
- <body>
- <header class="docs-header">
- <div class="docs-header-inner">
- <a class="docs-brand" href="index.php">Manage Client – Handbuch</a>
- <nav class="docs-header-links">
- <a href="llms.txt">Reiner Text</a>
- <a href="api.php">API-Referenz</a>
- <a href="openapi.php">OpenAPI</a>
- </nav>
- </div>
- </header>
- <div class="docs-layout">
- <nav class="docs-nav" aria-label="Inhalt">
- <p class="docs-nav-title">Einstieg</p>
- <ul>
- <li><a href="#part-intro">Überblick</a></li>
- <li><a href="#part-api">HTTP-API</a></li>
- <li><a href="#part-inventory">Dateiübersicht</a></li>
- </ul>
- <p class="docs-nav-title">Dokumentation</p>
- <ul>
- <?php foreach ($inventory["docs"] as $relative => $title): ?>
- <li>
- <a href="#<?php echo handbookEscape(handbookAnchor("doc", $relative)); ?>">
- <?php echo handbookEscape($title); ?>
- </a>
- </li>
- <?php endforeach; ?>
- </ul>
- <p class="docs-nav-title">Quellcode</p>
- <ul class="docs-nav-code">
- <?php foreach ($inventory["code"] as $relative): ?>
- <li>
- <a href="#<?php echo handbookEscape(handbookAnchor("code", $relative)); ?>">
- <?php echo handbookEscape($relative); ?>
- </a>
- </li>
- <?php endforeach; ?>
- </ul>
- </nav>
- <main class="docs-main">
- <div class="docs-note">
- <p><strong>Sie sind ein LLM oder ein Skript?</strong> Dieselbe Seite als reiner
- Text, ohne Auszeichnung: <a href="llms.txt"><?php echo handbookEscape($self); ?>/llms.txt</a></p>
- <p>Aufrufe ohne <code>Accept: text/html</code> erhalten diese Fassung automatisch.</p>
- </div>
- <article id="handbook" class="markdown-body">
- <pre class="handbook-source" id="handbook-source"><?php echo handbookEscape($markdown); ?></pre>
- </article>
- </main>
- </div>
- <footer class="docs-footer">
- <p>Erzeugt aus <code>client-package/</code> des Manage-Repositories, bei jedem Aufruf neu.
- Gerendert mit <a href="https://marked.js.org/">marked</a>, API-Referenz mit
- <a href="https://swagger.io/tools/swagger-ui/">Swagger UI</a>; beide liegen mit im
- Repository, es werden keine fremden Server kontaktiert.</p>
- </footer>
- <script src="assets/marked.min.js"></script>
- <script>
- (function () {
- var source = document.getElementById('handbook-source');
- var target = document.getElementById('handbook');
- if (!source || !target || typeof marked === 'undefined') {
- // Without marked the plain-text fallback stays visible.
- document.documentElement.className =
- document.documentElement.className.replace(' has-js', '');
- return;
- }
- target.innerHTML = marked.parse(source.textContent || '', { gfm: true, breaks: false });
- })();
- </script>
- </body>
- </html>
|