Download the PHP package b13/ai-bots-love-markdown without Composer

On this page you can find all versions of the php package b13/ai-bots-love-markdown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-bots-love-markdown

AI Bots Love Markdown - Serve TYPO3 pages as Markdown for AI crawlers

This TYPO3 extension provides an alternative Markdown representation of your pages for AI bots and crawlers.

This makes content accessible not just for humans and screen readers, but also for AI systems that consume and process web content.

Features

Installation

Use composer req b13/ai-bots-love-markdown or install it via TYPO3's Extension Manager.

After installation, add the site set to your site configuration:

Configuration

Site Settings

The extension provides the following settings that can be configured per site:

Setting Default Description
ai_bots_love_markdown.enableContentNegotiation true Enable content negotiation via Accept: text/markdown header
ai_bots_love_markdown.enableDiscoveryTag true Add <link rel="alternate"> tag to HTML pages for Markdown discovery
ai_bots_love_markdown.pageTypeSuffix ai-bots-love.md PageType Suffix for Markdown link
ai_bots_love_markdown.pageTypeTypeNum 2026 PageType TypeNum for Markdown link
ai_bots_love_markdown.removeElements script style nav footer aside form iframe noscript Space-separated HTML tags stripped from the markdown output. <header> is intentionally not included — article-level <header> regions often hold the H1
ai_bots_love_markdown.excludedDoktypes 3,4,6,7,199,254,255 Comma-separated page doktypes that never produce a Markdown alternate response. Default covers TYPO3 system doktypes (external link, shortcut, mountpoint, sysfolder, recycler, etc.)
ai_bots_love_markdown.cacheable true Allow CDN / reverse-proxy caching of Markdown responses. Disable to force every hit through to the origin — required when you want to count AI-bot deliveries accurately (e.g. via b13/ai-bot-tracker). When false, Cache-Control: private, no-store is set on Markdown responses

To override these settings, add them to your site's settings.yaml:

Per-page opt-out

Editors can disable the Markdown alternate for individual pages via the page property Disable Markdown version (TCA field pages.markdown_version, default on, rendered inverted in the BE so the toggle reads as "disable"). When the toggle is turned on, the <link rel="alternate"> discovery tag is stripped from the HTML response and any direct request to .md / Accept: text/markdown returns the regular HTML.

Caching and content negotiation

Markdown responses share the URL of the HTML page when Accept: text/markdown is used. To prevent reverse proxies from serving a cached HTML response to a Markdown requester (or vice versa), the middleware adds a Vary: Accept header to every response that goes through a site with content negotiation enabled — regardless of whether the current request asked for Markdown.

By default (cacheable: true), TYPO3's page-level Cache-Control is preserved on the Markdown response, so the CDN may cache. If you need every Markdown delivery to reach the origin — typically to track bot consumption — set cacheable: false and the response is sent with Cache-Control: private, no-store.

Usage

Access Methods

  1. Accept header: Request any page with Accept: text/markdown header

    curl -H "Accept: text/markdown" https://example.com/my-page/

  2. URL suffix: Append /ai-bots-love.md to any page URL

    https://example.com/ai-bots-love.md

Output Format

The extension outputs Markdown with YAML front matter, extracting metadata from HTML meta tags with fallback to TYPO3 page record data:

Metadata Priority:

Auto-Discovery

The extension automatically adds a <link> tag to all HTML pages for Markdown discovery:

Opt-in Behavior

Pages are only converted to Markdown if they contain the <link rel="alternate" type="text/markdown"> tag. This means:

Technical Details

How It Works

  1. A PSR-15 middleware intercepts requests with Accept: text/markdown header or /ai-bots-love.md suffix
  2. The normal page rendering proceeds (your existing templates, TypoScript, etc.)
  3. The middleware checks if the response contains the markdown alternate link tag
  4. If present, it extracts <main> content (or <body> as fallback)
  5. The HTML is converted to Markdown using league/html-to-markdown
  6. Navigation, header, footer, and other non-content elements are stripped
  7. Page metadata is added as YAML front matter

Response Headers

The Markdown response includes:

Best Practices for Templates

For best results, wrap your main content in a <main> element:

Excluding Content from Markdown

Beyond the <main> selection and the configurable removeElements list, you can mark template regions explicitly via two bundled Fluid partials. They are auto-registered through the site set, so no partialRootPaths setup is required.

Wrap a region you want excluded from the markdown output (teasers, related-article boxes, breadcrumbs, CTAs):

Or explicitly mark the main content region (overrides <main> detection, useful when <main> is missing or contains too much):

Both partials emit HTML comments (<!-- markdown-start -->, <!-- markdown-exclude-start -->, …) that survive caching and are stripped from regular page responses by a frontend middleware before they reach human visitors. Excludes can be nested.

Events

The extension dispatches three PSR-14 events. Listen via the #[AsEventListener] attribute or by registering a listener in your extension's Configuration/Services.yaml. All events live under the B13\AiBotsLoveMarkdown\Event\ namespace.

Event Fired Use case
BuildHtmlMarkdownConverterEvent Before HTML → Markdown conversion runs Add custom node converters, override HtmlConverter options
AfterFrontMatterForPageIsCreatedEvent After the YAML front-matter array is assembled from meta tags and the page record, before serialisation Add, remove, or replace front-matter entries (e.g. enrich with domain-specific keys)
AfterMarkdownConversionEvent After Markdown content has been built, before the response is returned Side effects on every Markdown delivery (e.g. b13/ai-bot-tracker writes a tracking row from this event)

See Extending the YAML front matter below for a full AfterFrontMatterForPageIsCreatedEvent listener example.

Extending the YAML front matter

The default front matter is built from HTML meta tags and the page record. To add domain-specific keys (e.g. seminar data, product attributes, event dates), listen to the AfterFrontMatterForPageIsCreatedEvent. Listeners receive the assembled data array before it is rendered to YAML and may add, remove, or replace entries.

The event also exposes $html, $pageInformation, and $request (each read-only) so listeners can resolve site, language, or routing information when needed. Array order is preserved in the rendered YAML, so you can prepend custom keys by recreating the array if order matters.

If you need to bypass the YAML rendering entirely, the underlying methods MetadataService::buildFrontMatterData() and MetadataService::renderYaml() are public and can be used directly.

License

The extension is licensed under GPL v2+, same as the TYPO3 Core.

Background & Authors

This extension was created by b13 GmbH in 2026 to enable AI systems to better consume website content. As AI crawlers become increasingly important for content discovery and processing, providing a clean Markdown representation helps ensure your content is accurately understood and indexed by AI systems.

Huge credits to Dries Buytaert's inspiration on this topic:

Find more TYPO3 extensions we have developed that help us deliver value in client projects. As part of the way we work, we focus on testing and best practices to ensure long-term performance, reliability, and results in all our code.


All versions of ai-bots-love-markdown with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
typo3/cms-core Version ^13.4 || ^14.0
league/html-to-markdown Version ^5.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package b13/ai-bots-love-markdown contains the following files

Loading the files please wait ...