Developer
Architecture Overview
The LLMS TXT Generator extension follows modern TYPO3 v13 development practices.
Core Components
Services
- ConfigurationService
- Handles all TypoScript configuration reading and provides typed access to configuration values.
- LlmsTxtGeneratorService
- Main application service that orchestrates the generation of llms.txt content by coordinating other services.
- MarkdownConverterService
- Converts HTML content to Markdown format using the league/html-to-markdown library.
- NavigationBuilder
- Builds the site navigation structure for inclusion in llms.txt files.
Repository
- PageRepository
- Provides database access for page records with proper respect for TYPO3's language and workspace handling.
Controller
- LlmsTxtController
- Thin controller layer that handles HTTP requests and delegates business logic to services. Provides entry points for TypoScript USER objects.
API Reference
Controller Methods
WebVision\LlmsTxt\Controller\LlmsTxtController
- generateAction ( string $content = '', array $conf = []) : string
-
Generates llms.txt content for TypoScript USER object.
- param string $content
-
Content passed from TypoScript (usually empty)
- param array $conf
-
Configuration array from TypoScript
- throws
-
Exception on generation failures
- Returns
-
Generated llms.txt content as string
- renderPageAsMarkdown ( string $content = '', array $conf = []) : string
-
Renders current page as Markdown by leveraging TYPO3's frontend rendering.
- param string $content
-
Content passed from TypoScript (usually empty)
- param array $conf
-
Configuration array from TypoScript
- throws
-
Exception on rendering or conversion failures
- Returns
-
Page content converted to Markdown format
Service Classes
WebVision\LlmsTxt\Service\LlmsTxtGeneratorService
WebVision\LlmsTxt\Service\ConfigurationService
- isEnabled ( ) : bool
-
Checks if llms.txt generation is enabled.
- Returns
-
True if enabled, false otherwise
- getTitleOverride ( ) : string
-
Gets custom title override if configured.
- Returns
-
Custom title or empty string
- getDescriptionOverride ( ) : string
-
Gets custom description override if configured.
- Returns
-
Custom description or empty string
Extending the Extension
tbd.
Hooks and Events
The extension doesn't currently provide PSR-14 events, but you can extend functionality through:
- Service replacement - Override services through dependency injection
- TypoScript configuration - Extend configuration options
- Custom page types - Create additional page types using the same controller methods
Testing
Unit Testing
tbd.
Functional Testing
tbd.
Performance Considerations
- Navigation Building
-
Navigation structure generation scales with site size. For large sites (1000+ pages), consider:
- Reducing maxDepth setting
- Implementing custom navigation filtering
- Adding caching layers
- Content Rendering
-
Markdown conversion processes all content elements. For content-heavy pages:
- Consider selective content rendering
- Implement content type filtering
- Use caching for expensive conversions
- Memory Usage
-
The HTML-to-Markdown conversion can be memory-intensive for large pages. Monitor memory usage and consider:
- Chunked processing for very large pages
- Custom memory-efficient conversion strategies
Contributing
When contributing to the extension:
- Follow TYPO3 coding standards - Use php-cs-fixer with TYPO3 ruleset
- Write tests - Include unit and functional tests for new features
- Document changes - Update documentation for new configuration options
- Use dependency injection - Prefer constructor injection over service location
- Type everything - Use strict types and comprehensive type hints