1
0
mirror of https://github.com/php/phd.git synced 2026-04-24 23:48:06 +02:00

57 Commits

Author SHA1 Message Date
Louis-Arnaud 8755a928aa Make <preface> not produce a new page by default (#242)
Preface elements are now rendered inline in the parent page instead of
being chunked into separate pages. Explicit annotations like
chunk:true or phd:chunk="true" can still force chunking.
2026-02-17 14:30:25 +00:00
Louis-Arnaud 4eb564e1fb Fix GH-158: Replace empty() with strict string comparison for sdesc/ldesc (#238)
Both sdesc and ldesc are always initialized as "" in storeInfo() and
populated with htmlentities(trim(...)) results, so they are always
strings. Using empty() is overly broad here since it would also treat
a legitimate "0" value as empty. Replace with === "" for precision.

The third occurrence in Package/PEAR/Web.php was already removed in
commit 53f9afe.
2026-02-15 13:56:49 +00:00
Saki Takamachi 3c00a1a753 Add support enum links (#188) 2025-02-06 12:22:18 +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
Kamil Tekiela 2852b2756c Remove some dead code (#163) 2024-10-20 13:34:46 +02:00
Jim Winstead 417b06655c Fix element map so changelog rows are handled correctly (#146) 2024-09-23 11:16:41 -07: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 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 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 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 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 262926d03f Fix GH-98 (#105)
Store IDs of non-chunked elements.
Closes #98.

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-27 15:41:14 +00:00
haszi b703f50bdf Refactor test helpers and test files (#104)
* Add Format as an optional constructor dependency to TestRender

Add Format as an optional constructor dependency to TestRender.
Check format's methods conditionally.
Refactor tests to inject formats.

* Add Config as a constructor dependency to TestRender

Add Config as a constructor dependency to TestRender.
Refactor tests to inject Config.

* Add Index as an optional constructor dependency to TestRender

* TestRender to extend Render

* Config to allow calling instance methods

* Refactor test helpers and test directory structure

Refactor TestRender to use only constructor injected objects.
Rename test format helper classes to indicate which package they belong to.
Move TestRender and all format helper classes into the phpdotnet phd directory to enable autoloading.
Remove all unnecessary lines from setup.php.
Restructure test directory to follow the structure of the tested classes.

---------

Co-authored-by: haszi <haszika80@gmail.com>
2024-02-26 15:12:03 +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
Lu Fei bacc87c11a Fix index generation for table rows (#88)
This fixes some constant links
2023-11-12 13:02:10 +00:00
sy-records 934be12873 Revert "Fix missing constants link"
This reverts commit 6f2312310c.
2023-11-10 16:31:25 +08:00
sy-records 6f2312310c Fix missing constants link 2023-11-10 16:29:09 +08:00
George Peter Banyard 365cd394f1 Add support to render refentry tags as class and variable wrappers (#85)
Also adds support for using the annotations attribute for verifying the version information instead of overloading the role one
2023-10-21 13:21:13 +01:00
George Peter Banyard 3493ec80d6 Drop format_legalnotice_chunk() method from index
It is a passthrough to format_chunk() so use this directly
2023-10-20 18:26:48 +01:00
George Peter Banyard abcde24018 Drop format_varentry_chunk() method from index
It is a passthrough to format_chunk() so use this directly
2023-10-20 18:24:40 +01:00
George Peter Banyard 414b0026ef Support standard DocBook annotations XML attribute for chunking (#82)
This would allows us to use more comformant DocBook markup in the docs
2023-10-20 13:16:26 +01:00
Derick Rethans 862833e266 Fixed PHP 8.2 dynamic property generation warning 2023-03-23 15:50:13 +00:00
Larry Garfield 6c1af76a46 Fix PHP 8.1 deprecations. 2021-10-19 16:14:51 -05:00
Peter Kokot 3564283891 Sync final newlines
This patch adds some missing newlines and trims multiple redundant
newlines into a single newline.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-02 06:23:33 +02:00
Sobak aecae4e2c3 Eliminate $ comments 2015-03-09 06:20:39 +01:00
Hannes Magnusson 37a0e4268d WS :) 2012-06-09 17:33:56 +01:00
Hannes Magnusson a48d644c72 Add support for extension-membership and generate-changelog-for-membership PIs 2012-06-09 17:30:52 +01:00
Hannes Magnusson 37cca1e284 Added support for <?phpdoc generate-changelog-for"<container chunk ids>" ?>
It will autogenerate a table of changelog entries extracted from the
<refsect1 role="changelog"> entries of the containers children.
2012-06-09 13:10:20 +01:00
Hannes Magnusson 08b967488d Add --memoryindex (-M) to just store the index in memory
# couple of percentages less :)
2011-04-27 18:33:37 +00:00
Hannes Magnusson b01e81ca1d Improve the indexer performance by about 75% :) 2011-04-23 13:40:32 +00:00
Hannes Magnusson c5675e598e Generate IDs for example, and store their descriptions
# Useful for linking to specific examples via irc/email for example
# And will make it possible to create an example listing like we have always wanted
2010-12-31 09:28:38 +00:00
Hannes Magnusson 3b2bd7d0a9 Fixed bug#50671 (Missing root page) 2010-01-05 20:35:43 +00:00
Christian Weiske 87140b3520 remove legacy code that is not needed anymore; move Reader storage to ReaderKeeper 2009-10-16 17:43:56 +00:00
Christian Weiske 8f90746887 Fix --noindex option behavior, introduce --forceindex 2009-10-15 18:19:35 +00:00
Moacir de Oliveira Miranda Júnior 44ba130d10 Fixing bug #49743.
- Removing the primary key of docbook_id
- Allowing multiple sdescs
- Links for functions both oo and procedural working again
2009-10-09 05:10:23 +00:00
Hannes Magnusson d8a35f0be8 Fix multibyte charset issue (reported by Nilgun) 2009-09-04 12:03:18 +00:00
Hannes Magnusson 9165b51819 WS 2009-09-04 11:46:27 +00:00
Moacir de Oliveira Miranda Júnior eb3473ffa4 improving the dbhtml filename support 2009-09-01 04:47:10 +00:00
Moacir de Oliveira Miranda Júnior d67e8d9418 ignoring chunks without ids 2009-08-22 16:20:20 +00:00
Moacir de Oliveira Miranda Júnior cb4b3d2daf Storing all xml:ids in the indexer (no more broken links), New field in the SQLite DB: chunk - to inform if an id is a chunk or not (also this field allows to register the chunk elements using SQL updates) 2009-08-16 05:57:49 +00:00
Moacir de Oliveira Miranda Júnior 62efd16c0e Chunking sections like 0_4
Format_screen like 0_4
2009-08-10 13:16:10 +00:00
Moacir de Oliveira Miranda Júnior f9dcc25027 fixing page titles 2009-08-05 12:59:12 +00:00
Moacir de Oliveira Miranda Júnior 2229ec47de removing an old var_dump 2009-08-01 20:08:21 +00:00
Hannes Magnusson 9bacdbd09b - Add missing $Id$ tags and vim modelines
- Remove useless closing tags
2009-07-30 16:56:01 +00:00
Hannes Magnusson 48d711b15e - Fix "last indexed" timestamp
- Don't explicitly commit the index, do it when finalizing it
- Don't talk about .manual.xml, just say "Docbook file"
- Simplify attaching formats
- Kill commented out method
2009-07-28 21:35:15 +00:00
Moacir de Oliveira Miranda Júnior 3f12655942 dbhtml filename support 2009-07-28 05:42:02 +00:00
Moacir de Oliveira Miranda Júnior d24719e945 sect1 => format_chunk 2009-07-05 06:33:13 +00:00