llms.php 695 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * The handbook as one plain-text Markdown document.
  5. *
  6. * This is the address to hand to an agent: no markup, no navigation, no
  7. * JavaScript - documentation, source code and the OpenAPI document in one
  8. * response. Reachable as llms.txt through the rewrite in .htaccess.
  9. */
  10. require_once __DIR__ . "/inc/handbook.php";
  11. $markdown = handbookBuildMarkdown(false);
  12. header("Content-Type: text/plain; charset=utf-8");
  13. header("Content-Length: " . (string) strlen($markdown));
  14. header("X-Content-Type-Options: nosniff");
  15. // Cheap to rebuild, but a fetching agent should not re-download it per file.
  16. header("Cache-Control: public, max-age=300");
  17. echo $markdown;