oliverthiele/ot-markdown
Composer 安装命令:
composer require oliverthiele/ot-markdown
包简介
CE Markdown - Content Element and ViewHelper for Markdown with optional syntax highlighting.
关键字:
README 文档
README
Adds a Markdown content element and a Fluid ViewHelper to TYPO3 v13 and v14. Supports inline Markdown and .md files
from Fileadmin, rendered via league/commonmark with optional Prism.js syntax
highlighting.
Features
- TYPO3 v13+ compatible (Site Set ready)
- Inline or file-based Markdown rendering (
.md,.markdown,.txt) - Optional syntax highlighting via Prism.js (CDN toggle)
- Frontmatter metadata support (
title,author, …) - Accessible output using semantic
<section>and<figure>elements - Reusable
MarkdownViewHelperfor custom Fluid templates - Configurable via Site Set settings and TypoScript
Requirements
| Requirement | Version |
|---|---|
| TYPO3 | ^13.4 | ^14.3 |
| PHP | >=8.3 |
| league/commonmark | ^2.7 |
Installation
composer require oliverthiele/ot-markdown
After installation, activate the Site Set "OtMarkdown" for your site in the TYPO3 backend.
Configuration
Site Set Settings
| Key | Type | Default | Description |
|---|---|---|---|
OtMarkdown.useCdnForPrism |
bool | true |
Load Prism.js from CDN |
TypoScript
The TypoScript is auto-included via the Site Set. For manual integration without Site Set:
@import 'EXT:ot_markdown/Configuration/TypoScript/constants.typoscript'
@import 'EXT:ot_markdown/Configuration/TypoScript/setup.typoscript'
Default content element configuration:
tt_content.ot_markdown =< lib.contentElement
tt_content.ot_markdown {
templateName = Markdown
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10.references.fieldName = assets
10.as = markdownFiles
}
}
Usage
Content Element
Select "Markdown" as content type (CType = ot_markdown) in the TYPO3 backend. Choose between:
- Inline — enter Markdown directly in the text field
- File — select a
.md,.markdown, or.txtfile from Fileadmin
ViewHelper
{namespace ot=OliverThiele\OtMarkdown\ViewHelpers}
<ot:markdown text="{data.bodytext}"/>
<ot:markdown file="{file}" as="output">
<f:format.raw>{output.html}</f:format.raw>
</ot:markdown>
Access frontmatter metadata via {output.frontmatter.title}, {output.frontmatter.author}, etc.
PHP API
use OliverThiele\OtMarkdown\Service\MarkdownService; use TYPO3\CMS\Core\Utility\GeneralUtility; $service = GeneralUtility::makeInstance(MarkdownService::class); $html = $service->render('# Hello World');
License
GPL-2.0-or-later — © 2025 Oliver Thiele
统计信息
- 总下载量: 445
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-10-16