You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

479 lines
20 KiB

<!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.23.0">
<meta name="project" content="Mirage v0.75.0">
<meta name="author" content="Inhji">
<title>Mirage.Links — Mirage v0.75.0</title>
<link rel="stylesheet" href="dist/elixir-9f91ebe876dc01d67920.css" />
<script src="dist/sidebar_items-86ebe4f0ec.js"></script>
<script src="docs_config.js"></script>
<script async src="dist/app-60a0c9f10e9e52eae31f.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" aria-label="Submit Search">
<span class="icon-search" aria-hidden="true" title="Submit search"></span>
</button>
<button type="button" tabindex="-1" class="search-close-button" aria-label="Cancel Search">
<span class="icon-cross" aria-hidden="true" title="Cancel search"></span>
</button>
<label class="search-label">
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search..." aria-label="Input your search terms" autocomplete="off" />
</label>
</form>
<div class="autocomplete">
<div class="autocomplete-results">
</div>
</div>
<div class="sidebar-header">
<div class="sidebar-projectDetails">
<a href="https://git.inhji.de/inhji/mirage" class="sidebar-projectName">
Mirage
</a>
<strong class="sidebar-projectVersion">
v0.75.0
</strong>
</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>
Mirage.Links <small class="app-vsn">(Mirage v0.75.0)</small>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L1" title="View Source" class="view-source" rel="help">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</h1>
<section id="moduledoc">
<p>The Links context.</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-functions summary">
<h2>
<a href="#functions">Functions</a>
</h2>
<div class="summary-row">
<div class="summary-signature">
<a href="#change_link/2">change_link(link, attrs \\ %{})</a>
</div>
<div class="summary-synopsis"><p>Returns a data structure for tracking link changes.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#create_link/1">create_link(attrs \\ %{})</a>
</div>
<div class="summary-synopsis"><p>Creates a link.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#create_link_or_return_existing/1">create_link_or_return_existing(attrs \\ %{})</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#delete_link/1">delete_link(link)</a>
</div>
<div class="summary-synopsis"><p>Deletes a Link.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#get_link!/1">get_link!(id)</a>
</div>
<div class="summary-synopsis"><p>Gets a single link.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#get_link_by_url!/1">get_link_by_url!(url)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#list_links/0">list_links()</a>
</div>
<div class="summary-synopsis"><p>Returns the list of notes_links.</p></div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#preload_link/1">preload_link(link)</a>
</div>
</div>
<div class="summary-row">
<div class="summary-signature">
<a href="#update_link/2">update_link(link, attrs)</a>
</div>
<div class="summary-synopsis"><p>Updates a link.</p></div>
</div>
</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="change_link/2">
<span id="change_link/1"></span>
<div class="detail-header">
<a href="#change_link/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">change_link(link, attrs \\ %{})</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L124" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Returns a data structure for tracking link changes.</p><h2 id="change_link/2-examples" class="section-heading">
<a href="#change_link/2-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">change_link</span><span class="p" data-group-id="7563343126-1">(</span><span class="n">link</span><span class="p" data-group-id="7563343126-1">)</span><span class="w">
</span><span class="p" data-group-id="7563343126-2">%</span><span class="nc" data-group-id="7563343126-2">Todo</span><span class="p" data-group-id="7563343126-2">{</span><span class="n">...</span><span class="p" data-group-id="7563343126-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="create_link/1">
<span id="create_link/0"></span>
<div class="detail-header">
<a href="#create_link/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">create_link(attrs \\ %{})</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L58" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Creates a link.</p><h2 id="create_link/1-examples" class="section-heading">
<a href="#create_link/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">create_link</span><span class="p" data-group-id="1322299558-1">(</span><span class="p" data-group-id="1322299558-2">%{</span><span class="ss">field</span><span class="p">:</span><span class="w"> </span><span class="n">value</span><span class="p" data-group-id="1322299558-2">}</span><span class="p" data-group-id="1322299558-1">)</span><span class="w">
</span><span class="p" data-group-id="1322299558-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="1322299558-4">%</span><span class="nc" data-group-id="1322299558-4">Link</span><span class="p" data-group-id="1322299558-4">{</span><span class="p" data-group-id="1322299558-4">}</span><span class="p" data-group-id="1322299558-3">}</span><span class="w">
</span><span class="gp unselectable">iex&gt; </span><span class="n">create_link</span><span class="p" data-group-id="1322299558-5">(</span><span class="p" data-group-id="1322299558-6">%{</span><span class="ss">field</span><span class="p">:</span><span class="w"> </span><span class="n">bad_value</span><span class="p" data-group-id="1322299558-6">}</span><span class="p" data-group-id="1322299558-5">)</span><span class="w">
</span><span class="p" data-group-id="1322299558-7">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="1322299558-7">}</span></code></pre>
</section>
</section>
<section class="detail" id="create_link_or_return_existing/1">
<span id="create_link_or_return_existing/0"></span>
<div class="detail-header">
<a href="#create_link_or_return_existing/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">create_link_or_return_existing(attrs \\ %{})</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L64" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="delete_link/1">
<div class="detail-header">
<a href="#delete_link/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">delete_link(link)</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L111" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Deletes a Link.</p><h2 id="delete_link/1-examples" class="section-heading">
<a href="#delete_link/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">delete_link</span><span class="p" data-group-id="8626872492-1">(</span><span class="n">link</span><span class="p" data-group-id="8626872492-1">)</span><span class="w">
</span><span class="p" data-group-id="8626872492-2">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="8626872492-3">%</span><span class="nc" data-group-id="8626872492-3">Link</span><span class="p" data-group-id="8626872492-3">{</span><span class="p" data-group-id="8626872492-3">}</span><span class="p" data-group-id="8626872492-2">}</span><span class="w">
</span><span class="gp unselectable">iex&gt; </span><span class="n">delete_link</span><span class="p" data-group-id="8626872492-4">(</span><span class="n">link</span><span class="p" data-group-id="8626872492-4">)</span><span class="w">
</span><span class="p" data-group-id="8626872492-5">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="8626872492-5">}</span></code></pre>
</section>
</section>
<section class="detail" id="get_link!/1">
<div class="detail-header">
<a href="#get_link!/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">get_link!(id)</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L38" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Gets a single link.</p><p>Raises if the Note link does not exist.</p><h2 id="get_link!/1-examples" class="section-heading">
<a href="#get_link!/1-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">get_link!</span><span class="p" data-group-id="0236630183-1">(</span><span class="mi">123</span><span class="p" data-group-id="0236630183-1">)</span><span class="w">
</span><span class="p" data-group-id="0236630183-2">%</span><span class="nc" data-group-id="0236630183-2">Link</span><span class="p" data-group-id="0236630183-2">{</span><span class="p" data-group-id="0236630183-2">}</span></code></pre>
</section>
</section>
<section class="detail" id="get_link_by_url!/1">
<div class="detail-header">
<a href="#get_link_by_url!/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">get_link_by_url!(url)</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L40" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="list_links/0">
<div class="detail-header">
<a href="#list_links/0" 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">list_links()</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L21" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Returns the list of notes_links.</p><h2 id="list_links/0-examples" class="section-heading">
<a href="#list_links/0-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">list_notes_links</span><span class="p" data-group-id="5392184630-1">(</span><span class="p" data-group-id="5392184630-1">)</span><span class="w">
</span><span class="p" data-group-id="5392184630-2">[</span><span class="p" data-group-id="5392184630-3">%</span><span class="nc" data-group-id="5392184630-3">Link</span><span class="p" data-group-id="5392184630-3">{</span><span class="p" data-group-id="5392184630-3">}</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="5392184630-2">]</span></code></pre>
</section>
</section>
<section class="detail" id="preload_link/1">
<div class="detail-header">
<a href="#preload_link/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">preload_link(link)</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L44" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
</section>
</section>
<section class="detail" id="update_link/2">
<div class="detail-header">
<a href="#update_link/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">update_link(link, attrs)</h1>
<a href="https://git.inhji.de/inhji/mirage/src/branch/main/lib/mirage/links.ex#L93" class="view-source" rel="help" title="View Source">
<span class="icon-code" aria-hidden="true"></span>
<span class="sr-only">View Source</span>
</a>
</div>
<section class="docstring">
<p>Updates a link.</p><h2 id="update_link/2-examples" class="section-heading">
<a href="#update_link/2-examples" class="hover-link"><span class="icon-link" aria-hidden="true"></span></a>
Examples
</h2>
<pre><code class="nohighlight makeup elixir"><span class="gp unselectable">iex&gt; </span><span class="n">update_link</span><span class="p" data-group-id="3843903413-1">(</span><span class="n">link</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3843903413-2">%{</span><span class="ss">field</span><span class="p">:</span><span class="w"> </span><span class="n">new_value</span><span class="p" data-group-id="3843903413-2">}</span><span class="p" data-group-id="3843903413-1">)</span><span class="w">
</span><span class="p" data-group-id="3843903413-3">{</span><span class="ss">:ok</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3843903413-4">%</span><span class="nc" data-group-id="3843903413-4">Link</span><span class="p" data-group-id="3843903413-4">{</span><span class="p" data-group-id="3843903413-4">}</span><span class="p" data-group-id="3843903413-3">}</span><span class="w">
</span><span class="gp unselectable">iex&gt; </span><span class="n">update_link</span><span class="p" data-group-id="3843903413-5">(</span><span class="n">link</span><span class="p">,</span><span class="w"> </span><span class="p" data-group-id="3843903413-6">%{</span><span class="ss">field</span><span class="p">:</span><span class="w"> </span><span class="n">bad_value</span><span class="p" data-group-id="3843903413-6">}</span><span class="p" data-group-id="3843903413-5">)</span><span class="w">
</span><span class="p" data-group-id="3843903413-7">{</span><span class="ss">:error</span><span class="p">,</span><span class="w"> </span><span class="n">...</span><span class="p" data-group-id="3843903413-7">}</span></code></pre>
</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.23.0) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank">Elixir programming language</a>.
</span>
<span class="line">
Designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<p>
<a href="api-reference.html" title="API reference" class="line footer-button">API Reference</a>
<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>