Skip to content

Add Markdown output format for PHP documentation#254

Open
philip wants to merge 3 commits into
masterfrom
add-markdown-format
Open

Add Markdown output format for PHP documentation#254
philip wants to merge 3 commits into
masterfrom
add-markdown-format

Conversation

@philip

@philip philip commented Jun 17, 2026

Copy link
Copy Markdown
Member

Adds a new markdown output format to the PHP package, producing clean Markdown from PHP DocBook sources.

Output:

  • One .md file per chunk, named using the same convention as XHTML and Web (function.array-map.md, class.exception.md, etc.)
  • PHP 8-style function/method signatures in fenced php code blocks
  • Class declarations with modifiers, extends, and implements
  • GFM tables for changelogs and parameter tables
  • Blockquote admonitions (> NOTE:, > WARNING:, etc.)
  • Relative .md links throughout, matching XHTML link structure
  • Enum cases in fenced code blocks

New files:

  • Package/PHP/Markdown.php: the format renderer
  • PI/MarkdownPHPDOCHandler.php: changelog PI handler (GFM table output)

Usage:
phd -f markdown -P PHP -d doc-base/.manual.xml -o out/

@Crell

Crell commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What is the use case for this? Normally markdown is a source format for producing HTML, and there is already an HTML output format.

@philip

philip commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

What is the use case for this? Normally markdown is a source format for producing HTML, and there is already an HTML output format.

For agents, mostly. I understand this would means a discussion, but one general idea is to allow agents (or humans) to view Markdown. In two forms:

  • Simple extension change, example: https://www.php.net/manual/en/language.variables.basics.md
  • Or standard URL but with Accept: text/markdown header.

@hakre

hakre commented Jun 18, 2026

Copy link
Copy Markdown

What is the use case for this? Normally markdown is a source format for producing HTML, and there is already an HTML output format.

HTML is not actionable, MD is. @Crell

@Crell

Crell commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What does actionable mean? Do you mean LLM friendly? Those can go to hell, I have no interest in giving free labor to criminals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants