1
1
mirror of https://github.com/srid/rib.git synced 2024-11-25 08:52:09 +03:00

Deploying to gh-pages from @ 6516ac2cf5 🚀

This commit is contained in:
srid 2021-04-29 00:06:05 +00:00
parent ce4705d496
commit aa12fd9d08
9 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
{"Graph":{"adjacencyMap":{"syntax-highlighting":{},"typed-routes":{"tutorial":["cf",[]],"preview":["cf",[]]},"tutorial":{"preview":["cf",[]]},"guide":{"syntax-highlighting":["folge",[]],"typed-routes":["folge",[]],"tutorial":["cf",[]]},"preview":{},"examples":{},"index":{"tutorial":["folge",[]],"guide":["folge",[]],"preview":["folge",[]],"examples":["folge",[]]}},"vertices":{"syntax-highlighting":{"Path":"./syntax-highlighting.md","Slug":"syntax-highlighting","ID":"syntax-highlighting","Meta":{"tags":["guide"]},"Title":"Enable Syntax Highlighting"},"typed-routes":{"Path":"./typed-routes.md","Slug":"typed-routes","ID":"typed-routes","Meta":{"tags":["guide"]},"Title":"Typed Routes"},"tutorial":{"Path":"./tutorial.md","Slug":"tutorial","ID":"tutorial","Meta":{"tags":[]},"Title":"Tutorial"},"guide":{"Path":"./guide.md","Slug":"guide","ID":"guide","Meta":{"tags":[]},"Title":"Guide"},"preview":{"Path":"./preview.md","Slug":"preview","ID":"preview","Meta":{"tags":[]},"Title":"Quick Preview"},"examples":{"Path":"./examples.md","Slug":"examples","ID":"examples","Meta":{"tags":[]},"Title":"Examples"},"index":{"Path":"./index.md","Slug":"index","ID":"index","Meta":{"tags":[]},"Title":"Rib"}}},"NeuronVersion":"1.9.25.1","Config":{"editUrl":"https://github.com/srid/rib/edit/master/guide/","plugins":["neuronignore","links","tags","uptree","feed"],"siteBaseUrl":"https://rib.srid.ca","author":null,"siteTitle":"Rib","theme":"green"},"Errors":{}}
{"Graph":{"adjacencyMap":{"syntax-highlighting":{},"typed-routes":{"tutorial":["cf",[]],"preview":["cf",[]]},"tutorial":{"preview":["cf",[]]},"guide":{"syntax-highlighting":["folge",[]],"typed-routes":["folge",[]],"tutorial":["cf",[]]},"preview":{},"examples":{},"index":{"tutorial":["folge",[]],"guide":["folge",[]],"preview":["folge",[]],"examples":["folge",[]]}},"vertices":{"syntax-highlighting":{"Path":"./syntax-highlighting.md","Slug":"syntax-highlighting","ID":"syntax-highlighting","Meta":{"tags":["guide"]},"Title":"Enable Syntax Highlighting"},"typed-routes":{"Path":"./typed-routes.md","Slug":"typed-routes","ID":"typed-routes","Meta":{"tags":["guide"]},"Title":"Typed Routes"},"tutorial":{"Path":"./tutorial.md","Slug":"tutorial","ID":"tutorial","Meta":{"tags":[]},"Title":"Tutorial"},"guide":{"Path":"./guide.md","Slug":"guide","ID":"guide","Meta":{"tags":[]},"Title":"Guide"},"preview":{"Path":"./preview.md","Slug":"preview","ID":"preview","Meta":{"tags":[]},"Title":"Quick Preview"},"examples":{"Path":"./examples.md","Slug":"examples","ID":"examples","Meta":{"tags":[]},"Title":"Examples"},"index":{"Path":"./index.md","Slug":"index","ID":"index","Meta":{"tags":[]},"Title":"Rib"}}},"NeuronVersion":"1.9.27.2","Config":{"editUrl":"https://github.com/srid/rib/edit/master/guide/","plugins":["neuronignore","links","tags","uptree","feed"],"siteBaseUrl":"https://rib.srid.ca","author":null,"siteTitle":"Rib","theme":"green"},"Errors":{}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -94,4 +94,4 @@ data SrcMeta
-- | Description is optional, hence `Maybe`
description :: Maybe Text
}
deriving (Show, Eq, Generic, FromJSON)</code></pre><p>(View full <a href="https://github.com/srid/rib-sample/blob/master/src/Main.hs"><code>Main.hs</code></a> at rib-sample)</p></div></article><nav class="ui attached segment deemphasized backlinksPane" id="neuron-backlinks-pane"><h3 class="ui header">Backlinks</h3><ul class="backlinks"><li><span class="zettel-link-container cf"><span class="zettel-link"><a href="typed-routes">Typed Routes</a></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><p>Rib includes an optional route system based on <a href="https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/gadt.html">GADT</a>s than can be used to define safe and structured routes for your site. The sample repo used in <span class="zettel-link-container cf"><span class="zettel-link"><a href="tutorial">Tutorial</a></span></span> already uses routes, and you can see the entire code in <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span> to see all of this would fit together in a static site generator.</p></div></li></ul></li><li><span class="zettel-link-container cf"><span class="zettel-link"><a href="tutorial">Tutorial</a></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><code>Main.hs</code>: Haskell source containing the DSL of the HTML/CSS of your site. See <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span>.</div></li></ul></li></ul><h3 class="ui header"><span title="Backlinks from folgezettel parents">Uplinks</span></h3><ul class="backlinks"><li><span class="zettel-link-container folge"><span class="zettel-link"><a href=".">Rib</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><p>See <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span> to get a feel for what your code may look like.</p></div></li></ul></li></ul></nav><nav class="ui bottom attached icon compact inverted menu green" id="neuron-nav-bar"><!--replace-start-9--><a class="item" href="." title="Home"><i class="home icon"></i></a><!--replace-end-9--><a class="item" href="https://github.com/srid/rib/edit/master/guide/./preview.md" title="Edit this page"><i class="edit icon"></i></a><a class="right item" href="impulse" title="Open Impulse"><i class="wave square icon"></i></a></nav></div></div><!--replace-end-6--><!--replace-end-3--><!--replace-end-2--><div class="ui center aligned container footer-version"><div class="ui tiny image"><a href="https://neuron.zettel.page"><img alt="logo" src="https://raw.githubusercontent.com/srid/neuron/master/assets/neuron.svg" title="Generated by Neuron 1.9.25.1" /></a></div></div></div></body></html>
deriving (Show, Eq, Generic, FromJSON)</code></pre><p>(View full <a href="https://github.com/srid/rib-sample/blob/master/src/Main.hs"><code>Main.hs</code></a> at rib-sample)</p></div></article><nav class="ui attached segment deemphasized backlinksPane" id="neuron-backlinks-pane"><h3 class="ui header">Backlinks</h3><ul class="backlinks"><li><span class="zettel-link-container cf"><span class="zettel-link"><a href="typed-routes">Typed Routes</a></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><p>Rib includes an optional route system based on <a href="https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/gadt.html">GADT</a>s than can be used to define safe and structured routes for your site. The sample repo used in <span class="zettel-link-container cf"><span class="zettel-link"><a href="tutorial">Tutorial</a></span></span> already uses routes, and you can see the entire code in <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span> to see all of this would fit together in a static site generator.</p></div></li></ul></li><li><span class="zettel-link-container cf"><span class="zettel-link"><a href="tutorial">Tutorial</a></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><code>Main.hs</code>: Haskell source containing the DSL of the HTML/CSS of your site. See <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span>.</div></li></ul></li></ul><h3 class="ui header"><span title="Backlinks from folgezettel parents">Uplinks</span></h3><ul class="backlinks"><li><span class="zettel-link-container folge"><span class="zettel-link"><a href=".">Rib</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span><ul class="context-list" style="zoom: 85%;"><li class="item"><div class="pandoc"><p>See <span class="zettel-link-container folge"><span class="zettel-link"><a href="preview">Quick Preview</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span> to get a feel for what your code may look like.</p></div></li></ul></li></ul></nav><nav class="ui bottom attached icon compact inverted menu green" id="neuron-nav-bar"><!--replace-start-9--><a class="item" href="." title="Home"><i class="home icon"></i></a><!--replace-end-9--><a class="item" href="https://github.com/srid/rib/edit/master/guide/./preview.md" title="Edit this page"><i class="edit icon"></i></a><a class="right item" href="impulse" title="Open Impulse"><i class="wave square icon"></i></a></nav></div></div><!--replace-end-6--><!--replace-end-3--><!--replace-end-2--><div class="ui center aligned container footer-version"><div class="ui tiny image"><a href="https://neuron.zettel.page"><img alt="logo" src="https://raw.githubusercontent.com/srid/neuron/master/assets/neuron.svg" title="Generated by Neuron 1.9.27.2" /></a></div></div></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,4 +6,4 @@
Route_Home -&gt;
pure &quot;index.html&quot;
Route_Article srcPath -&gt;
pure $ &quot;article&quot; &lt;/&gt; srcPath -&lt;.&gt; &quot;.html&quot;</code></pre><p>Notice how in order to calculate the file path of a route, you only need the route (<code>Route a</code>), but not the data (<code>a</code>) used to generate it.</p><p>The arguments your route constructors take are meant to be used in the calculation of this file path. For example, the <code>FilePath</code> argument of the <code>Route_Article</code> constructor specifies the source path of the Markdown document, from which we compute the target (generated) path by simply replacing the extension with “.html” (in addition to putting it in a sub directory “article”).</p><h2 id="generating-a-route">Generating a route</h2><p><code>Rib.Route.writeRoute</code> takes a route, a string and writes that string to the file path associated with the route. You will use this in your Shake <code>Action</code> monad, typically inside a <code>forEvery</code> block.</p><h2 id="route-urls">Route URLs</h2><p>Once routes are fully defined as above, it becomes very straightforward to use them when linking in your HTML. The <code>Rib.routeUrl</code> function takes a route (<code>Route a</code>) and returns the URL to that route.</p><p>You will pass your routes to whichever function (<code>renderPage</code> is principle among them) that needs to know the URL to your generated files, as long as they remain polymorphic in the route type.</p><h2 id="see-also">See also</h2><ul><li><a href="https://old.reddit.com/r/haskell/comments/fsgqd6/monthly_hask_anything_april_2020/fm6esky/?context=3">obelisk-route</a>: the library that inspired <code>Rib.Route</code>.</li></ul></div></article><nav class="ui attached segment deemphasized backlinksPane" id="neuron-backlinks-pane"><h3 class="ui header"><span title="Backlinks from folgezettel parents">Uplinks</span></h3><ul class="backlinks"><li><span class="zettel-link-container folge"><span class="zettel-link"><a href="guide">Guide</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span><ul class="context-list" style="zoom: 85%;"></ul></li></ul></nav><nav class="ui attached segment deemphasized bottomPane" id="neuron-tags-pane"><div><span class="ui basic label zettel-tag" title="Tag">guide</span></div></nav><nav class="ui bottom attached icon compact inverted menu green" id="neuron-nav-bar"><!--replace-start-9--><a class="item" href="." title="Home"><i class="home icon"></i></a><!--replace-end-9--><a class="item" href="https://github.com/srid/rib/edit/master/guide/./typed-routes.md" title="Edit this page"><i class="edit icon"></i></a><a class="right item" href="impulse" title="Open Impulse"><i class="wave square icon"></i></a></nav></div></div><!--replace-end-6--><!--replace-end-3--><!--replace-end-2--><div class="ui center aligned container footer-version"><div class="ui tiny image"><a href="https://neuron.zettel.page"><img alt="logo" src="https://raw.githubusercontent.com/srid/neuron/master/assets/neuron.svg" title="Generated by Neuron 1.9.25.1" /></a></div></div></div></body></html>
pure $ &quot;article&quot; &lt;/&gt; srcPath -&lt;.&gt; &quot;.html&quot;</code></pre><p>Notice how in order to calculate the file path of a route, you only need the route (<code>Route a</code>), but not the data (<code>a</code>) used to generate it.</p><p>The arguments your route constructors take are meant to be used in the calculation of this file path. For example, the <code>FilePath</code> argument of the <code>Route_Article</code> constructor specifies the source path of the Markdown document, from which we compute the target (generated) path by simply replacing the extension with “.html” (in addition to putting it in a sub directory “article”).</p><h2 id="generating-a-route">Generating a route</h2><p><code>Rib.Route.writeRoute</code> takes a route, a string and writes that string to the file path associated with the route. You will use this in your Shake <code>Action</code> monad, typically inside a <code>forEvery</code> block.</p><h2 id="route-urls">Route URLs</h2><p>Once routes are fully defined as above, it becomes very straightforward to use them when linking in your HTML. The <code>Rib.routeUrl</code> function takes a route (<code>Route a</code>) and returns the URL to that route.</p><p>You will pass your routes to whichever function (<code>renderPage</code> is principle among them) that needs to know the URL to your generated files, as long as they remain polymorphic in the route type.</p><h2 id="see-also">See also</h2><ul><li><a href="https://old.reddit.com/r/haskell/comments/fsgqd6/monthly_hask_anything_april_2020/fm6esky/?context=3">obelisk-route</a>: the library that inspired <code>Rib.Route</code>.</li></ul></div></article><nav class="ui attached segment deemphasized backlinksPane" id="neuron-backlinks-pane"><h3 class="ui header"><span title="Backlinks from folgezettel parents">Uplinks</span></h3><ul class="backlinks"><li><span class="zettel-link-container folge"><span class="zettel-link"><a href="guide">Guide</a><span data-nosnippet="" style="user-select: none; color: gray" title="Folgezettel">#</span></span></span><ul class="context-list" style="zoom: 85%;"></ul></li></ul></nav><nav class="ui attached segment deemphasized bottomPane" id="neuron-tags-pane"><div><span class="ui basic label zettel-tag" title="Tag">guide</span></div></nav><nav class="ui bottom attached icon compact inverted menu green" id="neuron-nav-bar"><!--replace-start-9--><a class="item" href="." title="Home"><i class="home icon"></i></a><!--replace-end-9--><a class="item" href="https://github.com/srid/rib/edit/master/guide/./typed-routes.md" title="Edit this page"><i class="edit icon"></i></a><a class="right item" href="impulse" title="Open Impulse"><i class="wave square icon"></i></a></nav></div></div><!--replace-end-6--><!--replace-end-3--><!--replace-end-2--><div class="ui center aligned container footer-version"><div class="ui tiny image"><a href="https://neuron.zettel.page"><img alt="logo" src="https://raw.githubusercontent.com/srid/neuron/master/assets/neuron.svg" title="Generated by Neuron 1.9.27.2" /></a></div></div></div></body></html>