Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
add: prismjs && small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SvMak authored and marc0der committed Aug 7, 2024
1 parent 7b0a42f commit 062523c
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 81 deletions.
5 changes: 2 additions & 3 deletions app/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ body {
}

pre {
background-color: var(--card-bg);
padding: 16px;
background-color: var(--card-bg) !important;
border-radius: 8px;
margin: 16px 0;
margin: 1rem 0 !important;
}

.swiper-button-prev, .swiper-button-next {
Expand Down
12 changes: 12 additions & 0 deletions app/assets/js/switch-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,23 @@
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}

const setPrismjsTheme = theme => {
const link = document.getElementById('prism-theme')

if (link) {
const href = `/assets/css/prism${theme === 'dark' ? '-dark' : ''}.min.css`

link.setAttribute('href', href)
}
}

const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
setPrismjsTheme('dark')
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
setPrismjsTheme(theme)
}
}

Expand Down
1 change: 1 addition & 0 deletions app/views/includes/header.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<!-- Assets -->
<link href='@routes.Assets.at("/img/favicon.ico")' type='image/x-ico' rel='icon'/>
<link rel='stylesheet' type='text/css' href='@routes.Assets.at("css/bootstrap.min.css")'/>
<link id="prism-theme" rel='stylesheet' type='text/css' href='@routes.Assets.at("css/prism.min.css")'/>
<link rel='stylesheet' type='text/css' href='@routes.Assets.at("css/main.css")'/>
<link rel='stylesheet' type='text/css' href='@routes.Assets.at("css/carbon.css")'/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@@11/swiper-bundle.min.css"/>
Expand Down
1 change: 1 addition & 0 deletions app/views/includes/scripts.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<script src="https://cdn.jsdelivr.net/npm/swiper@@11/swiper-bundle.min.js"></script>
<script src='@routes.Assets.at("js/swiper-settings.js")' defer></script>
<script src='@routes.Assets.at("js/plugins.js")' defer></script>
<script src='@routes.Assets.at("js/vendor/prism.min.js")'></script>
@includes.statuspage()
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down
30 changes: 15 additions & 15 deletions app/views/install.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ <h1>Installation</h1>
WSL).
Plus, it's compatible with both Bash and ZSH shells.</p>
<p>Just launch a new terminal and type in:</p>
<pre><code>$ curl -s "https://get.sdkman.io" | bash</code></pre>
<pre class="language-shell"><code>$ curl -s "https://get.sdkman.io" | bash</code></pre>
<p>Follow the on-screen instructions to wrap up the installation. Afterward, open a new terminal or run
the following in the same shell:</p>
<pre><code>$ source "$HOME/.sdkman/bin/sdkman-init.sh"</code></pre>
<pre class="language-shell"><code>$ source "$HOME/.sdkman/bin/sdkman-init.sh"</code></pre>
<p>Lastly, run the following snippet to confirm the installation's success:</p>
<pre><code>$ sdk version</code></pre>
<pre class="language-shell"><code>$ sdk version</code></pre>
<p>You should see output containing the latest script and native versions:</p>
<pre><code>SDKMAN!
<pre class="language-shell"><code>SDKMAN!
script: @scriptCliVersion
native: @nativeCliVersion</code></pre>

<h3>Windows installation</h3>
<h2>Windows installation</h2>
<p>For Windows, there are two installation routes:</p>
<ol>
<li><strong>WSL Approach:</strong> Install Windows Subsystem for Linux (WSL) before attempting
Expand All @@ -32,43 +32,43 @@ <h3>Windows installation</h3>
<p><i>Remember, SDKMAN requires a bash environment to run. On Windows, it can't be natively installed;
you need WSL or MSYS+MinGW. We no longer support Cygwin.</p></i>

<h3>Beta channel</h3>
<h2>Beta channel</h2>
<p>Feeling adventurous? We've got a beta channel. New CLI features hit this channel first for trial. You
can join by installing it directly:</p>
<pre><code>$ curl -s "https://beta.sdkman.io" | bash</code></pre>
<pre class="language-shell"><code>$ curl -s "https://beta.sdkman.io" | bash</code></pre>
<p>To leave the beta channel, simply set <code>sdkman_beta_channel</code> to <code>false</code> in
<code>~/.sdkman/etc/config</code>, then run:
</p>
<pre><code>$ sdk selfupdate force</code></pre>
<pre class="language-shell"><code>$ sdk selfupdate force</code></pre>

<h3>Uninstallation</h3>
<h2>Uninstallation</h2>
<p>Here is how you go about removing SDKMAN! from your system:</p>
<ol>
<li>Optionally backup and then remove the installation:</li>
<pre><code>$ tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman
<pre class="language-shell"><code>$ tar zcvf ~/sdkman-backup_$(date +%F-%kh%M).tar.gz -C ~/ .sdkman
$ rm -rf ~/.sdkman</code></pre>
<li>Remove initialization snippet from your shell configs.</li>
Edit and remove the initialisation snippet from your
<code>.bashrc</code>, <code>.bash_profile</code> and/or <code>.profile</code>
files. If you use ZSH, remove it from the <code>.zshrc</code> file. The snippet
of code to be removed looks something like this:
<pre><code>#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
<pre class="language-shell"><code>#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "/home/dudette/.sdkman/bin/sdkman-init.sh" ]] && source "/home/dudette/.sdkman/bin/sdkman-init.sh"</code></pre>
Once removed, you have successfully uninstalled SDKMAN! from your machine.
</ol>

<h3>Install to a custom location</h3>
<h2>Install to a custom location</h2>
<p>Lastly, if you want to install SDKMAN! in a custom location, like <code>/usr/local/sdkman</code>,
make sure you have full access rights and that the folder doesn't exist. Export
<code>SDKMAN_DIR</code> before installing:
</p>
<pre><code>$ export SDKMAN_DIR="/usr/local/sdkman" &amp;&amp; curl -s "https://get.sdkman.io" | bash</code></pre>
<pre class="language-shell"><code>$ export SDKMAN_DIR="/usr/local/sdkman" &amp;&amp; curl -s "https://get.sdkman.io" | bash</code></pre>

<h3>Install without modifying shell config</h3>
<h2>Install without modifying shell config</h2>
<p>And for installs on CI where shell config modification isn't appropriate, add
<code>rcupdate=false</code>
as a parameter when downloading the installer:</p>
<pre><code>$ curl -s "https://get.sdkman.io?rcupdate=false" | bash</code></pre>
<pre class="language-shell"><code>$ curl -s "https://get.sdkman.io?rcupdate=false" | bash</code></pre>

<p>That's all there is to it! Now let's dive into <a href='/usage'>Usage</a>.</p>
}
Loading

0 comments on commit 062523c

Please sign in to comment.