mozilla-readability
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -7,3 +7,3 @@ { | ||
"description": "Mozilla Readability in Rust", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "repository": { |
@@ -5,3 +5,51 @@ # Mozilla Readability | ||
## Example | ||
``` | ||
import * as readability from './pkg/readability_wasm.js' | ||
const instance = new readability.Readability(); | ||
const testString = ` | ||
<html> | ||
<head> | ||
<link rel="stylesheet"> | ||
</head> | ||
<body> | ||
<nav> | ||
<ul> | ||
<li> | ||
Home | ||
</li> | ||
<li> | ||
Not Home | ||
</li> | ||
</ul> | ||
</nav> | ||
<div> | ||
<article> | ||
<h1>I am a test</h1> | ||
<p>lorem lorem</p> | ||
<p>ipsumity ipsum</p> | ||
</article> | ||
</div> | ||
</body> | ||
</html> | ||
`; | ||
const results = instance.parse(); | ||
console.log({ | ||
title: "I am a test", | ||
byline: null, | ||
excerpt: "lorem lorem ipsum ipsum", | ||
site_name: "example.com", | ||
article_html: ` | ||
<article> | ||
<h1>I am a test</h1> | ||
<p>lorem lorem</p> | ||
<p>ipsumity ipsum</p> | ||
</article> | ||
`, | ||
}); | ||
``` |
Sorry, the diff of this file is not supported yet
1726545
55