diff --git a/docs/Discord-Logo-Black.svg b/docs/Discord-Logo-Black.svg new file mode 100644 index 0000000..9da6ee0 --- /dev/null +++ b/docs/Discord-Logo-Black.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/docs/Matrix_logo.svg b/docs/Matrix_logo.svg new file mode 100644 index 0000000..216e199 --- /dev/null +++ b/docs/Matrix_logo.svg @@ -0,0 +1,7 @@ + + +Matrix (protocol) logo + + + + diff --git a/docs/Octicons-bug.svg b/docs/Octicons-bug.svg new file mode 100644 index 0000000..b211f5b --- /dev/null +++ b/docs/Octicons-bug.svg @@ -0,0 +1,36 @@ + + + + + + diff --git a/docs/css/extra.css b/docs/css/extra.css index 868d09a..c19835a 100644 --- a/docs/css/extra.css +++ b/docs/css/extra.css @@ -234,6 +234,15 @@ footer > hr { display: flex; flex-direction: column; align-items: center; + + background-color: rgb(250, 250, 250); + margin-top: 2rem; + margin-bottom: 2rem; + margin-left: auto; + margin-right: auto; + border-radius: 3px; + border: 1px solid rgb(204, 204, 204); + box-shadow: 0px 1px 4px 0px rgb(204, 204, 204); } .ghcup-os-container { @@ -249,3 +258,42 @@ ul > li { overflow-wrap: anywhere; } + +.footer { + color: grey; + font-size: 0.7em; + margin-top: 1rem; + margin-bottom: 1rem; +} + +.footer div.show-all-platforms { + display: inline-block; +} + +#help, #collective { + margin-bottom: 0px; + display: block; + + margin-left: auto; + margin-right: auto; + margin-top: 15px; + text-align: center; + + font-size: 0.8em; +} + +#help img { + border: none; + margin: 0px; + height: 22px; +} + +#collective img { + border: none; + margin: 0px; +} + +#collective { + margin-top: 10px; +} + diff --git a/docs/index.md b/docs/index.md index 3062982..46729fa 100644 --- a/docs/index.md +++ b/docs/index.md @@ -12,35 +12,17 @@ hide:

GHCup is an installer for the general purpose language Haskell.

-
-Join the chat at Libera.chat -Join the chat at Matrix.org -Join the chat at Discord -Join the chat at https://gitter.im/haskell/ghcup - -
- ----- - -GHCup makes it easy to install specific versions of GHC on GNU/Linux, -macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh [Haskell developer environment](./install/#supported-tools) from scratch. -It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well). Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be). -
-Quick Install Getting Started User Guide Issue tracker
-[![GHCup](./ghcup.gif){: .center style="width:700px"}](install#installation) -
-

Quick Install

-
-

Linux, macOS, FreeBSD or WSL2

-

Run the following in a terminal (as a non-root user):

+

+

To install on Linux, macOS, FreeBSD or WSL2

+

run the following in a terminal (as a non-root user):

             curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
@@ -49,11 +31,14 @@ It follows the unix UNIX philosophy of [do one thing and do it well](https://en.
       
+
-
-

Windows

-

Run the following in a PowerShell session (as a non-admin user):

+

+

To install on Windows

+

run the following in a PowerShell session (as a non-admin user):

@@ -62,5 +47,24 @@ It follows the unix UNIX philosophy of [do one thing and do it well](https://en.
         
+
+ +
+ +

+Need help? Ask on IRC, Discord, or report a bug +

+ +
+

+ +---- + +![GHCup](./ghcup.gif){: .center style="width:700px"} + diff --git a/docs/install.md b/docs/install.md index cc5c0a5..d5bb299 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,6 +1,8 @@ # Getting started -Let's get started.... +GHCup makes it easy to install specific versions of GHC on GNU/Linux, +macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh [Haskell developer environment](./install/#supported-tools) from scratch. +It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well). Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [pyenv](https://github.com/pyenv/pyenv) and [jenv](http://www.jenv.be). ## Installation @@ -20,7 +22,9 @@ For Windows, run this in a PowerShell session: Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true ``` -Advanced users may want to perform a [manual installation](#manual-install) and GPG verify the binaries. +If you want to know what these scripts do, check out the [source code at the repository](https://gitlab.haskell.org/haskell/ghcup-hs/-/tree/master/scripts/bootstrap). Advanced users may want to perform a [manual installation](#manual-install) and GPG verify the binaries. + +**Advice: Make sure to check out the [Haskell documentation](https://www.haskell.org/documentation/) after installation.** ## Supported tools @@ -98,4 +102,3 @@ export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH" ## Vim integration See [ghcup.vim](https://github.com/hasufell/ghcup.vim). - diff --git a/docs/irc.svg b/docs/irc.svg new file mode 100644 index 0000000..5660201 --- /dev/null +++ b/docs/irc.svg @@ -0,0 +1,38 @@ + + + + + + diff --git a/docs/javascripts/extra.js b/docs/javascripts/extra.js index 15c6c58..ca3b73e 100644 --- a/docs/javascripts/extra.js +++ b/docs/javascripts/extra.js @@ -1,3 +1,93 @@ +var platforms = ["win", "unix"]; +var platform_override = null; + +function detect_platform() { + "use strict"; + + if (platform_override !== null) { + return "unknown"; + } + + var os = "unknown"; + + if (navigator.platform == "Linux x86_64") {os = "unix";} + if (navigator.platform == "Linux i686") {os = "unix";} + if (navigator.platform == "Linux i686 on x86_64") {os = "unix";} + if (navigator.platform == "Linux aarch64") {os = "unix";} + if (navigator.platform == "Linux armv6l") {os = "unix";} + if (navigator.platform == "Linux armv7l") {os = "unix";} + if (navigator.platform == "Linux armv8l") {os = "unix";} + if (navigator.platform == "Linux ppc64") {os = "unix";} + if (navigator.platform == "Linux mips") {os = "unix";} + if (navigator.platform == "Linux mips64") {os = "unix";} + if (navigator.platform == "Mac") {os = "unix";} + if (navigator.platform == "Win32") {os = "win";} + if (navigator.platform == "Win64" || + navigator.userAgent.indexOf("WOW64") != -1 || + navigator.userAgent.indexOf("Win64") != -1) {os = "win";} + if (navigator.platform == "FreeBSD x86_64") {os = "unix";} + if (navigator.platform == "FreeBSD amd64") {os = "unix";} + // if (navigator.platform == "NetBSD x86_64") {os = "unix";} + // if (navigator.platform == "NetBSD amd64") {os = "unix";} + + // I wish I knew by now, but I don't. Try harder. + if (os == "unknown") { + if (navigator.appVersion.indexOf("Win")!=-1) {os = "win";} + if (navigator.appVersion.indexOf("Mac")!=-1) {os = "unix";} + if (navigator.appVersion.indexOf("FreeBSD")!=-1) {os = "unix";} + } + + // Firefox Quantum likes to hide platform and appVersion but oscpu works + if (navigator.oscpu) { + if (navigator.oscpu.indexOf("Win32")!=-1) {os = "win";} + if (navigator.oscpu.indexOf("Win64")!=-1) {os = "win";} + if (navigator.oscpu.indexOf("Mac")!=-1) {os = "unix";} + if (navigator.oscpu.indexOf("Linux")!=-1) {os = "unix";} + if (navigator.oscpu.indexOf("FreeBSD")!=-1) {os = "unix";} + // if (navigator.oscpu.indexOf("NetBSD")!=-1) {os = "unix";} + } + + return os; +} + +function adjust_for_platform() { + "use strict"; + + var platform = detect_platform(); + + if (platforms.includes(platform)) { + platforms.forEach(function (platform_elem) { + var platform_div = document.getElementById("ghcup-instructions-" + platform_elem); + platform_div.style.display = "none"; + if (platform == platform_elem) { + platform_div.style.display = "block"; + } + }); + } +} + + +function show_all_platforms() { + platforms.forEach(function (platform_elem) { + var platform_div = document.getElementById("ghcup-instructions-" + platform_elem); + platform_div.style.display = "block"; + }); + + var buttons = document.getElementsByClassName("show-all-platforms"); + console.log(buttons); + Array.from(buttons).forEach(function (button) { + button.style.display = "none"; + }); + +} + +function set_up_default_platform_buttons() { + var defaults_buttons = document.getElementsByClassName('show-all-platforms-button'); + for (var i = 0; i < defaults_buttons.length; i++) { + defaults_buttons[i].onclick = show_all_platforms; + } +} + function copyToClipboardNux() { const text = document.getElementById("ghcup-command-linux").innerText; const el = document.createElement('textarea'); @@ -21,3 +111,9 @@ function copyToClipboardWin() { const button = document.getElementById("ghcup-windows-button"); button.focus(); } + +(function () { + adjust_for_platform(); + set_up_default_platform_buttons(); +}()); +