1
0
mirror of https://github.com/php/phd.git synced 2026-03-23 22:52:05 +01:00

1364 Commits

Author SHA1 Message Date
Christoph M. Becker
d2c7bfe681 Fix PHP highlighting for PHP ≥ 8.3 (GH-156)
PHP 8.3 changed the details of highlighting PHP code[1], basically like
we did[2] at roughly the same time.  However, both don't work well
together, so we avoid that.

[1] <https://github.com/php/php-src/pull/11913>
[2] <https://github.com/php/phd/pull/79>
2024-10-05 10:55:56 +02:00
Jim Winstead
417b06655c Fix element map so changelog rows are handled correctly (#146) 2024-09-23 11:16:41 -07:00
haszi
49a37c45b3 Move requireIndexing() to Config (#151)
* Move requireIndexing() to Config

* Change method name to requiresIndexing

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-09-22 19:22:31 +01:00
haszi
8e2da87785 Update README (#141)
* 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>
2024-09-11 13:50:30 +01:00
haszi
455a797ef8 Removed unused options 'chunk_extra' and 'intermediate_output_dir' from Config (#153)
Co-authored-by: haszi <haszika80@gmail.com>
2024-09-11 13:49:02 +01:00
haszi
75bf5fb8b2 Show actual default PhD settings (#150)
Co-authored-by: haszi <haszika80@gmail.com>
2024-09-11 13:46:58 +01:00
haszi
9d6a341038 Move removeDir function into Web.php (#149)
Co-authored-by: haszi <haszika80@gmail.com>
2024-09-11 13:46:24 +01:00
Jim Winstead
be5c1b8015 Add Makefile with a test target for running the test suite (#147) 2024-09-03 16:41:13 -07:00
haszi
86c5a1b322 Invoke Config instance methods instead of static methods from Format and its subclasses (#144)
Co-authored-by: haszi <haszika80@gmail.com>
2024-07-26 01:48:51 +01:00
haszi
8ca0905687 Remove Config from Autoloader (#143)
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>
2024-07-09 19:52:23 +01:00
haszi
e948f1040f Add config as a dependency of format (#142)
* 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>
2024-07-07 15:58:51 +01:00
haszi
319ec94374 Convert Config in render.php
Instantiate a Config object at the beginning of the script and use that with non-static methods.
2024-06-21 02:50:44 +01:00
haszi
d6dba1a2b8 Convert Config in tests
Instantiate a Config object in setup.php.
Use instantiated object in all tests with non-static methods.
2024-06-21 02:50:44 +01:00
haszi
d86ba83a31 Fix whitespace 2024-06-18 22:48:09 +02:00
haszi
0acdc4278e Add property and constant attribute rendering 2024-06-18 22:48:09 +02:00
haszi
3250c7c270 Remove ReaderKeeper from Generic XHTML format (#138)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-14 17:17:09 +01:00
haszi
0ab118456d Copy PhD guide into README (#132)
* 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>
2024-06-14 17:16:35 +01:00
haszi
25a18b956a Fix doc-en GH-3428 (#137)
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>
2024-06-14 16:08:07 +01:00
haszi
472dd3c144 Add non-parameter attribute rendering
Enable rendering of attributes for classes, exceptions, interfaces, methods and functions.
2024-06-10 23:43:19 +02:00
haszi
e18fd3eee0 Add example indexing and rendering test (#136)
Co-authored-by: haszi <haszika80@gmail.com>
2024-06-05 00:13:00 +01:00
haszi
ef44b909f4 DocBook 5.2 class and exception markup migration (#134)
* 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>
2024-06-04 00:29:06 +01:00
haszi
195745eb00 Fix GH 65 (#133)
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>
2024-05-29 12:02:31 +01:00
haszi
d8ae4df89f Remove ReaderKeeper from Index (#130)
* Remove ReaderKeeper from Index

* Change ldesc and sdesc to longDesc and shortDesc

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-05-29 12:01:07 +01:00
haszi
6291d50a05 Remove html_entity_decode when getting refentry names from the database (#131)
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>
2024-05-25 13:42:41 +01:00
haszi
8625d102d5 Fix GH-3353 incorrect function tag linking (#123)
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>
2024-05-22 16:19:28 +01:00
haszi
6ebe5fcac3 Remove superfluous database initialization (#128)
Remove superfluous database initialization as database is already initialized during the initialization of Indexing.

Co-authored-by: haszi <haszika80@gmail.com>
2024-05-22 16:18:19 +01:00
haszi
f1b97d16d4 Use parent class's IndexRepository in Index (#129)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-22 16:18:07 +01:00
haszi
fc84db4987 Move all database access to IndexRepository (#126)
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>
2024-05-20 13:19:31 +01:00
haszi
dda2c63603 Add basic Attribute linking (#127)
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>
2024-05-20 12:33:50 +01:00
Gina Peter Banyard
b535eebcde Revert "Move all database access code to IndexRepository (#120)"
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.
2024-05-14 00:28:54 +01:00
haszi
71e6292050 Move all database access code to IndexRepository (#120)
Use the same IndexRepository instance everywhere

Co-authored-by: haszi <haszika80@gmail.com>
2024-05-13 23:48:20 +01:00
haszi
415ff438a2 Add directory creation back to render.php with the same output as in Options Handler (#124)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-10 14:57:22 +01:00
haszi
891340a125 Full doc-en render test (#121)
* Full doc-en render test
* Pass output directory option to PhD

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-04-29 14:52:21 +01:00
Yoshinari Takaoka
6feef351b7 Added IndexRepository.php entry for pear install command (#122) 2024-04-29 14:51:19 +01:00
haszi
5c462401bd Remove output directory creation from render.php (#119)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-28 04:06:57 +01:00
Gina Peter Banyard
f93552ad86 Revert "Use the same indexing database throughout (#118)"
This doesn't seem to create the DB properly and is failing the builds.

This reverts commit ef13e91f06.
2024-04-25 22:38:34 +01:00
haszi
e7a6c0c9c4 Render elements in simplelist members correctly (#117)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-25 16:32:26 +01:00
haszi
ef13e91f06 Use the same indexing database throughout (#118)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-25 16:31:56 +01:00
haszi
150f7072d7 Add title color to h1 title elements (#116)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-22 13:22:10 +01:00
haszi
93a0c11828 Add file modification history to PHP doc pages (#115)
Co-authored-by: haszi <haszika80@gmail.com>
2024-04-20 15:23:32 +01:00
haszi
40e35fece0 Fix failing tests by using an in memory database 2024-04-16 11:23:53 +01:00
haszi
26bf0c610a Inject database dependency into constructor of Index
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.
2024-04-16 11:23:53 +01:00
haszi
765370f528 Move requireIndexing method out of Index
Move requireIndexing method out of Index.
Pass dependencies to requireIndex as parameters.
2024-04-16 11:23:53 +01:00
haszi
af04be9088 Pass setup to page footer
Pass the various setup variables to the footer so that the contirbution links can be moved there in web-php
2024-04-16 11:15:50 +01:00
haszi
e817ea8c42 Refactor Partial Reader
Inject all dependencies in the constructor.
Add parameter and return type hints.
Remove unused variables.
Add test.
2024-04-16 11:13:06 +01:00
haszi
5b52aac2fb Refactor Reader
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.
2024-04-16 11:13:06 +01:00
haszi
e6e6847d7b Refactor Options Parser and default Options Handler (#110)
* 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>
2024-03-17 18:29:43 +00:00
haszi
172da7553c Add links to namespaced non-class constants (#111)
Add links to namespaced non-class constants.
Add namespaced non-class constants to tests.

Co-authored-by: haszi <haszika80@gmail.com>
2024-03-17 18:24:50 +00:00
haszi
89216bc29a Add handler for caption tag (#109)
Co-authored-by: haszi <haszika80@gmail.com>
2024-03-17 18:15:40 +00:00
haszi
efea0458c0 Refactor Options Handler, Interface and Parser (#107)
Co-authored-by: haszi <haszika80@gmail.com>
2024-03-07 14:29:57 +00:00