Skip to content

Commit 1a43133

Browse files
Integrate markdown guides into phpDocumentor output
Configure phpDocumentor to generate both API documentation and user guides in a single unified site. This replaces the previous Jekyll-based approach where API docs were copied into the docs folder. - Add `<guide>` configuration to `phpdoc.dist.xml` - Create custom template with "Guides" navigation link - Replace `docs/index.html` redirect with `docs/index.md` guide index - Update workflow to publish `build/docs` directly without Jekyll - Track `.phpdoc/template/` while still ignoring `.phpdoc/cache/` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8f0c7ac commit 1a43133

File tree

7 files changed

+26
-21
lines changed

7 files changed

+26
-21
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,12 @@ jobs:
2424
- name: Install Composer
2525
uses: "ramsey/composer-install@v3"
2626

27-
- name: Generate API Documentation
27+
- name: Generate Documentation
2828
run: make docs
2929

30-
- name: Copy API docs into docs directory
31-
run: cp -r build/docs docs/api
32-
3330
- name: Deploy to gh-pages branch
3431
uses: peaceiris/actions-gh-pages@v4
3532
with:
3633
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: ./docs
38-
enable_jekyll: true
34+
publish_dir: ./build/docs
35+
enable_jekyll: false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ results
1010

1111
# phpDocumentor
1212
build/
13-
.phpdoc/
13+
.phpdoc/cache/
1414
phpDocumentor.phar

.phpdoc/template/base.html.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% extends 'layout.html.twig' %}
2+
3+
{% set topMenu = {
4+
"menu": [
5+
{ "name": "Guides", "url": "guide/docs/index.html"}
6+
]
7+
}
8+
%}

docs/_config.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# MCP PHP SDK Guides
2+
3+
- [MCP Elements](mcp-elements.html) — Core capabilities (Tools, Resources, Resource Templates, and Prompts) with registration methods.
4+
- [Server Builder](server-builder.html) — Fluent builder class for creating and configuring MCP server instances.
5+
- [Transports](transports.html) — STDIO and HTTP transport implementations with guidance on choosing between them.
6+
- [Client Communication](client-communication.html) — Methods for servers to communicate back to clients: sampling, logging, progress, and notifications.
7+
- [Examples](examples.html) — Example projects demonstrating attribute-based discovery, dependency injection, HTTP transport, and more.

phpdoc.dist.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
<path>tests/**/*</path>
2121
</ignore>
2222
</api>
23+
<guide format="md">
24+
<source dsn=".">
25+
<path>docs</path>
26+
</source>
27+
<output>guide</output>
28+
</guide>
2329
</version>
30+
<setting name="guides.enabled" value="true"/>
2431
<setting name="graphs.enabled" value="true"/>
2532
</phpdocumentor>

0 commit comments

Comments
 (0)