{"id":46695438,"url":"https://github.com/bph/wp-markdown-endpoint","last_synced_at":"2026-03-09T05:04:03.863Z","repository":{"id":340181482,"uuid":"1135974622","full_name":"bph/wp-markdown-endpoint","owner":"bph","description":"Exposes posts and pages as Markdown via .md URL suffix, Accept header negotiation, and auto-discovery links.","archived":false,"fork":false,"pushed_at":"2026-02-23T16:48:16.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-24T00:31:40.576Z","etag":null,"topics":["markdown","plugins","wordpress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bph.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-16T21:31:01.000Z","updated_at":"2026-02-23T16:49:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bph/wp-markdown-endpoint","commit_stats":null,"previous_names":["bph/wp-markdown-endpoint"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bph/wp-markdown-endpoint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bph%2Fwp-markdown-endpoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bph%2Fwp-markdown-endpoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bph%2Fwp-markdown-endpoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bph%2Fwp-markdown-endpoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bph","download_url":"https://codeload.github.com/bph/wp-markdown-endpoint/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bph%2Fwp-markdown-endpoint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30283703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","plugins","wordpress"],"created_at":"2026-03-09T05:04:02.646Z","updated_at":"2026-03-09T05:04:03.846Z","avatar_url":"https://github.com/bph.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WP Markdown Endpoint\n\nA WordPress plugin that exposes posts and pages as Markdown via `.md` URL suffix, `Accept` header negotiation, and auto-discovery links.\n\n## Features\n\n- **`.md` URL suffix** — append `.md` to any post or page URL to receive its content as Markdown (e.g. `https://example.com/my-post.md`)\n- **`Accept` header negotiation** — send `Accept: text/markdown` to get a Markdown response without changing the URL\n- **`?format=md` query parameter** — an alternative way to request Markdown output\n- **YAML frontmatter** — every Markdown response includes structured metadata (title, date, author, URL, tags, categories, excerpt)\n- **Canonical `Link` header** — Markdown responses include a `Link: \u003c…\u003e; rel=\"canonical\"` HTTP header pointing back to the original HTML page\n- **Auto-discovery link** — a `\u003clink rel=\"alternate\" type=\"text/markdown\"\u003e` tag is injected into the HTML `\u003chead\u003e` of every singular post/page so clients can discover the Markdown URL automatically\n- **HTML-to-Markdown conversion** — converts Gutenberg block output (headings, paragraphs, lists, blockquotes, code blocks, images, links, bold, italic, strikethrough) to clean Markdown\n\n## Requirements\n\n- WordPress 6.0 or later (uses `str_ends_with()`)\n- PHP 8.0 or later\n\n## Installation\n\n1. Upload the `wp-markdown-endpoint` folder to `/wp-content/plugins/`.\n2. Activate the plugin through the **Plugins** menu in WordPress.\n3. No configuration required.\n\n## Usage\n\nGiven a post at `https://example.com/hello-world/`, you can retrieve its Markdown content in three ways:\n\n```\n# URL suffix\nGET https://example.com/hello-world.md\n\n# Query parameter\nGET https://example.com/hello-world/?format=md\n\n# Accept header\nGET https://example.com/hello-world/\nAccept: text/markdown\n```\n\n### Example response\n\n```markdown\n---\ntitle: Hello World\ndate: 2026-02-23\nauthor: Jane Doe\nurl: https://example.com/hello-world/\ntags: [\"news\", \"updates\"]\ncategories: [\"General\"]\n---\n\n## Introduction\n\nWelcome to my site! This content is served as **Markdown**.\n```\n\n## File Structure\n\n```\nwp-markdown-endpoint/\n├── wp-markdown-endpoint.php   # Plugin bootstrap, defines constants, loads classes\n├── includes/\n│   ├── class-rewrite.php      # Intercepts .md URL suffix, sets format query var\n│   ├── class-output.php       # Serves Markdown responses and injects discovery link\n│   └── class-converter.php    # Converts HTML (Gutenberg output) to Markdown\n├── readme.md                  # This file\n└── readme.txt                 # WordPress.org-compatible readme\n```\n\n## License\n\nGPL-2.0+. See [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html).\n\n## Author\n\nBirgit Pauli-Haack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbph%2Fwp-markdown-endpoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbph%2Fwp-markdown-endpoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbph%2Fwp-markdown-endpoint/lists"}