{"id":15171822,"url":"https://github.com/saggre/phpdocumentor-markdown","last_synced_at":"2025-10-26T00:30:50.811Z","repository":{"id":38793239,"uuid":"481652854","full_name":"Saggre/phpDocumentor-markdown","owner":"Saggre","description":"Generate Markdown documentation from PHP code","archived":false,"fork":false,"pushed_at":"2024-04-01T13:35:11.000Z","size":12264,"stargazers_count":17,"open_issues_count":6,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T12:51:20.243Z","etag":null,"topics":["documentation","github","gitlab","markdown","phpdoc","phpdocumentor"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Saggre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-04-14T15:19:52.000Z","updated_at":"2025-01-04T02:24:38.000Z","dependencies_parsed_at":"2024-04-01T14:44:08.394Z","dependency_job_id":"74eccc9b-d0ce-4357-b440-a888ef0c853b","html_url":"https://github.com/Saggre/phpDocumentor-markdown","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"2485dd6df2228e7652f26ef52559bcc16f70204c"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saggre%2FphpDocumentor-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saggre%2FphpDocumentor-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saggre%2FphpDocumentor-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Saggre%2FphpDocumentor-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Saggre","download_url":"https://codeload.github.com/Saggre/phpDocumentor-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238229940,"owners_count":19437723,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["documentation","github","gitlab","markdown","phpdoc","phpdocumentor"],"created_at":"2024-09-27T09:04:09.776Z","updated_at":"2025-10-26T00:30:50.806Z","avatar_url":"https://github.com/Saggre.png","language":"PHP","readme":"# phpDocumentor-markdown - Automatically generate Markdown documentation\n\nUse cases: In-repository documentation, GitHub/GitLab wikis, AI prompt context.\n\n## Markdown template for phpDocumentor3\n\n![Tests Status](https://github.com/Saggre/phpDocumentor-markdown/workflows/Run%20tests/badge.svg?style=flat-square)\n![Generate Docs Status](https://github.com/Saggre/phpDocumentor-markdown/workflows/Generate%20docs/badge.svg?style=flat-square)\n\nWish there was an easy way to generate PHP source code documentation? \\\nUsing [`phpDocumentor`](https://www.phpdoc.org/) with `phpDocumentor-markdown` template, you can automatically generate GitHub/GitLab-ready Markdown documentation from PHP source code. \n\nThis template can be used to document: \n\n|            | Name | Descriptions | Inheritance | Implements | Constants | Properties | Methods | Inherited methods | \n|------------|------|--------------|-------------|------------|-----------|------------|---------|-------------------|\n| Classes    | ✅    | ✅            | ✅           | ✅          | ✅         | ✅          | ✅       | ✅                 |\n| Interfaces | ✅    | ✅            | ✅           | ➖          | ✅         | ✅          | ✅       | ➖                 |\n| Traits     | ✅    | ✅            | ➖           | ➖          | ✅         | ✅          | ✅       | ➖                 |\n\n|            | Name | Descriptions | Types (parameter, return, etc.) | Access modifiers |\n|------------|------|--------------|---------------------------------|------------------|\n| Functions  | ✅    | ✅            | ✅                               | ✅                | \n| Methods    | ✅    | ✅            | ✅                               | ✅                | \n| Properties | ✅    | ✅            | ✅                               | ✅                |\n\n## Example\nExamples are available in the [.wiki](.wiki/Home.md) directory.\n\n## Installation \u0026 Usage\n- Please refer to [this guide](https://docs.phpdoc.org/guide/getting-started/installing.html) for instructions on installing phpDocumentor.\n- Usage instructions assume that `phpdoc` is the phpDocumentor binary.\n\n### Running manually\n```bash\n# Run phpDocumentor with --template argument pointed to this directory's markdown template\nphpdoc --directory=src --target=docs --template=\u003cPATH TO THIS REPOSITORY/themes/markdown\u003e\n```\n\n### Using Composer\n\n#### Installation via Composer\n```bash\n# Require this package. You probably want it as a dev dependency\ncomposer require --dev saggre/phpdocumentor-markdown\n```\n\n#### Running manually after installing via Composer\n```bash\n# Run phpDocumentor with --template argument pointed to markdown template inside vendor directory\nphpdoc --directory=src --target=docs --template=\"vendor/saggre/phpdocumentor-markdown/themes/markdown\"\n```\n\n### Installation \u0026 Usage tips\n\n#### Adding a Composer helper script\n\nAdd this script to your `composer.json` and run `composer create-docs` to generate the documentation.\n\n```json\n\"scripts\": {\n    \"create-docs\": \"phpdoc --directory=src --target=docs --template='vendor/saggre/phpdocumentor-markdown/themes/markdown'\"\n},\n```\n\n#### Using with PhpDocumentor XML config\n\nAdd a template element to your phpDocumentor XML config and run `phpDocumentor` to generate the documentation.\n\n```xml\n\u003cphpdocumentor\u003e\n    \u003c!-- Specify template element inside phpdocumentor --\u003e\n    \u003ctemplate name=\"./vendor/saggre/phpdocumentor-markdown/themes/markdown\"/\u003e\n\u003c/phpdocumentor\u003e\n```\n\nYou can also check out the [config file](./phpdoc.dist.xml) used for generating this repository's example documentation for a full example.\n\n#### GitLab wiki\n\nThe output of this template can be used directly as a GitLab wiki.\n\n#### GitHub wiki\n\n⚠️ GitHub wiki [uses a flat directory structure](https://github.com/orgs/community/discussions/14020) for linking, so the internal links in the resulting documentation will not work as expected.\n\n#### CI pipelines\n\nYou can use the [PhpDocumentor Docker image](https://hub.docker.com/r/phpdoc/phpdoc) with this template in your CI pipelines to generate documentation automatically.\n\n#### AI integration\n\nThe generated documentation can be used as prompt context for AI models that work with source code. For other use cases you'll likely want structured data, like JSON.\n\n## Running tests\n```bash\n# Clone the repository\ngit clone git@github.com:Saggre/phpDocumentor-markdown.git\n\n# Go to the cloned repository\ncd phpDocumentor-markdown\n\n# Install dependencies\ncomposer install\n\n# Set up PHPUnit configuration\ncp phpunit.xml.dist phpunit.xml\n\n# Run PHPUnit in project root directory\ncomposer test\n```\n\n## Contributing\n- There are unit tests and functional tests available in the `tests` directory.\n  - Unit tests are used to test individual Twig macros\n  - Functional tests are used to test the whole documentation generation process\n\n## Inspired by:\n\n* [dmarkic/phpdoc3-template-md](https://github.com/dmarkic/phpdoc3-template-md)\n* [cvuorinen/phpdoc-markdown-public](https://github.com/cvuorinen/phpdoc-markdown-public)\n* [evert/phpdoc-md](https://github.com/evert/phpdoc-md)\n* [heimrichhannot/phpdoc-github-template](https://github.com/heimrichhannot/phpdoc-github-template)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaggre%2Fphpdocumentor-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaggre%2Fphpdocumentor-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaggre%2Fphpdocumentor-markdown/lists"}