Manipulate DOM HTML trees, powered by PHP's DOM extension.
composer require galvao/gerdr
- As an application
/path/to/gerdr/bin/gerdr -c /path/to/config.json -d /path/to/dom.html
As an application Gerdr outputs the modified DOM HTML so it can be piped, forwarded, etc... to any bash application.
- In your project:
try {
$gerdr = new Gerdr($dom, $config);
} catch (\Exception $e) {
// Treat the exception
}
try {
$gerdr->process();
} catch (\Exception $e) {
// Treat the exception
}
$result = $gerdr->getModifiedDom();
As of now Gerdr only removes elements/attributes with the remove
action.
- Gerdr's logo has a fragment from "Skírnir and Gerðr I", by Lorenz Frølich;
- The font used in the logo is "Norse", by Joël Carrouché.