jord-jd / web-article-formatter
Web Article Formatter
Fund package maintenance!
v3.1.0
2026-07-18 01:11 UTC
Requires
- php: >=5.5
- ext-dom: *
- dompdf/dompdf: ^0.8.2||^2.0.8||^3.1
- guzzlehttp/guzzle: ^6.5.8||^7.4.5
Requires (Dev)
- phpunit/phpunit: ^4.8||^9.6
Replaces
This package is auto-updated.
Last update: 2026-07-18 01:11:52 UTC
README
The web article formatter can extract and convert an article from a webpage into a number of other formats, including PDF, markdown, JSON, plain text and more.
Installation
You can install Web Article Formatter via Composer. Just run the following command.
composer require jord-jd/web-article-formatter
Usage
To retrieve a web page article and convert it into a different format, first create a new WebArticleFormatter
passing it the URL of the web page. Then, simply call the formatter's get method, passing it a valid format constant.
A list of all format constants can be found in the Format class.
$formatter = new WebArticleFormatter($url); echo $formatter->get(Format::PLAINTEXT); echo $formatter->get(Format::MARKDOWN); echo $formatter->get(Format::HTML); echo $formatter->get(Format::JSON); file_put_contents('article.pdf', $formatter->get(Format::PDF));