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..4ce5518 100644 --- a/docs/css/extra.css +++ b/docs/css/extra.css @@ -1,202 +1,206 @@ h2 { - border-bottom:1px solid #CCC; - padding-bottom:5px; - padding-top:15px; + border-bottom:1px solid #CCC; + padding-bottom:5px; + padding-top:15px; } h1 { - text-align: center; - font-size: 60px; - font-weight: 300; - padding-top:15px; + text-align: center; + font-size: 60px; + font-weight: 300; + padding-top:15px; } h3 { - font-size: 30px; - padding-top:10px; + font-size: 30px; + padding-top:10px; } h4 { - font-size: 25px; - padding-top:10px; + font-size: 25px; + padding-top:10px; } +.index-ghcup-hero { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.index-ghcup-hero img { + width: 10%; + min-width: 110px; + max-width: 120px; + border: none; + margin: 0; +} + +.index-ghcup-hero h1 { +} div.col-md-9 h1:first-of-type { - text-align: center; - font-size: 60px; - font-weight: 300; + text-align: center; + font-size: 60px; + font-weight: 300; } div.col-md-9>p:first-of-type { - text-align: center; + text-align: center; } div.col-md-9 p.admonition-title:first-of-type { - text-align: left; + text-align: left; } div.col-md-9 h1:first-of-type .headerlink { - display: none; + display: none; } code.no-highlight { - color: black; + color: black; } div.gh-badge img { - margin: 0; - padding: 0; - height: 25px; -} - -a.donate-badge img { - margin-top: 10px; - margin-bottom: 0; - padding: 0; - height: 35px; -} - -@media only screen and (min-width: 1000px) { - a.donate-badge img { - margin-top: 0; - } + margin: 0; + padding: 0; + height: 25px; } /* Definition List styles */ dd { - padding-left: 20px; + padding-left: 20px; } /* Homepage */ body.homepage div.jumbotron { - margin-top: 1.5rem; - padding-top: 1rem; - padding-bottom: 0; + margin-top: 1.5rem; + padding-top: 1rem; + padding-bottom: 0; } body.homepage div.jumbotron div.card { - margin-bottom: 2rem; + margin-bottom: 2rem; } body.homepage>div.container div.col-md-3 { - display: none; + display: none; } body.homepage>div.container div.col-md-9 { - /* margin-left: 0; */ - /* padding-left: 0; */ - flex: 0 0 100%; - max-width: 100%; + /* margin-left: 0; */ + /* padding-left: 0; */ + flex: 0 0 100%; + max-width: 100%; } .center { - display: block !important; + display: block !important; } .bg-primary { - background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; - background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; - background-repeat: no-repeat !important; + background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; + background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; + background-repeat: no-repeat !important; } .btn-primary { - background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; - background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; - background-repeat: no-repeat !important; + background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; + background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; + background-repeat: no-repeat !important; - color: #fff; - background-color: #996FC1; - border-color: #996FC1; + color: #fff; + background-color: #996FC1; + border-color: #996FC1; - border-bottom: 1px solid #453A62; + border-bottom: 1px solid #453A62; } .navbar { - background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; - background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; - background-repeat: no-repeat !important; + background-image: -webkit-gradient(linear, left top, left bottom, from(#996FC2), color-stop(60%, #6A478D), to(#5E5086)) !important; + background-image: linear-gradient(#996FC2, #6A478D 60%, #5E5086) !important; + background-repeat: no-repeat !important; - color: #fff; - background-color: #996FC1; - border-color: #996FC1; + color: #fff; + background-color: #996FC1; + border-color: #996FC1; - border-bottom: 1px solid #453A62; + border-bottom: 1px solid #453A62; } a { - color: #996FC2; + color: #996FC2; } a:hover { - color: #674489; + color: #674489; } .col-md-9 img.main-logo { - border: 0px; - padding: 0px; - margin: 0px; + border: 0px; + padding: 0px; + margin: 0px; } .navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:hover, .navbar-default .navbar-nav>.active>a:focus { - color: #fff; - background-color: #453A62; - border-color: #996FC1; + color: #fff; + background-color: #453A62; + border-color: #996FC1; } .navbar-default .navbar-nav>li>a:hover, .navbar-default .navbar-nav>li>a:focus { - color: #fff; - background-color: #453A62; + color: #fff; + background-color: #453A62; } .ghcup-intro { - text-align: center; + text-align: center; } .main-buttons { - display: flex; - align-items: center; - flex-wrap: wrap; - justify-content: center; + display: flex; + align-items: center; + flex-wrap: wrap; + justify-content: center; } .main-buttons a { - margin-right: 5px; - margin-bottom: 5px; + margin-right: 5px; + margin-bottom: 5px; } .command-button { - display: flex; - align-items: center; + display: flex; + align-items: center; } .command-button > pre { - flex: 0 1 80%; - margin: 0; - padding: 10px; - text-align: center; - background-color: #515151; - color: white; - border-radius: 3px; - box-shadow: inset 0px 0px 20px 0px #333333; - font-size: 1em; - white-space: nowrap; - overflow: auto; + flex: 0 1 80%; + margin: 0; + padding: 10px; + text-align: center; + background-color: #515151; + color: white; + border-radius: 3px; + box-shadow: inset 0px 0px 20px 0px #333333; + font-size: 1em; + white-space: nowrap; + overflow: auto; } .ghcup-command:before { - color: #999; - content: " $ "; - margin-left: 15px; + color: #999; + content: " $ "; + margin-left: 15px; } div.command-button { - display: flex; - align-items: center; - justify-content: center; + display: flex; + align-items: center; + justify-content: center; } .command-button pre { @@ -204,48 +208,129 @@ div.command-button { } div.command-button button { - color: #515151; - background: rgb(230, 230, 230); - border: 1px solid grey; - margin: 0 0 0 10px; - padding: 10px; - flex-basis: 0 0 20%; + color: #515151; + background: rgb(230, 230, 230); + border: 1px solid grey; + margin: 0 0 0 10px; + padding: 10px; + flex-basis: 0 0 20%; } div.command-button button .fa { - font-size: x-large; + font-size: x-large; } div.command-button button:hover { - background: rgb(220, 220, 220); - color: black; - border: 1px solid black; + background: rgb(220, 220, 220); + color: black; + border: 1px solid black; } div.command-button button:focus { - background-color: #04aa6d; + background-color: #04aa6d; } footer > hr { - border-top: 0.5px solid #CCC; + border-top: 0.5px solid #CCC; } .qi-container { - display: flex; - flex-direction: column; - align-items: center; + display: flex; + flex-direction: column; + align-items: center; + box-sizing: border-box; + padding: 0.75rem; + 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: + 4px 8px 10px -6px rgb(204, 204, 204), + 4px 8px 10px -6px rgb(153, 111, 194); +} + +@media only screen and (max-width:1000px) { + .qi-container { + box-shadow: + 4px 10px 10px -6px rgb(204, 204, 204), + 4px 10px 10px -9px rgb(153, 111, 194); + } +} + +.index-cta-donate .donate-button a { + position: absolute; + top:0; + left: 0; + width: 100%; + height: 100%; +} + +.index-cta-donate .donate-button { + margin: 10px auto; + position: relative; + display: block; + background: none; + padding: none; + border: none; + background: url("https://opencollective.com/webpack/donate/button@2x.png?color=blue"); + width: 35%; + min-width: 240px; + max-width: 280px; + height: 40px; + background-size: contain; + background-repeat: no-repeat; } .ghcup-os-container { - width: 100%; - margin: 10px 0; + width: 100%; + margin: 10px 0; } .ghcup-os-container > * { - text-align: center; + text-align: center; } /* fix list overflows (esp about page) */ ul > li { - overflow-wrap: anywhere; + 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; +} + +#help img { + border: none; + margin: 0px; + height: 24px; +} + +#collective img { + border: none; + margin: 0px; +} + +#collective { + margin-top: 10px; } diff --git a/docs/dev.md b/docs/dev.md index 2f3e240..79f2318 100644 --- a/docs/dev.md +++ b/docs/dev.md @@ -76,7 +76,7 @@ Some light suggestions: ### Adding a new CLI command -An example illustration on how to deal with [optparse-applicative](https://hackage.haskell.org/package/optparse-applicative) can be seen here: https://gitlab.haskell.org/haskell/ghcup-hs/-/commit/c19dd5ee8b2edbaf0336af143f1c75b6f4843e26 +An example illustration on how to deal with [optparse-applicative](https://hackage.haskell.org/package/optparse-applicative) can be seen here: [https://gitlab.haskell.org/haskell/ghcup-hs/-/commit/c19dd5ee8b2edbaf0336af143f1c75b6f4843e26](https://gitlab.haskell.org/haskell/ghcup-hs/-/commit/c19dd5ee8b2edbaf0336af143f1c75b6f4843e26) ## Major refactors diff --git a/docs/guide.md b/docs/guide.md index 98e07d2..7bef29c 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -199,7 +199,7 @@ For the full list of env variables and parameters to tweak the script behavior, ### Example github workflow -On github workflows you can use https://github.com/haskell/actions/ +On github workflows you can use [https://github.com/haskell/actions/](https://github.com/haskell/actions/) If you want to install ghcup manually though, here's an example config: diff --git a/docs/index.md b/docs/index.md index 3062982..6da801e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,39 +8,24 @@ hide: -# ![](./haskell_logo.png){: .main-logo style="width:100px"} GHCup +
+ haskell logo +

GHCup

+

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 +34,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 +50,28 @@ It follows the unix UNIX philosophy of [do one thing and do it well](https://en.
         
+
+ +
+ +
+ +---- + +![GHCup](./ghcup.gif){: .center style="width:700px"} + +

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

+ + diff --git a/docs/install.md b/docs/install.md index cc5c0a5..49fe10b 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 @@ -57,8 +61,8 @@ This list may not be exhaustive and specifies support for bindists only. May or may not work, several issues: -* https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/140 -* https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/197 +* [https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/140](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/140) +* [https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/197](https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/197) ### WSL1 @@ -99,3 +103,10 @@ export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH" See [ghcup.vim](https://github.com/hasufell/ghcup.vim). +## Get help + +* [Libera IRC chat on #haskell-ghcup or #haskell](https://kiwiirc.com/nextclient/irc.libera.chat/?nick=Guest%7C?#haskell,#haskell-ghcup) +* [GHCup issue tracker](https://gitlab.haskell.org/haskell/ghcup-hs/issues) +* [Matrix](https://app.element.io/#/room/#haskell-tooling:matrix.org) +* [Discord](https://discord.gg/pKYf3zDQU7) + 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(); +}()); + diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 7146720..c8c20b1 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -157,6 +157,8 @@ _done() { green "open the \"Mingw haskell shell\"" green "and the \"Mingw package management docs\"" green "desktop shortcuts." + green + green "If you are net to Haskell, check out https://www.haskell.org/documentation/" ;; *) green @@ -170,6 +172,8 @@ _done() { green green "To install other GHC versions and tools, run:" green " ghcup tui" + green + green "If you are net to Haskell, check out https://www.haskell.org/documentation/" ;; esac