Skip to content

Commit b74e22e

Browse files
committed
Add example in README
1 parent b42a2a4 commit b74e22e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ We use [HTMLKit](https://github.com/iabudiab/HTMLKit) to take the place of Nokog
1111

1212
Below is a copy of the original README file, until I'm able to flesh this one out more.
1313

14+
But you can build a pipeline like this:
15+
16+
```ruby
17+
pipeline = MotionHTMLPipeline::Pipeline.new [
18+
MotionHTMLPipeline::Pipeline::HttpsFilter,
19+
MotionHTMLPipeline::Pipeline::ImageMaxWidthFilter
20+
]
21+
result = pipeline.call("<a href='http://example.com/one.png'>link</a> <img src='one.png'>", {http_url: 'http://example.com'})
22+
result[:output].to_s
23+
```
24+
1425
---
1526
# HTML::Pipeline
1627

0 commit comments

Comments
 (0)