* Add references to the other parts of the documentation pipeline
* Remove section on formats
* Remove some options and reformat the remaining ones
* Add list of supported packages ans formats
---------
Co-authored-by: haszi <haszika80@gmail.com>
Remove Config from Autoloader by replacing it with a static array and a setter method.
Update render.php and setup.php to pass package directories to Autoloader.
Add test.
Co-authored-by: haszi <haszika80@gmail.com>
* Add Config as a dependency to Format and all it subclasses
* Inject Config into every Format subclass at instantiation
---------
Co-authored-by: haszi <haszika80@gmail.com>
* Copy PhD guide into README
Convert PhD guide from XML to markdown.
Copy markdown PhD guide into README.
Change extension of README to .md.
Remove url to non-existent page.
Add section about language repositories.
* Update wording and urls
* Address review comments
Remove all PEAR related sections.
Remove the PhD guide related section.
Remove the section about phd:chunk and phd:toc.
Remove the v0.1RC1 release announcement link.
* Minor rewrite
Replace calling the phd command with running phd/render.php with php.
Remove duplicate 'Using PhD' section.
Remove a few unnecessary sentences.
Rewrite a few sentences.
Add header for the rendering options section.
---------
Co-authored-by: haszi <haszika80@gmail.com>
Replace static example element counter with class properties in Index and generic XHTML.
Add tests.
Refactor TestRender so that it can render multiple formats.
Co-authored-by: haszi <haszika80@gmail.com>
* Add rendering support for new class and exception markup
Add rendering support for new class and exception markup in the PHP package.
Add tests for the old and the new class and exception markup.
* Add indexing support for new class and exception markup
* Make PhD aware of the current class or exception name when using the new markup
When a reference element has the appropriate roles, store the name of the current class or exception. If this is not done, PhD will generate links to the class even from the class's own synopsis page.
* Fix code formatting differences in screen elements
* Add tests comparing old and new markup rendering output
---------
Co-authored-by: haszi <haszika80@gmail.com>
Remove spurious entries some language documentations have in the function/method listing. The spurious entries were the stream wrapper and context options which were listed in refentry elements. PhD assumes that refentry elements are always functions/methods. Fix this by giving stream wrappers and context options a role attribute with an appropriate value and handling these roles/values during indexing in PhD.
Co-authored-by: haszi <haszika80@gmail.com>
Refentry names are taken from xml IDs and stored in the database during indexing. These are then retrieved and used for linking to functions and methods. Do not use html_entity_decode on these names as these IDs should not have entities in them to begin with. This change aligns this function with the function/method linking functions that only do strtolower as well.
Co-authored-by: haszi <haszika80@gmail.com>
Closes https://github.com/php/doc-en/issues/3353.
When the list of `refentry`s (functions and methods) is retrieved from the indexing database the characters `_`, `::` and `->` in their names were replaced by `-` before storing them in the array `$ref` in `Format.php`. As this array is used to generate the links to and the index list of functions/methods, functions and methods with the same name after replacing the before mentioned characters (e.g. `finfo_buffer()`/`finfo::buffer()`, `finfo_file()`/`finfo::file()`, etc.) were overwriting each other's reference entries in memory (in the `$ref` array).
Fix this by not replacing the above listed characters.
Co-authored-by: haszi <haszika80@gmail.com>
Remove superfluous database initialization as database is already initialized during the initialization of Indexing.
Co-authored-by: haszi <haszika80@gmail.com>
Move all database access to IndexRepository.
Use the same database during the entire indexing-rendering process.
Add a simple smoke test for render.php.
Co-authored-by: haszi <haszika80@gmail.com>
This adds support for 'known' attributes on method and function parameters.
'Known' in this context means an attribute that has been declared in the documentation with an ID in the `class.attribute_name` format (all current predefined attributes are supported).
Current limitations are:
- No support for namespaced attributes
- No support for attributes on a return type
Co-authored-by: haszi <haszika80@gmail.com>
Still breaks the EN build on the doc rendering server
Indexing...
E_WARNING /local/src/phd/render.php:79 Undefined variable $config
PHP Fatal error: Uncaught Error: Call to a member function render_ids() on null in /local/src/phd/render.php:79
Stack trace:
0 /local/src/phd/render.php(129): phpdotnet\phd\make_reader()
1 {main} thrown in /local/src/phd/render.php on line 79
This reverts commit 71e6292050.
Add new IndexRepository class to handle all database access.
Inject IndexRepository as a dependency into the constructor of Index and use that instead of directly accessing the database.
Add basic indexing test.
Fix existing test that uses indexing to use IndexRepository.
Add method parameter and return types.
Make readNode method private.
Change equality to identity comparison for string.
Remove unnecessary comments and empty lines.
Add test.
* Refactor Options Parser and default Options Handler
Refactor default Options Handler to accept dependencies through its constructor.
Refactor default Options Handler to return an array of options instead of directly setting options in Config and declare array return types.
Refactor method in Options Parser to return an array of options and declare its return type as array.
Inject all necessary dependencies in render.php.
Refactor two methods in default Options Handler by using match expressions.
* Minor refactor of files used in tests
Inlcude Config with require_once instead of require in Autloader.
Define __INSTALLDIR__ only if it is not defined yet in render.php.
Include Autoloader and functions.php with require_once instead of require.
Remove unnecessary __PHPDIR__ constant, correct path for __INSTALLDIR__ and use that constant in setup.php.
* Remove var_dump from Options Parser
* Fix inconsistent option flags in default Option Handler
* Add default Options Handler tests
---------
Co-authored-by: haszi <haszika80@gmail.com>