Move the long-form documentation out of Doxygen and into a wiki-synced docs/ directory - #85
Draft
jakejackson1 wants to merge 3 commits into
Draft
Move the long-form documentation out of Doxygen and into a wiki-synced docs/ directory#85jakejackson1 wants to merge 3 commits into
jakejackson1 wants to merge 3 commits into
Conversation
The prose that described QueryPath lived in Doxygen DocBlocks and in src/documentation.php, a file of 261 lines of @mainpage/@page markup and no runtime code. It documented QueryPath 2, and much of it had been wrong since QueryPath 3: find() was described as mutating in place when it returns a new object, and findInPlace() -- the method that actually mutates -- went unmentioned. Eleven Markdown pages now live in docs/, covering getting started, parser options, the CSS selector reference, writing extensions, and the full public API: all 99 public DOMQuery methods, indexed alphabetically and grouped by traversal, manipulation, markup, and utility. The Wiki Sync workflow publishes docs/ to the GitHub wiki on push to main, so docs/ is the source of truth and edits made in the browser are overwritten. Every claim was checked by running the code rather than by reading the DocBlock it came from, which turned up behaviour worth recording: the positional pseudo-classes are 1-indexed where jQuery's are 0-indexed, remove() and replaceAll() go through the legacy selector engine and disagree with find() on :lt(), :any-link and :scope, css() writes the union of the match set's style declarations to every element in it, and filterLambda()/eachLambda() raise an Error on PHP 8 because they were built on the removed create_function(). The DocBlocks that remain are PHPDoc and Markdown; no Doxygen-specific markup is left in src/. This commit changes comments only -- the diff over src/ contains no executable line -- and the suite is unchanged at 319 tests. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
CLAUDE.md directs plans to .claude/plans/. This is the audit behind the documentation work: a proposed 4.x roadmap that stays inside the no-breaking- changes constraint, with the PHPStan, coverage, and API findings it rests on. Kept as a separate commit so it can be dropped without touching the docs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
=========================================
Coverage 89.44% 89.44%
Complexity 1342 1342
=========================================
Files 26 26
Lines 3023 3023
=========================================
Hits 2704 2704
Misses 319 319 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the long-form documentation out of Doxygen and into eleven Markdown pages under
docs/, published to the GitHub wiki by a new workflow.The problem
The prose describing QueryPath lived in Doxygen DocBlocks and in
src/documentation.php— 261 lines of@mainpage/@pagemarkup and no runtime code, fed to Doxygen viaconfig.doxy. It documented QueryPath 2, and a good deal of it had been wrong since QueryPath 3:Nothing published it, either. The wiki was hand-maintained and had drifted from both the DocBlocks and the code.
What's here
HomeGetting-StartedParser-OptionsCSS-Selector-ReferenceWriting-ExtensionsExtensioninterface and registrationAPI-ReferenceDOMQuerymethods, alphabetical, plus a known-issues summaryTraversal-and-Filtering,Manipulation,Markup-and-Text,Document-and-UtilityHow-to-parse-HTML-in-PHP-using-querypath-libraryWiki Syncpublishesdocs/to the wiki on push tomain.docs/is the source of truth — the workflow replaces the wiki wholesale, so a page deleted here is deleted there, and edits made in the browser are overwritten. Cross-links keep their.mdsuffix in the repository (so they resolve when browsing the files here) and are stripped on the way to the wiki.Verification
Every claim was checked by running the method, not by reading the DocBlock it came from. That turned up behaviour worth recording rather than quietly documenting around:
:eq,:lt,:gt,:nth) are 1-indexed, where jQuery's are 0-indexedremove()andreplaceAll()go through the legacy selector engine, and disagree withfind()on:lt(),:any-linkand:scopecss()pools style declarations across the whole match set and writes the union to every element in itnot()inverts its test when given anSplObjectStorage;detach($selector)ignores its argument;hasAttr()returnstrueon an empty match setX > *raises aTypeError;writeHTML5()returnsnulland so cannot be chainedfilterLambda()andeachLambda()raise anErroron PHP 8 — both were built on the removedcreate_function():indeterminatereturns a random result;::first-line/::first-letterreturn the whole elementDocBlocks that no longer described the code were corrected too:
has()andsort()return a new object rather than mutating;size()claimed there is no$lengthproperty, but there is;childrenText()collects the whole subtree;dataURL()'s getter returns an array;branch()referred to aQPTPLclass that does not exist.Risk
Comments only. The diff over
src/— 28 files, 368 insertions, 828 deletions — contains no executable line; filtering it for non-comment content returns nothing. Suite unchanged at 319 tests, 1073 assertions;composer run lintclean.No Doxygen-specific markup (
@code/@endcode,@ingroup,@addtogroup,@attention,@retval,@b, inline<b>/<i>/<em>) remains insrc/.Conflicts with #70
The
CHANGELOGentry andCSS-Selector-Referencehere document the positional pseudo-classes as 1-indexed. #70 changes them to 0-indexed to match jQuery. Whichever lands second needs those reconciled — this branch documents the behaviour #70 replaces. Same for the note thatremove()/replaceAll()disagree withfind(), which #70 also fixes.Notes
docs/*was removed from.gitignore; it had been there for phpDocumentor HTML output committed years ago.claude/plans/modernization.mdis a separate commit so it can be dropped independently — it's the 4.x audit behind this work, not documentationconfig.doxyis left in place; removing it is a separate call now that nothing generates from it