Skip to content

Commit

Permalink
Added api doc generated by phpdoc-md
Browse files Browse the repository at this point in the history
  • Loading branch information
wasinger committed Jan 13, 2023
1 parent 568a737 commit c7e4b74
Show file tree
Hide file tree
Showing 6 changed files with 1,897 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .phpdoc-md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
return (object)[
'rootNamespace' => 'Wa72\HtmlPageDom',
'destDirectory' => 'doc',
'format' => 'github',
'classes' => [
'\Wa72\HtmlPageDom\HtmlPage',
'\Wa72\HtmlPageDom\HtmlPageCrawler'
]
];
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ the modified page.
- `HtmlPageCrawler` extends `Symfony\Components\DomCrawler` by adding jQuery inspired, HTML specific
DOM *manipulation* functions such as `setInnerHtml($htmltext)`, `before()`, `append()`, `wrap()`, `addClass()` or `css()`.
It's like jQuery for PHP: simply select elements of an HTML page using CSS selectors and change their
attributes and content.
attributes and content.

[API doc for HtmlPageCrawler](doc/HtmlPageCrawler.md)

- `HtmlPage` represents one complete HTML document and offers convenience functions like `getTitle()`, `setTitle($title)`,
`setMeta('description', $description)`, `getBody()`. Internally, it uses the `HtmlPageCrawler` class for
filtering and manipulating DOM Elements. Since version 1.2, it offers methods for compressing (`minify()`) and
prettyprinting (`indent()`) the HTML page.

[API doc for HtmlPage](doc/HtmlPage.md)


Requirements and Compatibility
Expand Down Expand Up @@ -78,6 +82,7 @@ the selected elements using the following jQuery-like manipulation functions:
To get the modified DOM as HTML code use `html()` (returns innerHTML of the first node in your crawler object)
or `saveHTML()` (returns combined "outer" HTML code of all elements in the list).

See the full methods documentation in the generated [API doc for HtmlPageCrawler](doc/HtmlPageCrawler.md)

**Example:**

Expand Down Expand Up @@ -189,6 +194,8 @@ echo $page->indent()->save();
echo $page->minify()->save();
```

See also the generated [API doc for HtmlPage](doc/HtmlPage.md)

Limitations
-----------

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"phpunit/phpunit": "^9",
"wa72/html-pretty-min": "~0.1",
"mikey179/vfsstream": "^1.6.10",
"scrutinizer/ocular": "^1.9"
"scrutinizer/ocular": "^1.9",
"clean/phpdoc-md": "^0.19.3"
},
"suggest": {
"wa72/html-pretty-min": "Minify or indent HTML documents"
Expand Down
Loading

0 comments on commit c7e4b74

Please sign in to comment.