{"id":13828347,"url":"https://github.com/php/phd","last_synced_at":"2025-04-04T23:10:01.121Z","repository":{"id":2618291,"uuid":"3602558","full_name":"php/phd","owner":"php","description":"PHD","archived":false,"fork":false,"pushed_at":"2025-03-06T16:30:06.000Z","size":3323,"stargazers_count":78,"open_issues_count":18,"forks_count":49,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-28T07:24:29.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://doc.php.net/phd","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/php.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2012-03-02T14:00:31.000Z","updated_at":"2025-03-06T16:30:10.000Z","dependencies_parsed_at":"2023-07-06T01:54:36.694Z","dependency_job_id":"d0d32097-1933-4ae7-b68d-2b58556e3ec3","html_url":"https://github.com/php/phd","commit_stats":{"total_commits":1274,"total_committers":71,"mean_commits":"17.943661971830984","dds":0.6758241758241759,"last_synced_commit":"15284136ffc82218e4fbe4ba6a801c3fc7366394"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php%2Fphd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php%2Fphd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php%2Fphd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php%2Fphd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php","download_url":"https://codeload.github.com/php/phd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261612,"owners_count":20910108,"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":[],"created_at":"2024-08-04T09:02:42.426Z","updated_at":"2025-04-04T23:10:01.093Z","avatar_url":"https://github.com/php.png","language":"PHP","readme":"# PhD - PHP DocBook\n\n## About PhD\n\nPhD is PHP's DocBook rendering system\nwhich is used to convert the PHP Manual into different output formats.\n\nIf you would like to contribute to PHP's documentation please refer to the\n[contribution guidelines](https://github.com/php/doc-base/blob/master/CONTRIBUTING_DOCS.md).\n\nIf you would like to know more about how PHP's documentation is built\nand what the different parts of its pipeline are, please refer to the\n[documentation overview](https://github.com/php/doc-base/blob/master/OVERVIEW.md).\n\n## Requirements\n\n- PHP 8.1+\n- DOM, libXML2, XMLReader and SQLite3.\n\n\n## Running the test suite\n\nRunning the test suite uses the same test runner as the `php-src` repository.\n\n```shell\n$ make test\n```\n\n## Rendering the PHP Documentation Sources\n\nTo render the PHP documentation, you will need to clone the\ndocumentation source files, `doc-base` and PhD.\n\nTo get the PHP documentation sources, clone them from the official GitHub\nrepositories. To clone the English documentation:\n\n```shell\n$ git clone https://github.com/php/doc-en en\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eList of languages/repositories\u003c/summary\u003e\n\n  - [Brazilian Portugues](https://github.com/php/doc-pt_br) (doc-pt_br)\n  - [Chinese(Simplified)](https://github.com/php/doc-zh) (doc-zh)\n  - [English](https://github.com/php/doc-en) (doc-en)\n  - [French](https://github.com/php/doc-fr) (doc-fr)\n  - [German](https://github.com/php/doc-de) (doc-de)\n  - [Italian](https://github.com/php/doc-it) (doc-it)\n  - [Japanese](https://github.com/php/doc-ja) (doc-ja)\n  - [Polish](https://github.com/php/doc-pl) (doc-pl)\n  - [Romanian](https://github.com/php/doc-ro) (doc-ro)\n  - [Russian](https://github.com/php/doc-ru) (doc-ru)\n  - [Spanish](https://github.com/php/doc-es) (doc-es)\n  - [Turkish](https://github.com/php/doc-tr) (doc-tr)\n  - [Ukrainian](https://github.com/php/doc-uk) (doc-uk)\n\u003c/details\u003e\u003cbr\u003e\n\nTo check the documentation and combine it into one file,\nyou need to clone PHP's `doc-base` repository\n\n```shell\n$ git clone https://github.com/php/doc-base\n```\n\nand run `configure.php`\n\n```shell\n$ php doc-base/configure.php\n```\n\nwhich will generate a `.manual.xml` file in the `doc-base` directory.\n\nTo render the documentation in `xhtml` format\ninto the default `./output/` directory:\n\n```shell\n$ php phd/render.php -d doc-base/.manual.xml -P PHP -f xhtml\n```\n\n`xhtml` files are standalone files that can be opened directly in a browser.\nTo render the documentation in the same `php` format used on the `php.net` website:\n\n```shell\n$ php phd/render.php -d doc-base/.manual.xml -P PHP -f php\n```\n\nPlease refer to the appropriate section of the\n[contribution guidelines](https://github.com/php/doc-base/blob/master/CONTRIBUTING_DOCS.md#more-complex-changes--building-the-php-documentation)\non setting up a local mirror of the PHP documentation.\n\n## PhD's rendering options\n\nThe following sections list PhD's the most frequently used options.\nTo see the list of all options run PhD with the `-h` \\ `--help` option.\n\n### Input\n\n`-d` \\ `--docbook` `\u003cfilename\u003e`    The Docbook file to render\n\n`-p` \\ `--partial` `\u003cid[=bool]\u003e`   Partial rendering: the ID to render, optionally skipping its children chunks (default to true; render children)\n\n`-s` \\ `--skip` `\u003cid[=bool]\u003e`      Partial rendering: the ID to skip, optionally skipping its children chunks (default to true; skip children)\n\n### Output\n\n`-P` \\ `--package` `\u003cpackagename\u003e`  The package to use.\nIf a package is specified without a format the input file is rendered\nin every format of the package.\nFor a list of supported packages, see the list of\n[Supported output formats](#supported-output-formats).\n\n`-f` \\ `--format` `\u003cformatname\u003e`    The build format to use.\nIf no package is specified, the appropriate format of the `Generic` package is used.\nFor a list of supported formats, see the list of\n[Supported output formats](#supported-output-formats)\n\n`-o` \\ `--output` `\u003cdirectory\u003e`     The output directory (default: .)\n\n### Indexing\n\n`-I` \\ `--noindex`       Do not index before rendering but load from cache. (default: false)\n\n`-M` \\ `--memoryindex`   Do not save indexing into a file, store it in memory. (default: false)\n\n`-r` \\ `--forceindex`    Force re-indexing. (default: false)\n\n### Information\n\n`-h` \\ `--help`          Lists all available options.\n\n`-l` \\ `--list`          Lists all supported packages and formats.\n\n\n## Syntax highlighting\n\nPart of the documentation of programming languages is source code\nexamples. PhD is able to colorize the source code of many types of\nsource code with the help of *highlighters*.\n\nTo utilize syntax highlighting, your opening `\u003cprogramlisting\u003e` tags\nneed a `role` attribute describing the type of source code. Examples are\n`php`, `html` and `python`.\n\n\u003e **_NOTE:_**\n\u003e PhD currently only highlights the code if it is embedded in a `CDATA`\n\u003e section.\n\n```xml\n\u003cprogramlisting role=\"php\"\u003e\u003c![CDATA[\n\u003c?php\necho \"Hello world!\";\n?\u003e\n]]\u003e\u003c/programlisting\u003e\n```\n\nBy default, PhD uses the source code highlighter that is built into PHP\nitself which is only able to highlight PHP code.\n\nIf your documentation contains other types of source code or markup,\nyou can write a custom syntax highlighter.\n\n\n### Writing a custom syntax highlighter\n\nA syntax highlighter for PhD is nothing more than a simple PHP class\nthat has two methods: `factory` and `highlight`.\n\n`factory` is static, takes the format name (i.e. `pdf`, `xhtml`,\n`troff`) as its only parameter and returns the highlighter instance object\nfor the given format. The method is called for each output format the\ndocumentation is rendered to.\n\n`highlight` takes three parameters: `text`, `role` and `format`. It is\ncalled whenever a piece of source code needs to be highlighted and\nexpects the highlighted source code to be returned in the format\nof the current rendering format.\n\nTake a look at the provided highlighters, `phpdotnet\\phd\\Highlighter`,\n`phpdotnet\\phd\\Highlighter_GeSHi` and\n`phpdotnet\\phd\\Highlighter_GeSHi11x`. They will serve as good examples\non how to implement your own highlighter.\n\nOnce you wrote your custom source code highlighting class, it's time to\n[try it out](#syntax-highlighting).\n\n## Supported output formats\n\nPhD currently supports the following output formats:\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cb\u003ePACKAGE\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eGeneric\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003eIDE\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003ePEAR\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cb\u003ePHP\u003c/b\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"12\"\u003e\u003cb\u003eFORMAT\u003c/b\u003e\u003c/td\u003e\n    \u003ctd\u003exhtml\u003c/td\u003e\n    \u003ctd\u003exml\u003c/td\u003e\n    \u003ctd\u003exhtml\u003c/td\u003e\n    \u003ctd\u003exhtml\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebigxhtml\u003c/td\u003e\n    \u003ctd\u003efunclist\u003c/td\u003e\n    \u003ctd\u003ebigxhtml\u003c/td\u003e\n    \u003ctd\u003ebigxhtml\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emanpage\u003c/td\u003e\n    \u003ctd\u003ejson\u003c/td\u003e\n    \u003ctd\u003ephp\u003c/td\u003e\n    \u003ctd\u003ephp\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"9\"\u003e\u003c/td\u003e\n    \u003ctd\u003ephp\u003c/td\u003e\n    \u003ctd\u003echm\u003c/td\u003e\n    \u003ctd\u003echm\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ephpstub\u003c/td\u003e\n    \u003ctd\u003etocfeed\u003c/td\u003e\n    \u003ctd\u003etocfeed\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003esqlite\u003c/td\u003e\n    \u003ctd rowspan=\"7\"\u003e\u003c/td\u003e\n    \u003ctd\u003emanpage\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd rowspan=\"6\"\u003e\u003c/td\u003e\n    \u003ctd\u003ehowto\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003epdf\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ebigpdf\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ekdevelop\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eepub\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eenhancedchm\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","funding_links":[],"categories":["PHP"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp%2Fphd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp%2Fphd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp%2Fphd/lists"}