davidbadura/markdown-builder
A fluent PHP library for building Markdown documents programmatically. Compose headings, paragraphs, lists, links, code blocks, and tables via a clean, chainable API, ideal for READMEs, reports, and dynamic docs in any PHP or Laravel project.
league/commonmark), anything requiring sanitization guarantees, or long-lived public APIs.Adopt only if all of the following hold:
Look elsewhere (or build in-house) when:
league/commonmark for parsing/rendering and keep generation separate.resources/views/exports/report.blade.md is often simpler, testable, and zero-dependency.To executives: This is a small, free (MIT) utility that lets us add "export as Markdown" to internal reports and generated documentation with minimal engineering time. It is not a strategic platform bet: the library is small, thinly maintained (last release 2021), and we should cap our exposure by pinning it or, preferably, vendoring the handful of functions we actually use. Expected cost is low single-digit engineering days including review; the upside is faster delivery of a frequently requested export format.
To engineering: Treat it as a convenience API over string building, not infrastructure. Audit the source before merge (it is small enough to read in one sitting), pin the version, wrap it behind our own MarkdownExporter interface so it can be swapped for Blade templates or an in-house builder without touching call sites, and add golden-file tests on the output. Do not use it for rendering or sanitization — pair any customer-facing path with league/commonmark. If the wrapper takes more than a day, drop the dependency and write the builder ourselves; the API surface we need is narrow.
How can I help you explore Laravel packages today?