Developer
Request flow
The extension adds three PSR-15 middlewares to the frontend stack. No route
enhancer is involved: the middlewares answer the text files themselves and
remove .md before TYPO3 routes the request.
request
├─ woit/si-llms-txt/markdown-suffix before typo3/cms-frontend/site
├─ typo3/cms-frontend/site
├─ woit/si-llms-txt/llms-txt before typo3/cms-frontend/base-redirect-resolver
├─ … page-resolver, prepare-tsfe-rendering, shortcut redirect
├─ woit/si-llms-txt/markdown-render after prepare-tsfe-rendering
└─ rendering
| Middleware | Task |
|---|---|
Markdown | /de/ → routes /de/ and sets the request attribute
sillmstxt.. Responses without Markdown become a plain
404; redirects keep the .md suffix. |
Llms | Answers llms. / llms- for the site root
and every language base. |
Markdown | Uses the page field "LLM Markdown" or lets the page render and converts the HTML. For the EXT:news detail page it takes the news record (see EXT:news (tx_news)). |
For normal HTML requests each middleware only compares a string and passes the request on.
The event listener Add
(After) adds the <link rel="alternate">
and <link rel="describedby"> tags when a page is rendered; the result is
part of the page cache. The HTTP Link header with the same relations is
added by Markdown on every request (see
Discovery links).
Classes
| Class | Purpose |
|---|---|
Service\ | Builds llms., llms- and the frontmatter
of page and news documents; caching |
Service\ | Walks the page tree, language overlay (strict) |
Service\ | News records of EXT:news (optional) |
Service\ | HTML → Markdown with league/html-to-markdown; removes navigation,
breadcrumbs, asides, forms, buttons, scripts, decorative images
and links without text; accordion titles and <summary>
become h3 headings; keeps button titles in headings; resolves
lazy-loaded images; moves card links onto their heading; makes
links absolute |
Service\ | alternate and describedby links of a page, as HTML tags or
HTTP Link header |
Service\ | Page URL ↔ .md URL |
Service\ | Site set active? Settings, included page types |
Caching
- Cache
sillmstxt(database backend, grouppages) - Entries for
llms.andtxt llms-per site languagefull. txt - Tags:
pageof every listed page and the root page; with EXT:news alsoId_<uid> tx_,news tx_,news_ pid_<pid> tx_news_ uid_<uid> - The intro of the language is part of the cache identifier
llms-with pages that could not be fetched is kept for 5 minutes onlyfull. txt .mddocuments are not cached separately: the HTML comes from the page cache, only the conversion runs per request
Database
CREATE TABLE pages (
tx_sillmstxt_exclude smallint(5) unsigned DEFAULT '0' NOT NULL,
tx_sillmstxt_priority int(11) DEFAULT '0' NOT NULL,
tx_sillmstxt_description text,
tx_sillmstxt_markdown mediumtext
);
tx_ and tx_ use
l10n_ (same value in all languages).