Packages

A fork of the Readability library for extracting and curating articles.

Current section

Files

Jump to
readability2 doc Readability.Helper.html
Raw

doc/Readability.Helper.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.22.1">
<meta name="project" content="readability2 v0.2.0">
<title>Readability.Helper — readability2 v0.2.0</title>
<link rel="stylesheet" href="dist/elixir-e589b8fad3dab6230c65.css" />
<link rel="canonical" href="https://hexdocs.pm/readability2/Readability.Helper.html" />
<script src="dist/sidebar_items-dd6dff8ac1.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/app-5c0c23dfec2d63ae33a2.js"></script>
</head>
<body data-type="modules">
<script>try { if(localStorage.getItem('night-mode') === 'true') document.body.className += ' night-mode'; } catch (e) { }</script>
<div class="main">
<button class="sidebar-button sidebar-toggle">
<span class="icon-menu" title="Collapse/expand sidebar"></span>
</button>
<section class="sidebar">
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
</button>
<button type="button" tabindex="-1" class="search-close-button">
<span class="icon-cross" title="Cancel search"></span>
</button>
<label class="search-label">
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search..." aria-label="Search" autocomplete="off" />
</label>
</form>
<div class="autocomplete">
<div class="autocomplete-results">
</div>
</div>
<div class="sidebar-header">
<div class="sidebar-projectDetails">
<a href="api-reference.html" class="sidebar-projectName">
readability2 </a>
<h2 class="sidebar-projectVersion">
v0.2.0
</h2>
</div>
</div>
<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>
<li><a id="modules-list" href="#full-list">Modules</a></li>
</ul>
<div class="gradient"></div>
<ul id="full-list" class="sidebar-fullList"></ul>
</section>
<section class="content">
<div class="content-outer">
<div id="content" class="content-inner">
<h1>
<small class="app-vsn">readability2 v0.2.0</small>
Readability.Helper </h1>
<section id="moduledoc">
<p>Helpers for parsing, updating, removing html tree</p> </section>
<section id="summary" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#summary">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Summary
</h1>
<div class="summary-types summary">
<h2>
<a href="#types">Types</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#t:html_tree/0">html_tree()</a>
</div>
</div>
</div>
<div class="summary-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#candidate_tag?/1">candidate_tag?(html_tree)</a>
</div>
<div class="summary-synopsis"><p>Check html_tree can be candidate or not.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#change_tag/3">change_tag(content, selector, tag)</a>
</div>
<div class="summary-synopsis"><p>Change existing tags by selector</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#normalize/2">normalize(raw_html, opts \\ [])</a>
</div>
<div class="summary-synopsis"><p>Normalize and Parse to html tree(tuple or list)) from binary html</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#remove_attrs/2">remove_attrs(content, t_attrs)</a>
</div>
<div class="summary-synopsis"><p>Remove html attributes</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#remove_tag/2">remove_tag(content, fun)</a>
</div>
<div class="summary-synopsis"><p>Remove tags</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#text_length/1">text_length(html_tree)</a>
</div>
<div class="summary-synopsis"><p>Count only text length</p></div>
</div>
</div>
</section>
<section id="types" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#types">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Types </h1>
<div class="types-list">
<section class="detail" id="t:html_tree/0">
<div class="detail-header">
<a href="#t:html_tree/0" class="detail-link" title="Link to this type">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this type</span>
</a>
<h1 class="signature">html_tree()</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>html_tree() :: <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">tuple</a>() | <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">list</a>()</pre>
</div>
</section>
</section>
</div>
</section>
<section id="functions" class="details-list">
<h1 class="section-heading">
<a class="hover-link" href="#functions">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this section</span>
</a>
Functions </h1>
<div class="functions-list">
<section class="detail" id="candidate_tag?/1">
<div class="detail-header">
<a href="#candidate_tag?/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">candidate_tag?(html_tree)</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>candidate_tag?(<a href="#t:html_tree/0">html_tree</a>()) :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">boolean</a>()</pre>
</div>
<p>Check html_tree can be candidate or not.</p> </section>
</section>
<section class="detail" id="change_tag/3">
<div class="detail-header">
<a href="#change_tag/3" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">change_tag(content, selector, tag)</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>change_tag(<a href="#t:html_tree/0">html_tree</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()) :: <a href="#t:html_tree/0">html_tree</a>()</pre>
</div>
<p>Change existing tags by selector</p> </section>
</section>
<section class="detail" id="normalize/2">
<span id="normalize/1"></span>
<div class="detail-header">
<a href="#normalize/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">normalize(raw_html, opts \\ [])</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>normalize(<a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">binary</a>(), <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">list</a>()) :: <a href="#t:html_tree/0">html_tree</a>()</pre>
</div>
<p>Normalize and Parse to html tree(tuple or list)) from binary html</p> </section>
</section>
<section class="detail" id="remove_attrs/2">
<div class="detail-header">
<a href="#remove_attrs/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">remove_attrs(content, t_attrs)</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>remove_attrs(<a href="#t:html_tree/0">html_tree</a>(), <a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>() | [<a href="https://hexdocs.pm/elixir/String.html#t:t/0">String.t</a>()] | <a href="https://hexdocs.pm/elixir/Regex.html#t:t/0">Regex.t</a>()) :: <a href="#t:html_tree/0">html_tree</a>()</pre>
</div>
<p>Remove html attributes</p> </section>
</section>
<section class="detail" id="remove_tag/2">
<div class="detail-header">
<a href="#remove_tag/2" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">remove_tag(content, fun)</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>remove_tag(<a href="#t:html_tree/0">html_tree</a>(), (... -> <a href="https://hexdocs.pm/elixir/typespecs.html#basic-types">any</a>())) :: <a href="#t:html_tree/0">html_tree</a>()</pre>
</div>
<p>Remove tags</p> </section>
</section>
<section class="detail" id="text_length/1">
<div class="detail-header">
<a href="#text_length/1" class="detail-link" title="Link to this function">
<span class="icon-link" aria-hidden="true"></span>
<span class="sr-only">Link to this function</span>
</a>
<h1 class="signature">text_length(html_tree)</h1>
</div>
<section class="docstring">
<h2>Specs</h2>
<div class="specs">
<pre>text_length(<a href="#t:html_tree/0">html_tree</a>()) :: <a href="https://hexdocs.pm/elixir/typespecs.html#built-in-types">number</a>()</pre>
</div>
<p>Count only text length</p> </section>
</section>
</div>
</section>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.22.1),
</span>
<span class="line">
designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<p>
<button class="line footer-button display-shortcuts-help">
Display keyboard shortcuts
</button>
<button class="line footer-button night-mode-toggle">
Toggle night mode
</button>
<button class="line footer-button display-quick-switch">
Go to a HexDocs package
</button>
<button class="line footer-button tooltips-toggle">
<span class="tooltips-option-disable">Disable tooltips</span>
<span class="tooltips-option-enable">Enable tooltips</span>
</button>
</p>
</footer>
</div>
</div>
</section>
</div>
</body>
</html>