1
0
mirror of https://github.com/php/phd.git synced 2026-03-24 07:02:07 +01:00

123 Commits

Author SHA1 Message Date
Máté Kocsis
e546e7b8d8 Fix rendering of attribute constants (#249)
$this->cchunk["fieldsynopsis"]["modifier"] was not set for atrributes due to the early return, but this value is needed in order to be able to decide if the fieldsynopsis refers to a constant or a property at d7f7004639/phpdotnet/phd/Package/Generic/XHTML.php (L1608)
2026-03-19 22:08:18 +01:00
Louis-Arnaud
d7f7004639 Support <packagesynopsis> and <package> rendering for namespaced classes/enums (GH-194) (#241)
Add rendering support for DocBook's <packagesynopsis> and <package>
elements so that namespaced PHP classes and enums can display a proper
`namespace X;` declaration above the class/enum synopsis.
2026-02-15 14:10:12 +00:00
Louis-Arnaud
61ad3e7cb0 Support MathML (mml:*) elements for XHTML rendering (#236)
Closes #172
2026-02-05 17:04:33 +00:00
Louis-Arnaud
7366bc9f2a refactor: replace trigger_error(E_USER_ERROR) with exceptions (PHP 8.4 compatibility) (#218)
Co-authored-by: lacatoire <louis-arnaud.catoire@external.drivalia.com>
2026-01-09 02:09:58 +00:00
AllenJB
b9eb060be4 Make generated example IDs page specific (#210)
* Make example id attribute counter reset on each page (fixes #205)
2025-11-04 00:47:09 +00:00
Derick Rethans
b7d8f52b05 Allow for (nested) annotations elements
This allows us to set 'interactive' annotations on books, sets, and chapters to
signal to the WASM code runner that examples in these areas can be run.

The WASM code runner also checks for the 'non-interactive' annotation and
selectively disables running code for that example.
2025-03-06 17:30:06 +01:00
Derick Rethans
b1e5ac3975 Fixed trailing spaces 2025-03-06 17:30:06 +01:00
Luffy
d603ec5441 Render enumitemdescription using single line comments (#192) 2025-03-06 12:34:37 +00:00
haszi
b4c4bf8066 Explicitly cast values to the expected types 2025-01-14 12:16:32 +00:00
haszi
0525f61e85 Remove unnecessarily passed variables 2025-01-14 12:16:32 +00:00
haszi
996043bdca Remove unnecessary null coalescing operator
The property is initialized as an empty array
2025-01-14 12:16:32 +00:00
haszi
dc826beaac Remove duplicate array keys 2025-01-14 12:16:32 +00:00
haszi
c22feecbd0 Add FQN normalization to constants 2025-01-05 23:49:14 +00:00
haszi
d7a81ebea6 Add FQN normalization to properties 2025-01-05 23:49:14 +00:00
haszi
b80ae36dba Change property names to camel case 2024-12-29 19:58:10 +00:00
haszi
b8e817b6ff Replace method calls with property access 2024-12-29 19:58:10 +00:00
haszi
7f4079e98d Add property linking (#183)
Co-authored-by: haszi <haszika80@gmail.com>
2024-12-29 16:42:51 +00:00
Gina Peter Banyard
9c76a0f6a0 Support enumsynopsis in the most minimal way (#179) 2024-11-20 16:42:46 +00:00
haszi
15284136ff Separate regular PhD output from error handling (#176)
- Move error handling code into a class and remove PhD message output handling from it.
- Introduce a new class to handle PhD message output.
- Make the implicit dependency on the output functionality of classes explicit.
- Update PEAR package.xml.
- Fix tests.
- Use proper variadic parameters
- Use class constants
- Use first-class callable syntax

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-11-10 17:57:05 +00:00
haszi
99c70b7aaf Add links to constants with replaceable tags (#175)
Add links to constants with replaceable tags by processing them when the constant tag is being closed.
Add a test.

Co-authored-by: haszi <haszika80@gmail.com>
2024-11-03 14:05:25 +00:00
haszi
0364e4f969 Use trigger_error for errors (#174)
Co-authored-by: haszi <haszika80@gmail.com>
2024-10-29 14:11:27 +00:00
Kamil Tekiela
2852b2756c Remove some dead code (#163) 2024-10-20 13:34:46 +02:00
Kamil Tekiela
53f9afe269 Small code cleanup (#161) 2024-10-13 21:57:16 +02: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
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
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
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
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
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
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
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
a22459f749 Trim leading and trailing underscores in constant IDs (#106)
Co-authored-by: haszi <haszika80@gmail.com>
2024-03-03 15:34:16 +00:00
haszi
3718f2fe2d Enable nested roles (#103)
* Enable nested roles

Refactor role to be an array instead of a string to allow nesting of roles.
Use the indent method to format constant list tables.
Add tests for regular, table formatted and nested role containing variablelists.

* Make role property private

Add methods to push, pop and get role, and use these for all role accesses.
Make underlying $role array private.
Add comment on $role array being a LIFO stack.

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-24 03:00:32 +00:00
haszi
2c7a8f85ba Add links to constants (#102)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-23 18:02:42 +00:00
haszi
f2ba93877b Fix doc-en GH-3197 - Incorrect void return type appended (#100)
* Fix doc-en GH_3197

Fix void return type appended on void parameter list and add test for this fix.
Fix tests with incorrect expected output.

* Replace hardcoded html file extension for void type with the appropriate method call

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-20 22:12:31 +00:00
haszi
5362fde921 Implement simplelist attributes (#96)
Co-authored-by: haszi <haszika80@gmail.com>
Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-02-20 12:49:36 +00:00
haszi
45cffd68d3 Improve type tag linking behaviour (#94)
Also add proper support for void element and add a test case to the appropriate files.

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-18 15:26:10 +00:00
haszi
27e3bc3e4a Move whitespace formatting to generic XHTML format (#95)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-13 22:04:40 +00:00
haszi
bdbd0e68ad Declare dynamic properties and removenonexistent variable (#93)
Declare all previously dynamic properties as far up the class hierarchy as needed and remove all declarations further down the inheritance tree.
Remove one nonexistent variable.

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-09 21:41:14 +00:00
haszi
e5b8bf35a9 Remove file ending comment blocks (#92)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-08 12:46:21 +00:00
haszi
e4a363fde2 Fix tests (#91)
Co-authored-by: haszi <haszika80@gmail.com>
2024-02-07 18:48:35 +00:00
haszi
10ee0e4bb2 Add table formatting for constant lists (#90)
* Add table formatting for constant lists
* Add description and constants autogen text to .ini files
* Add language specific header to constant list table

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-05 15:17:25 +00:00
alfsb
c4d5d5f4bb Detect and render <emphasis role="strong|bold"> usage in manual (#81)
Co-authored-by: André L F S Bacci <ae@php.net>
2023-08-12 13:52:46 +01:00
George Peter Banyard
ac72a948cb Add support for rendering more logical classsynopsis markup (#77)
* Add support for rendering more logical classsynopsis markup while allowing the old markup to render
2023-07-26 14:10:08 +01:00
Dan
5708881e23 Adjust styles to match better 2023-06-29 19:12:57 -04:00
Dan Pock
d624550c71 Add rendering logic for interfaces
- Adds cchunk variable for tracking if a classsynopsis is actually an interface
- Render extends instead of implements for interfaces
- Render interface instead of class
2023-06-29 12:45:55 -04:00
George Peter Banyard
fd31ae5f37 Crude support for keycap and keycombo DocBook tags (#74)
Co-authored-by: Peter Cowburn <salathe@php.net>
2023-04-01 03:59:40 +01:00