-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from KacperFKorban/scaladoc
Setup scaladoc
- Loading branch information
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
scaladoc: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Generate GUInep documentation | ||
run: sbt web3/doc | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v2 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: 'web/target/jvm-3/api' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v1 |
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
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# GUInep | ||
|
||
> Guinep are small tropical fruits from the Caribbean and Central/Southern America. They are described to taste like a cross between Lime and Lychee. | ||
PoC library to turn Scala 3 functions into UI forms with a single line of code. | ||
|
||
## Example | ||
|
||
```scala | ||
def upperCaseText(text: String): String = | ||
text.toUpperCase | ||
|
||
@main | ||
def run = | ||
guinep.web(upperCaseText) | ||
``` | ||
|
||
This will start a local web server with auto generated endpoints for running all listed functions. And an auto generated front-end with a form for each function. | ||
|
||
## Usage (with build tools) | ||
|
||
### sbt | ||
|
||
```scala | ||
libraryDependencies ++= Seq( | ||
"io.github.kacperfkorban" %% "guinep-web" % "version_from_releases" | ||
) | ||
``` | ||
|
||
### scala-cli | ||
|
||
```scala | ||
//> using lib "io.github.kacperfkorban::guinep-web:version_from_releases" | ||
``` | ||
|
||
## Usage (in code) | ||
|
||
`GUInep` only exposes one function `guinep.web` which takes some number of functions as arguments. | ||
|
||
```scala | ||
def upperCaseText(text: String): String = | ||
text.toUpperCase | ||
|
||
def rollDice(sides: Int): Int = | ||
scala.util.Random.nextInt(sides) + 1 | ||
|
||
@main | ||
def run = | ||
guinep.web( | ||
upperCaseText, | ||
rollDice | ||
) | ||
``` | ||
|
||
## Demo | ||
|
||
![GUInep_classes_demo](https://github.com/KacperFKorban/GUInep/assets/39772805/556b6c1b-ea72-4089-8cbd-16f680484177) |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
index : index.md |