-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
510 additions
and
54 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Livereload (dream-html.Dream_html.Livereload)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">dream-html</a> » <a href="../index.html">Dream_html</a> » Livereload</nav><header class="odoc-preamble"><h1>Module <code><span>Dream_html.Livereload</span></code></h1><p>Live reload script injection and handling. Adapted from <code>Dream.livereload</code> middleware. This version is not a middleware so it's not as plug-and-play as that, but on the other hand it's much simpler to implement because it uses type-safe dream-html nodes rather than parsing and printing raw HTML. See below for the 3-step process to use it.</p><p>This module is adapted from Dream, released under the MIT license. For details, visit <a href="https://github.com/aantron/dream">https://github.com/aantron/dream</a>.</p><p>Copyright 2021-2023 Thibaut Mattio, Anton Bachin.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 3.4.0.</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-route"><a href="#val-route" class="anchor"></a><code><span><span class="keyword">val</span> route : <span class="xref-unresolved">Dream</span>.route</span></code></div><div class="spec-doc"><p>(1) Put this in your top-level router:</p><pre class="language-ocaml"><code>let () = Dream.run | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Livereload (dream-html.Dream_html.Livereload)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">dream-html</a> » <a href="../index.html">Dream_html</a> » Livereload</nav><header class="odoc-preamble"><h1>Module <code><span>Dream_html.Livereload</span></code></h1><p>Live reload script injection and handling. Adapted from <code>Dream.livereload</code> middleware. This version is not a middleware so it's not as plug-and-play as that, but on the other hand it's much simpler to implement because it uses type-safe dream-html nodes rather than parsing and printing raw HTML. See below for the 3-step process to use it.</p><p>This module is adapted from Dream, released under the MIT license. For details, visit <a href="https://github.com/aantron/dream">https://github.com/aantron/dream</a>.</p><p>Copyright 2021-2023 Thibaut Mattio, Anton Bachin.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 3.4.0.</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-route"><a href="#val-route" class="anchor"></a><code><span><span class="keyword">val</span> route : <span class="xref-unresolved">Dream</span>.route</span></code></div><div class="spec-doc"><p>(1) Put this in your top-level router:</p><pre class="language-ocaml"><code>let () = Dream.run | ||
@@ Dream.logger | ||
@@ Dream.router [ | ||
Dream_html.Livereload.route; | ||
(* ...other routes... *) | ||
]</code></pre></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-script"><a href="#val-script" class="anchor"></a><code><span><span class="keyword">val</span> script : <a href="../index.html#type-node">node</a></span></code></div><div class="spec-doc"><p>(2) Put this inside your <code>head</code>:</p><pre class="language-ocaml"><code>head [] [ | ||
Livereload.script; | ||
(* ... *) | ||
]</code></pre></div></div><p>(3) And run the server with environment variable <code>ENV=dev</code>.</p><p><b>⚠️ If this env var is not set, then livereload is turned off.</b> This means that the <code>route</code> will respond with <code>404</code> status and the script will be omitted from the rendered HTML.</p></div></body></html> | ||
]</code></pre></div></div><p>(3) And run the server with environment variable <code>LIVERELOAD=1</code>.</p><p><b>⚠️ If this env var is not set, then livereload is turned off.</b> This means that the <code>route</code> will respond with <code>404</code> status and the script will be omitted from the rendered HTML.</p></div></body></html> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SVG (dream-html.Dream_html.SVG)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">dream-html</a> » <a href="../index.html">Dream_html</a> » SVG</nav><header class="odoc-preamble"><h1>Module <code><span>Dream_html.SVG</span></code></h1><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 1.1.0.</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-d"><a href="#val-d" class="anchor"></a><code><span><span class="keyword">val</span> d : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-fill"><a href="#val-fill" class="anchor"></a><code><span><span class="keyword">val</span> fill : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke"><a href="#val-stroke" class="anchor"></a><code><span><span class="keyword">val</span> stroke : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke_linecap"><a href="#val-stroke_linecap" class="anchor"></a><code><span><span class="keyword">val</span> stroke_linecap : <span><span>[< `butt <span>| `round</span> <span>| `square</span> ]</span> <a href="../index.html#type-to_attr">to_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke_linejoin"><a href="#val-stroke_linejoin" class="anchor"></a><code><span><span class="keyword">val</span> stroke_linejoin : | ||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>SVG (dream-html.Dream_html.SVG)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">dream-html</a> » <a href="../index.html">Dream_html</a> » SVG</nav><header class="odoc-preamble"><h1>Module <code><span>Dream_html.SVG</span></code></h1><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 1.1.0.</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec value anchored" id="val-d"><a href="#val-d" class="anchor"></a><code><span><span class="keyword">val</span> d : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-fill"><a href="#val-fill" class="anchor"></a><code><span><span class="keyword">val</span> fill : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke"><a href="#val-stroke" class="anchor"></a><code><span><span class="keyword">val</span> stroke : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke_linecap"><a href="#val-stroke_linecap" class="anchor"></a><code><span><span class="keyword">val</span> stroke_linecap : <span><span>[< `butt <span>| `round</span> <span>| `square</span> ]</span> <a href="../index.html#type-to_attr">to_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke_linejoin"><a href="#val-stroke_linejoin" class="anchor"></a><code><span><span class="keyword">val</span> stroke_linejoin : | ||
<span><span>[< `arcs <span>| `bevel</span> <span>| `miter</span> <span>| `miter_clip</span> <span>| `round</span> ]</span> <a href="../index.html#type-to_attr">to_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stroke_width"><a href="#val-stroke_width" class="anchor"></a><code><span><span class="keyword">val</span> stroke_width : <span><span class="type-var">_</span> <a href="../index.html#type-string_attr">string_attr</a></span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-viewbox"><a href="#val-viewbox" class="anchor"></a><code><span><span class="keyword">val</span> viewbox : <span><span class="label">min_x</span>:int <span class="arrow">-></span></span> <span><span class="label">min_y</span>:int <span class="arrow">-></span></span> <span><span class="label">width</span>:int <span class="arrow">-></span></span> <span><span class="label">height</span>:int <span class="arrow">-></span></span> <a href="../index.html#type-attr">attr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-xmlns"><a href="#val-xmlns" class="anchor"></a><code><span><span class="keyword">val</span> xmlns : <a href="../index.html#type-attr">attr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-path"><a href="#val-path" class="anchor"></a><code><span><span class="keyword">val</span> path : <a href="../index.html#type-std_tag">std_tag</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-svg"><a href="#val-svg" class="anchor"></a><code><span><span class="keyword">val</span> svg : <a href="../index.html#type-std_tag">std_tag</a></span></code></div></div></div></body></html> |
Oops, something went wrong.