Skip to content

Commit

Permalink
Deploying to gh-pages from @ c5313a8 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
sake92 committed Feb 15, 2024
1 parent 928bac6 commit 609214f
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions tutorials/handling-forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</style></head><body><div class="hidden-print"><nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"><div class="container-fluid"><a class="navbar-brand" href="../index.html"><span><img src="../images/favicon.svg" alt="logo" width="32" height="32" /></span> Sharaf</a><button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target="#main-navbar"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="main-navbar"><ul class="navbar-nav"></ul><ul class="navbar-nav ms-auto"><li class="nav-item"><a href="index.html" class="active nav-link">Tutorials</a></li><li class="nav-item"><a href="../howtos/index.html" class="nav-link">How-Tos</a></li><li class="nav-item"><a href="../reference/index.html" class="nav-link">Reference</a></li><li class="nav-item"><a href="../philosophy/index.html" class="nav-link">Philosophy</a></li></ul></div></div></nav></div><div class="container-fluid"><div class="row"><div class="col-md-3 d-flex justify-content-end hidden-print"><nav class="affix"><ul class="nav nav-pills flex-column"><li><a href="index.html" class="nav-link ">Tutorials</a></li><li><a href="hello-world.html" class="nav-link ">Hello World</a></li><li><a href="path-params.html" class="nav-link ">Path Params</a></li><li><a href="query-params.html" class="nav-link ">Query Params</a></li><li><a href="static-files.html" class="nav-link ">Static Files</a></li><li><a href="html.html" class="nav-link ">HTML</a></li><li><a href="handling-forms.html" class="nav-link active">Handling Forms</a></li><li><a href="json-api.html" class="nav-link ">JSON API</a></li><li><a href="validation.html" class="nav-link ">Validation</a></li><li><a href="sql-db.html" class="nav-link ">SQL DB</a></li><li><a href="tests.html" class="nav-link ">Tests</a></li><li><a href="htmx.html" class="nav-link ">HTMX</a></li></ul></nav></div><div data-bs-spy="scroll" data-bs-target="#tocScrollspy" class="col-md-6"><div class="hidden-print"></div><nav><ul class="pagination justify-content-center"><li title="HTML" class="page-item"><a href="html.html" class="page-link">Previous</a></li><li title="JSON API" class="page-item"><a href="json-api.html" class="page-link">Next</a></li></ul></nav><div><section id="handling-form-data"><h2>Handling Form data</h2><p>Form data can be extracted with <code>Request.current.bodyForm[MyData]</code>.<br />
The <code>MyData</code> needs to have a <code>FormDataRW</code> given instance.</p>
<p>Create a file <code>form_handling.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import scalatags.Text.all.*
Expand Down
4 changes: 2 additions & 2 deletions tutorials/hello-world.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
}
</style></head><body><div class="hidden-print"><nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"><div class="container-fluid"><a class="navbar-brand" href="../index.html"><span><img src="../images/favicon.svg" alt="logo" width="32" height="32" /></span> Sharaf</a><button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target="#main-navbar"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="main-navbar"><ul class="navbar-nav"></ul><ul class="navbar-nav ms-auto"><li class="nav-item"><a href="index.html" class="active nav-link">Tutorials</a></li><li class="nav-item"><a href="../howtos/index.html" class="nav-link">How-Tos</a></li><li class="nav-item"><a href="../reference/index.html" class="nav-link">Reference</a></li><li class="nav-item"><a href="../philosophy/index.html" class="nav-link">Philosophy</a></li></ul></div></div></nav></div><div class="container-fluid"><div class="row"><div class="col-md-3 d-flex justify-content-end hidden-print"><nav class="affix"><ul class="nav nav-pills flex-column"><li><a href="index.html" class="nav-link ">Tutorials</a></li><li><a href="hello-world.html" class="nav-link active">Hello World</a></li><li><a href="path-params.html" class="nav-link ">Path Params</a></li><li><a href="query-params.html" class="nav-link ">Query Params</a></li><li><a href="static-files.html" class="nav-link ">Static Files</a></li><li><a href="html.html" class="nav-link ">HTML</a></li><li><a href="handling-forms.html" class="nav-link ">Handling Forms</a></li><li><a href="json-api.html" class="nav-link ">JSON API</a></li><li><a href="validation.html" class="nav-link ">Validation</a></li><li><a href="sql-db.html" class="nav-link ">SQL DB</a></li><li><a href="tests.html" class="nav-link ">Tests</a></li><li><a href="htmx.html" class="nav-link ">HTMX</a></li></ul></nav></div><div data-bs-spy="scroll" data-bs-target="#tocScrollspy" class="col-md-6"><div class="hidden-print"></div><nav><ul class="pagination justify-content-center"><li title="Tutorials" class="page-item"><a href="index.html" class="page-link">Previous</a></li><li title="Path Params" class="page-item"><a href="path-params.html" class="page-link">Next</a></li></ul></nav><div><section id="hello-world"><h2>Hello World</h2><div><p>Let's make a Hello World example in scala-cli.<br />
Create a file <code>hello_sharaf.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.sharaf.*, routing.*
Expand Down
4 changes: 2 additions & 2 deletions tutorials/html.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<hr />
<p>Let's make a simple HTML page that greets the user.<br />
Create a file <code>html.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import scalatags.Text.all.*
Expand Down
4 changes: 2 additions & 2 deletions tutorials/htmx.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
<hr />
<p>Let's make a simple page that triggers a POST request to fetch a HTML snippet.<br />
Create a file <code>htmx_load_snippet.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import scalatags.Text.all.*
Expand Down
6 changes: 3 additions & 3 deletions tutorials/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
</style></head><body><div class="hidden-print"><nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"><div class="container-fluid"><a class="navbar-brand" href="../index.html"><span><img src="../images/favicon.svg" alt="logo" width="32" height="32" /></span> Sharaf</a><button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target="#main-navbar"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="main-navbar"><ul class="navbar-nav"></ul><ul class="navbar-nav ms-auto"><li class="nav-item"><a href="index.html" class="active nav-link">Tutorials</a></li><li class="nav-item"><a href="../howtos/index.html" class="nav-link">How-Tos</a></li><li class="nav-item"><a href="../reference/index.html" class="nav-link">Reference</a></li><li class="nav-item"><a href="../philosophy/index.html" class="nav-link">Philosophy</a></li></ul></div></div></nav></div><div class="container-fluid"><div class="row"><div class="col-md-3 d-flex justify-content-end hidden-print"><nav class="affix"><ul class="nav nav-pills flex-column"><li><a href="index.html" class="nav-link active">Tutorials</a></li><li><a href="hello-world.html" class="nav-link ">Hello World</a></li><li><a href="path-params.html" class="nav-link ">Path Params</a></li><li><a href="query-params.html" class="nav-link ">Query Params</a></li><li><a href="static-files.html" class="nav-link ">Static Files</a></li><li><a href="html.html" class="nav-link ">HTML</a></li><li><a href="handling-forms.html" class="nav-link ">Handling Forms</a></li><li><a href="json-api.html" class="nav-link ">JSON API</a></li><li><a href="validation.html" class="nav-link ">Validation</a></li><li><a href="sql-db.html" class="nav-link ">SQL DB</a></li><li><a href="tests.html" class="nav-link ">Tests</a></li><li><a href="htmx.html" class="nav-link ">HTMX</a></li></ul></nav></div><div data-bs-spy="scroll" data-bs-target="#tocScrollspy" class="col-md-6"><div class="hidden-print"></div><nav><ul class="pagination justify-content-center"><li class="disabled page-item"><a href="#" class="page-link">Previous</a></li><li title="Hello World" class="page-item"><a href="hello-world.html" class="page-link">Next</a></li></ul></nav><div><section id="quickstart"><h2>Quickstart</h2><p>Get started quickly with Sharaf framework.</p>
<section id="mill"><h3>Mill</h3><pre><code class="language-scala">def ivyDeps = super.ivyDeps() ++ Agg(
ivy&quot;ba.sake::sharaf:0.0.22&quot;
ivy&quot;ba.sake::sharaf:0.1.0&quot;
)
def scalacOptions = super.scalacOptions() ++ Seq(&quot;-Yretain-trees&quot;)
</code></pre>
Expand All @@ -43,11 +43,11 @@
<li><a href="https://github.com/sake92/sharaf-fullstack.g8">fullstack</a></li>
</ul>
</section><section id="sbt"><h3>Sbt</h3><pre><code class="language-scala">libraryDependencies ++= Seq(
&quot;ba.sake&quot; %% &quot;sharaf&quot; % &quot;0.0.22&quot;
&quot;ba.sake&quot; %% &quot;sharaf&quot; % &quot;0.1.0&quot;
),
scalacOptions ++= Seq(&quot;-Yretain-trees&quot;)
</code></pre>
</section><section id="scala-cli"><h3>Scala CLI</h3><pre><code class="language-scala">//&gt; using dep ba.sake::sharaf:0.0.22
</section><section id="scala-cli"><h3>Scala CLI</h3><pre><code class="language-scala">//&gt; using dep ba.sake::sharaf:0.1.0
scala-cli my_script.sc --scala-option -Yretain-trees
</code></pre>
</section><section id="examples"><h3>Examples</h3><ul>
Expand Down
4 changes: 2 additions & 2 deletions tutorials/json-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
}
</style></head><body><div class="hidden-print"><nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"><div class="container-fluid"><a class="navbar-brand" href="../index.html"><span><img src="../images/favicon.svg" alt="logo" width="32" height="32" /></span> Sharaf</a><button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target="#main-navbar"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="main-navbar"><ul class="navbar-nav"></ul><ul class="navbar-nav ms-auto"><li class="nav-item"><a href="index.html" class="active nav-link">Tutorials</a></li><li class="nav-item"><a href="../howtos/index.html" class="nav-link">How-Tos</a></li><li class="nav-item"><a href="../reference/index.html" class="nav-link">Reference</a></li><li class="nav-item"><a href="../philosophy/index.html" class="nav-link">Philosophy</a></li></ul></div></div></nav></div><div class="container-fluid"><div class="row"><div class="col-md-3 d-flex justify-content-end hidden-print"><nav class="affix"><ul class="nav nav-pills flex-column"><li><a href="index.html" class="nav-link ">Tutorials</a></li><li><a href="hello-world.html" class="nav-link ">Hello World</a></li><li><a href="path-params.html" class="nav-link ">Path Params</a></li><li><a href="query-params.html" class="nav-link ">Query Params</a></li><li><a href="static-files.html" class="nav-link ">Static Files</a></li><li><a href="html.html" class="nav-link ">HTML</a></li><li><a href="handling-forms.html" class="nav-link ">Handling Forms</a></li><li><a href="json-api.html" class="nav-link active">JSON API</a></li><li><a href="validation.html" class="nav-link ">Validation</a></li><li><a href="sql-db.html" class="nav-link ">SQL DB</a></li><li><a href="tests.html" class="nav-link ">Tests</a></li><li><a href="htmx.html" class="nav-link ">HTMX</a></li></ul></nav></div><div data-bs-spy="scroll" data-bs-target="#tocScrollspy" class="col-md-6"><div class="hidden-print"></div><nav><ul class="pagination justify-content-center"><li title="Handling Forms" class="page-item"><a href="handling-forms.html" class="page-link">Previous</a></li><li title="Validation" class="page-item"><a href="validation.html" class="page-link">Next</a></li></ul></nav><div><section id="model-definition"><h2>Model definition</h2><p>Let's make a simple JSON API in scala-cli.<br />
Create a file <code>json_api.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.tupson.JsonRW
Expand Down
4 changes: 2 additions & 2 deletions tutorials/path-params.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
}
</style></head><body><div class="hidden-print"><nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top"><div class="container-fluid"><a class="navbar-brand" href="../index.html"><span><img src="../images/favicon.svg" alt="logo" width="32" height="32" /></span> Sharaf</a><button type="button" class="navbar-toggler collapsed" data-bs-toggle="collapse" data-bs-target="#main-navbar"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="main-navbar"><ul class="navbar-nav"></ul><ul class="navbar-nav ms-auto"><li class="nav-item"><a href="index.html" class="active nav-link">Tutorials</a></li><li class="nav-item"><a href="../howtos/index.html" class="nav-link">How-Tos</a></li><li class="nav-item"><a href="../reference/index.html" class="nav-link">Reference</a></li><li class="nav-item"><a href="../philosophy/index.html" class="nav-link">Philosophy</a></li></ul></div></div></nav></div><div class="container-fluid"><div class="row"><div class="col-md-3 d-flex justify-content-end hidden-print"><nav class="affix"><ul class="nav nav-pills flex-column"><li><a href="index.html" class="nav-link ">Tutorials</a></li><li><a href="hello-world.html" class="nav-link ">Hello World</a></li><li><a href="path-params.html" class="nav-link active">Path Params</a></li><li><a href="query-params.html" class="nav-link ">Query Params</a></li><li><a href="static-files.html" class="nav-link ">Static Files</a></li><li><a href="html.html" class="nav-link ">HTML</a></li><li><a href="handling-forms.html" class="nav-link ">Handling Forms</a></li><li><a href="json-api.html" class="nav-link ">JSON API</a></li><li><a href="validation.html" class="nav-link ">Validation</a></li><li><a href="sql-db.html" class="nav-link ">SQL DB</a></li><li><a href="tests.html" class="nav-link ">Tests</a></li><li><a href="htmx.html" class="nav-link ">HTMX</a></li></ul></nav></div><div data-bs-spy="scroll" data-bs-target="#tocScrollspy" class="col-md-6"><div class="hidden-print"></div><nav><ul class="pagination justify-content-center"><li title="Hello World" class="page-item"><a href="hello-world.html" class="page-link">Previous</a></li><li title="Query Params" class="page-item"><a href="query-params.html" class="page-link">Next</a></li></ul></nav><div><section id="path-parameters"><h2>Path Parameters</h2><p>Path parameters can be extracted from the <code>Path(segments: Seq[String])</code> argument.</p>
<p>Create a file <code>path_params.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.sharaf.*, routing.*
Expand Down
4 changes: 2 additions & 2 deletions tutorials/query-params.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
and then use it like this: <code>Request.current.queryParams[MyParams]</code></p>
<hr />
<p>Create a file <code>query_params.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.querson.QueryStringRW
Expand Down
4 changes: 2 additions & 2 deletions tutorials/sql-db.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
</code></pre>
</section><section id="squery-setup"><h2>Squery setup</h2><p>Sharaf recommends the <a href="https://sake92.github.io/squery/">Squery</a> library for accessing databases with a JDBC driver.</p>
<p>Create a file <code>sql_db.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep org.postgresql:postgresql:42.7.1
//&gt; using dep com.zaxxer:HikariCP:5.1.0
//&gt; using dep ba.sake::sharaf:0.0.22
//&gt; using dep ba.sake::sharaf:0.1.0
//&gt; using dep ba.sake::squery:0.3.0

import io.undertow.Undertow
Expand Down
4 changes: 2 additions & 2 deletions tutorials/static-files.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
First create a file <code>resources/public/example.js</code>.<br />
Put this text into it: <code>console.log('Hello Sharaf!');</code>.</p>
<p>Now create a file <code>static_files.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.sharaf.*, routing.*
Expand Down
4 changes: 2 additions & 2 deletions tutorials/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
Writing integration tests with Munit and Requests is straightforward.</p>
<p>Here we are testing the API from the <a href="json-api.html#routes-definition">JSON API tutorial</a>.<br />
Create a file <code>json_api.test.scala</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0
//&gt; using test.dep org.scalameta::munit::1.0.0-M10

import io.undertow.Undertow
Expand Down
4 changes: 2 additions & 2 deletions tutorials/validation.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
<p>The <code>ValidatedData</code> can be any <code>case class</code>: json data, form data, query params..</p>
<hr />
<p>Create a file <code>validation.sc</code> and paste this code into it:</p>
<pre><code class="language-scala"> //&gt; using scala &quot;3.3.1&quot;
//&gt; using dep ba.sake::sharaf:0.0.22
<pre><code class="language-scala"> //&gt; using scala &quot;3.4.0&quot;
//&gt; using dep ba.sake::sharaf:0.1.0

import io.undertow.Undertow
import ba.sake.querson.QueryStringRW
Expand Down

0 comments on commit 609214f

Please sign in to comment.