small improvements

This commit is contained in:
Anton-4 2023-08-05 14:35:45 +02:00
parent 519eb9625c
commit 7598b080f1
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
6 changed files with 51 additions and 49 deletions

View file

@ -95,6 +95,7 @@ mv www/build/tutorial/tutorial.html www/build/tutorial/index.html
mkdir www/build/wip mkdir www/build/wip
$roc run www/wip_new_website/main.roc -- www/wip_new_website/content/ www/build/wip $roc run www/wip_new_website/main.roc -- www/wip_new_website/content/ www/build/wip
cp -r www/wip_new_website/static/site.css www/build/wip cp -r www/wip_new_website/static/site.css www/build/wip
cp -r www/build/fonts www/build/wip/fonts
# cleanup # cleanup
rm -rf roc_nightly roc_releases.json rm -rf roc_nightly roc_releases.json

View file

@ -1,6 +1,6 @@
#!/usr/bin/env roc #!/usr/bin/env roc
app "website-builder" app "website-builder"
packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.4.0-rc1/hbIodFf7kULTYZJkzgsvgsnFAvQexm5hVeBaOMZk84I.tar.br" } packages { pf: "https://github.com/roc-lang/basic-cli/releases/download/0.4.0/DI4lqn7LIZs8ZrCDUgLK-tHHpQmxGF1ZrlevRKq5LXk.tar.br" }
imports [ imports [
pf.Task.{ Task }, pf.Task.{ Task },
pf.Command, pf.Command,
@ -15,7 +15,7 @@ main =
Command.new "rm" Command.new "rm"
|> Command.args ["-rf", "dist/"] |> Command.args ["-rf", "dist/"]
|> Command.status |> Command.status
|> Task.onErr \_ -> crash "Failed to remove dist folder" |> Task.onFail \_ -> crash "Failed to remove dist folder"
|> Task.await |> Task.await
# Build site # Build site
@ -23,7 +23,7 @@ main =
Command.new "roc" Command.new "roc"
|> Command.args ["run", "main.roc", "--", "content/", "dist/wip/"] |> Command.args ["run", "main.roc", "--", "content/", "dist/wip/"]
|> Command.status |> Command.status
|> Task.onErr \_ -> crash "Failed to build site" |> Task.onFail \_ -> crash "Failed to build site"
|> Task.await |> Task.await
# Copy static files # Copy static files
@ -31,7 +31,7 @@ main =
Command.new "cp" Command.new "cp"
|> Command.args ["-r", "static/site.css", "dist/wip/"] |> Command.args ["-r", "static/site.css", "dist/wip/"]
|> Command.status |> Command.status
|> Task.onErr \_ -> crash "Failed to copy static files" |> Task.onFail \_ -> crash "Failed to copy static files"
|> Task.await |> Task.await
# Copy font files - assume that www/build.sh has been run previously and the # Copy font files - assume that www/build.sh has been run previously and the
@ -40,15 +40,15 @@ main =
Command.new "cp" Command.new "cp"
|> Command.args ["-r", "../build/fonts/", "dist/fonts/"] |> Command.args ["-r", "../build/fonts/", "dist/fonts/"]
|> Command.status |> Command.status
|> Task.onErr \_ -> crash "Failed to copy static files" |> Task.onFail \_ -> crash "Failed to copy static files"
|> Task.await |> Task.await
# Start file server # Start file server
{} <- {} <-
Command.new "simple-http-server" Command.new "simple-http-server"
|> Command.args ["-p", "8080", "--", "dist/"] |> Command.args ["-p", "8080", "--nocache", "--index", "--", "dist/"]
|> Command.status |> Command.status
|> Task.onErr \_ -> crash "Failed to run file server; consider intalling with `cargo install simple-http-server`" |> Task.onFail \_ -> crash "Failed to run file server; consider intalling with `cargo install simple-http-server`"
|> Task.await |> Task.await
Task.ok {} Task.succeed {}

View file

@ -1,28 +1,29 @@
# Roc # Roc
A work-in-progress programming language that aims to be fast, friendly, and functional. Work in progress!
Checkout the [tutorial](/wip/tutorial.html) and follow-along to see how you can build Roc applications. Along the way, you'll learn how to write tests, use the REPL, and much more! <!-- TODO turn these into nice buttons -->
- [tutorial](/wip/tutorial.html)
Roc doesnt have a numbered release or an installer yet, however you find helpful instructions on the [install](/wip/install.html) page to download a nightly release, or build from source code. - [install](/wip/install.html)
If you get stuck, our friendly community is always happy to help. Please open a topic in the [Roc Zulip Chat](https://roc.zulipchat.com) `#beginners` channel and let us help you! - [help / group chat](https://roc.zulipchat.com), we're friendly!
## Goals ## Goals
<section class="home-goals-container"> <section class="home-goals-container">
<div class="home-goals-column"> <div class="home-goals-column">
<h3 class="home-goals-title">Fast</h3> <h3 class="home-goals-title">Fast</h3>
<p class="home-goals-description">Delightful software runs fast. The Roc compiler should run fast, and it should be able to produce programs that run fast too. <br><a class="home-goals-learn-more" href="/design_goals.html#fast">What does <i>fast</i> mean?</a></p> <p class="home-goals-description">Runs fast, compiles fast. <br><a class="home-goals-learn-more" href="/design_goals.html#fast">Learn more</a></p>
</div> </div>
<div class="home-goals-column"> <div class="home-goals-column">
<h3 class="home-goals-title">Friendly</h3> <h3 class="home-goals-title">Friendly</h3>
<p class="home-goals-description">Roc aims to be a user-friendly language with a friendly community of users. This involves the set of tools Roc includes, and also the spirit of the community of Roc programmers. <br><a class="home-goals-learn-more" href="/design_goals.html#friendly">What does <i>friendly</i> mean?</a></p> <p class="home-goals-description">User-friendly language, friendly community. <br><a class="home-goals-learn-more" href="/design_goals.html#friendly">Learn more</a></p>
</div> </div>
<div class="home-goals-column"> <div class="home-goals-column">
<h3 class="home-goals-title">Functional</h3> <h3 class="home-goals-title">Functional</h3>
<p class="home-goals-description">Roc is a purely functional programming language. The language is built on a small set of simple primitives, which together give you a toolset that's more than the sum of its parts. <br><a class="home-goals-learn-more" href="/design_goals.html#functional">What does <i>functional</i> mean?</a></p> <p class="home-goals-description">Pure functional programming, keep it simple.<br><a class="home-goals-learn-more" href="/design_goals.html#functional">Learn more</a></p>
</section> </section>
## Try Roc ## Try Roc

View file

@ -1,6 +1,6 @@
# Install Roc # Install Roc
## Getting Started Guides <!-- TODO detect current OS with browser and only show link for that, provide other button for others -->
- [Linux x86-64](https://github.com/roc-lang/roc/blob/main/getting_started/linux_x86_64.md) - [Linux x86-64](https://github.com/roc-lang/roc/blob/main/getting_started/linux_x86_64.md)
- [MacOS Apple Silicon](https://github.com/roc-lang/roc/blob/main/getting_started/macos_apple_silicon.md) - [MacOS Apple Silicon](https://github.com/roc-lang/roc/blob/main/getting_started/macos_apple_silicon.md)
@ -8,11 +8,9 @@
- [Windows](https://github.com/roc-lang/roc/blob/main/getting_started/windows.md) - [Windows](https://github.com/roc-lang/roc/blob/main/getting_started/windows.md)
- [Other Systems](https://github.com/roc-lang/roc/blob/main/getting_started/other.md) - [Other Systems](https://github.com/roc-lang/roc/blob/main/getting_started/other.md)
## Nightly Builds ## Nightly
<!-- direct download links to builds should go here --> <!-- link to nightly for currently detected OS(browser) and provide "other" button to reveal all -->
[nightly builds](https://github.com/roc-lang/roc/releases)
## Roc CLI ## Roc CLI
@ -27,14 +25,14 @@
## Package Management ## Package Management
The Roc package manager is still a work in progress. In the meantime, you can use packages by including the bundle URL in your module header. You can include packages using an URL:
Below is an example of a Roc application which uses the [roc-lang/basic-cli](https://github.com/roc-lang/basic-cli) platform and the [lukewilliamboswell/roc-json](https://github.com/lukewilliamboswell/roc-json) package by including the bundle URLs in the module header.
```roc ```roc
app "hello" app "hello"
packages { packages {
# basic-cli platform
pf: "https://github.com/roc-lang/basic-cli/releases/download/0.4.0/DI4lqn7LIZs8ZrCDUgLK-tHHpQmxGF1ZrlevRKq5LXk.tar.br", pf: "https://github.com/roc-lang/basic-cli/releases/download/0.4.0/DI4lqn7LIZs8ZrCDUgLK-tHHpQmxGF1ZrlevRKq5LXk.tar.br",
# json package
json: "https://github.com/lukewilliamboswell/roc-json/releases/download/0.1.0/xbO9bXdHi7E9ja6upN5EJXpDoYm7lwmJ8VzL7a5zhYE.tar.br", json: "https://github.com/lukewilliamboswell/roc-json/releases/download/0.1.0/xbO9bXdHi7E9ja6upN5EJXpDoYm7lwmJ8VzL7a5zhYE.tar.br",
} }
imports [ imports [
@ -44,6 +42,8 @@ app "hello"
provides [main] to pf provides [main] to pf
``` ```
A full Roc package manager will be developed in the future.
<!-- <!--
explain package manager design is still a work in progress explain package manager design is still a work in progress
@ -52,6 +52,8 @@ the plan is to create a centralised index
- a fact that every language will have one - a fact that every language will have one
in the meantime you can use package URLs in the meantime you can use package URLs
TODO Add an explanation for the URLs with the SHA and the tar.br. This explanation should only be revealed on click.
--> -->
## Editor Support ## Editor Support
@ -61,6 +63,8 @@ explain that the high level design is a work in progress
- Design goals for editor - we want Roc to ship with an awesome editor - Design goals for editor - we want Roc to ship with an awesome editor
- Beginners learning to get up an running with an editor - Beginners learning to get up an running with an editor
- Want it to run really fast etc - Want it to run really fast etc
- Also link to VScode plugin
--> -->
- Language Server - Language Server

View file

@ -51,13 +51,8 @@ view = \page, htmlContent ->
], ],
footer [] [ footer [] [
div [id "footer"] [ div [id "footer"] [
text "This site is powered by ", text " powered by ",
a [href "https://www.netlify.com"] [ text "Netlify"], a [href "https://www.netlify.com"] [ text "Netlify"],
text ".",
br [] [],
text "The ",
a [href "https://foundation.roc-lang.org"] [ text "Roc Programming Language Foundation"],
text " is a nonprofit corporation.",
] ]
] ]
], ],
@ -86,7 +81,6 @@ viewNavbar =
rocLogo = rocLogo =
(Html.element "svg") [ (Html.element "svg") [
(Html.attribute "viewBox") "0 -6 51 58", (Html.attribute "viewBox") "0 -6 51 58",
(Html.attribute "fill") "#7c38f5",
(Html.attribute "xmlns") "http://www.w3.org/2000/svg", (Html.attribute "xmlns") "http://www.w3.org/2000/svg",
(Html.attribute "aria-labelledby") "logo-link", (Html.attribute "aria-labelledby") "logo-link",
(Html.attribute "role") "img", (Html.attribute "role") "img",

View file

@ -10,10 +10,12 @@
--violet-bg: #ece2fd; --violet-bg: #ece2fd;
--magenta: #a20031; --magenta: #a20031;
--link-color: var(--violet); --primary-1: #9b6bf2;
--code-link-color: var(--violet); --primary-2: #7c38f5;
--link-color: var(--primary-2);
--code-link-color: var(--primary-2);
--text-color: #000; --text-color: #000;
--text-hover-color: var(--violet); --text-hover-color: var(--primary-2);
--body-bg-color: #ffffff; --body-bg-color: #ffffff;
--border-color: #717171; --border-color: #717171;
--faded-color: #4c4c4c; --faded-color: #4c4c4c;
@ -23,6 +25,8 @@
monospace; monospace;
--top-header-height: 67px; --top-header-height: 67px;
--sidebar-width: 280px; --sidebar-width: 280px;
--font-size-normal: 1rem;
} }
html { html {
@ -40,11 +44,10 @@ body {
footer { footer {
width: 100%; width: 100%;
background-color: var(--gray-bg);
color: var(--text-color); color: var(--text-color);
padding: 20px; padding: 20px;
text-align: center; text-align: center;
font-size: 0.9rem; font-size: var(--font-size-normal);
} }
#footer { #footer {
@ -79,13 +82,13 @@ h1, h2, h3, h4 {
} }
h1 { h1 {
color: var(--green); color: var(--primary-1);
font-size: 5rem; font-size: 5rem;
text-shadow: 1px 1px 1px #010101; text-shadow: 1px 1px 1px #010101;
} }
h2 { h2 {
color: var(--violet); color: var(--primary-1);
font-size: 3rem; font-size: 3rem;
text-shadow: 1px 1px 1px #010101; text-shadow: 1px 1px 1px #010101;
} }
@ -93,7 +96,6 @@ h2 {
h3 { h3 {
color: var(--cyan); color: var(--cyan);
font-size: 1.5rem; font-size: 1.5rem;
text-shadow: 1px 1px 1px #010101;
} }
#top-bar { #top-bar {
@ -124,7 +126,7 @@ h3 {
#top-bar-links label { #top-bar-links label {
box-sizing: border-box; box-sizing: border-box;
color: var(--top-bar-fg); color: var(--top-bar-fg);
font-size: 1.1rem; font-size: var(--font-size-normal);
display: block; display: block;
height: 40px; height: 40px;
padding: 12px 16px; padding: 12px 16px;
@ -174,7 +176,7 @@ pre {
background-color: var(--gray-bg); background-color: var(--gray-bg);
overflow-x: hidden; overflow-x: hidden;
word-wrap: normal; word-wrap: normal;
font-size: 1.2rem; font-size: var(--font-size-normal);
line-height: 1.76em; line-height: 1.76em;
white-space: pre; white-space: pre;
} }
@ -230,7 +232,7 @@ td:last-child {
p, p,
aside, aside,
li { li {
font-size: 1.2rem; font-size: var(--font-size-normal);
line-height: 1.85rem; line-height: 1.85rem;
} }
@ -437,12 +439,11 @@ li {
--green: #8ecc88; --green: #8ecc88;
--cyan: #12c9be; --cyan: #12c9be;
--blue: #b1afdf; --blue: #b1afdf;
--violet: #caadfb;
--violet-bg: #332944; --violet-bg: #332944;
--magenta: #f39bac; --magenta: #f39bac;
--link-color: var(--violet); --primary-1: #9c7cea;
--code-link-color: var(--violet); --primary-2: #1bd6bd;
--text-color: #eaeaea; --text-color: #eaeaea;
--body-bg-color: #0e0e0f; --body-bg-color: #0e0e0f;
--border-color: var(--gray); --border-color: var(--gray);
@ -452,6 +453,10 @@ li {
--gray: #6e6e6e; --gray: #6e6e6e;
} }
h3 {
color: var(--primary-2);
}
h1, h1,
h2, h2,
h3, h3,
@ -573,6 +578,8 @@ code .dim {
width: 40px; width: 40px;
height: 40px; height: 40px;
margin: 0 auto; margin: 0 auto;
fill: var(--primary-1);
text-shadow: 1px 1px 1px #010101;
} }
.home-goals-container { .home-goals-container {
@ -602,8 +609,3 @@ code .dim {
line-height: 1.5; line-height: 1.5;
margin-bottom: 10px; margin-bottom: 10px;
} }
.home-goals-learn-more {
color: var(--violet);
text-decoration: none;
}