# MarkyDown

Converts HTML into clean Markdown, through a web interface or directly in PHP, and can add content negotiation to an existing page so the same URL serves HTML or Markdown.

MarkyDown converts HTML into clean Markdown, either through its included web interface or directly from PHP code. It can add HTTP content negotiation to an existing PHP page so the same URL serves HTML to browsers and Markdown to clients that request it, and fetches public HTML pages with bounded response sizes and protection against requests into internal networks.

Content to convert is selected with CSS selectors or XPath, including all matches in document order without repeating nested matches, and navigation, ads or other unwanted elements can be excluded; when no selector is supplied, it falls back to automatic article extraction. Headings, links, lists, code blocks and tables are preserved in the output. It does not itself refetch a page's authentication flow, so a canonical base URL should come from trusted application configuration rather than an unchecked Host header.

It requires PHP 8.3 or later with Composer 2, and can be used as a library without exposing its web interface.

Website: https://devkram.de/markydown
