Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Markdown Response Laravel Package

spatie/laravel-markdown-response

Serve markdown versions of your Laravel HTML pages for AI agents and bots. Detect markdown requests via Accept: text/markdown, known user agents, or .md URLs. Driver-based conversion (local PHP or Cloudflare Workers AI), with caching and HTML preprocessing.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • AI/ML Integration Roadmap: Enables seamless content delivery to AI agents (e.g., chatbots, search engines, or internal LLM pipelines) by converting HTML responses to structured Markdown, improving parsing accuracy and reducing token overhead.
  • Developer Experience (DX) for Content Teams: Reduces friction for non-technical teams by allowing them to work in Markdown (familiar format) while backend systems serve optimized content to users.
  • Build vs. Buy: Avoids reinventing HTML-to-Markdown conversion logic, leveraging a battle-tested, open-source solution with minimal maintenance overhead.
  • Use Cases:
    • APIs for AI Agents: Serve Markdown alongside JSON/HTML for better LLM ingestion (e.g., documentation, dynamic content).
    • Headless CMS: Decouple content storage (Markdown) from presentation (HTML) for flexibility.
    • SEO/Scraping Optimization: Provide clean Markdown versions of pages to crawlers or aggregators.
    • Internal Tools: Generate Markdown reports or documentation dynamically from web apps.

When to Consider This Package

  • Adopt if:
    • Your product interacts with AI agents (e.g., chatbots, LLMs) that parse HTML poorly or inefficiently.
    • You need to serve structured content to multiple clients (e.g., web + AI) with minimal duplication.
    • Your team uses Markdown for content creation but needs to render it dynamically in web apps.
    • You’re building a headless CMS or API-first platform where content format agility is critical.
  • Look elsewhere if:
    • Your use case doesn’t involve AI agents or Markdown consumption (e.g., pure web apps with no AI integration).
    • You require advanced Markdown templating or complex transformations beyond HTML-to-Markdown conversion.
    • Your stack isn’t Laravel/PHP, or you prefer a language-specific solution (e.g., Python’s html2text).
    • You need real-time collaboration features (e.g., GitHub-style editing), which this package doesn’t address.

How to Pitch It (Stakeholders)

For Executives: "This package lets us serve our web content in two formats simultaneously—HTML for users and Markdown for AI agents—without extra engineering work. It’s a low-risk way to improve how our product interacts with AI tools (e.g., chatbots, search, or internal analytics), reducing costs and improving data quality. Think of it as a ‘universal translator’ for content, enabling us to leverage AI more effectively while keeping our existing web infrastructure intact."

For Engineering: *"Spatie’s laravel-markdown-response is a lightweight, well-documented Laravel package that adds a single HTTP header (Accept: text/markdown) to serve Markdown versions of your HTML responses. It’s ideal for:

  • AI APIs: Let LLMs ingest structured content instead of parsing messy HTML.
  • Content APIs: Decouple storage (Markdown) from delivery (HTML) for flexibility.
  • Legacy Integration: Quickly add Markdown endpoints to existing Laravel apps. The package is MIT-licensed, actively maintained, and integrates cleanly with Laravel’s middleware. Setup is trivial (10 minutes), and it plays well with Spatie’s other tools if we use their ecosystem."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport