Reverse engineered prompt

Build me a small Ruby library that works like the first step of GitHub’s README rendering. I want to pass in a file name, like README.md or docs.rst, plus the raw file contents, and get back HTML using the right markup engine automatically based on the extension. It should support the common README and docs formats mentioned in the project, including Markdown, Textile, RDoc, Org, Creole, MediaWiki, reStructuredText, AsciiDoc, and Pod, as long as the needed parser is installed.

Keep the scope focused on choosing the right renderer and converting content to HTML. Don’t try to do sanitizing, syntax highlighting, emoji, task lists, or any of the other GitHub page processing, since that happens later in their pipeline. Include a simple API for rendering from a filename and string content, plus a convenience method if that makes sense. Please add basic tests and a short README with usage examples and setup notes for optional format dependencies. If anything is unclear, look up the current docs online.

Want more depth? Deep Reverse