Skip to content

Commit

Permalink
Deploying to gh-pages from @ 175294f 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
mo8it committed Aug 2, 2024
0 parents commit 0830d0f
Show file tree
Hide file tree
Showing 35 changed files with 6,431 additions and 0 deletions.
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rustlings.cool
245 changes: 245 additions & 0 deletions artifacts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
/* Code modified from the blender website
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
*/

let options = {
windows64: "x86_64-pc-windows",
windows32: "i686-pc-windows",
windowsArm: "aarch64-pc-windows",

mac64: "x86_64-apple",
mac32: "i686-apple",
macSilicon: "aarch64-apple",

linux64: "x86_64-unknown-linux",
linux32: "i686-unknown-linux",
linuxArm: "aarch64-unknown-linux",

// ios: "ios",
// android: "linux-android",
// freebsd: "freebsd",
};

function isAppleSilicon() {
try {
var glcontext = document.createElement("canvas").getContext("webgl");
var debugrenderer = glcontext
? glcontext.getExtension("WEBGL_debug_renderer_info")
: null;
var renderername =
(debugrenderer &&
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
"";
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
return true;
}

return false;
} catch (e) {}
}

function getOS() {
var OS = options.windows64.default;
var userAgent = navigator.userAgent;
var platform = navigator.platform;

if (navigator.appVersion.includes("Win")) {
if (
!userAgent.includes("Windows NT 5.0") &&
!userAgent.includes("Windows NT 5.1") &&
(userAgent.indexOf("Win64") > -1 ||
platform == "Win64" ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("x86_64") > -1 ||
userAgent.indexOf("amd64") > -1 ||
userAgent.indexOf("AMD64") > -1 ||
userAgent.indexOf("WOW64") > -1)
) {
OS = options.windows64;
} else {
if (
window.external &&
window.external.getHostEnvironmentValue &&
window.external
.getHostEnvironmentValue("os-architecture")
.includes("ARM64")
) {
OS = options.windowsArm;
} else {
try {
var canvas = document.createElement("canvas");
var gl = canvas.getContext("webgl");

var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
} catch (e) {}
}
}
}

//MacOS, MacOS X, macOS
if (navigator.appVersion.includes("Mac")) {
if (
navigator.userAgent.includes("OS X 10.5") ||
navigator.userAgent.includes("OS X 10.6")
) {
OS = options.mac32;
} else {
OS = options.mac64;

const isSilicon = isAppleSilicon();
if (isSilicon) {
OS = options.macSilicon;
}
}
}

// linux
if (platform.includes("Linux")) {
OS = options.linux64;
// FIXME: Can we find out whether linux 32-bit or ARM are used?
}

// if (
// userAgent.includes("iPad") ||
// userAgent.includes("iPhone") ||
// userAgent.includes("iPod")
// ) {
// OS = options.ios;
// }
// if (platform.toLocaleLowerCase().includes("freebsd")) {
// OS = options.freebsd;
// }

return OS;
}

let os = getOS();
window.os = os;

// Unhide and hydrate selector with events
const archSelect = document.querySelector(".arch-select");
if (archSelect) {
archSelect.classList.remove("hidden");
const selector = document.querySelector("#install-arch-select");
if (selector) {
selector.addEventListener("change", onArchChange);
}
}

// Hydrate tab buttons with events
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
tab.addEventListener("click", onTabClick);
});

function onArchChange(evt) {
// Get target
const target = evt.currentTarget.value;
// Find corresponding installer lists
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
// Hide old content element (if applicable)
if (oldContentEl) {
oldContentEl.classList.add("hidden");
}
// Show new content element
newContentEl.classList.remove("hidden");
// Show the first tab's content if nothing was selected before
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
}
// Hide "no OS detected" message
const noDetectEl = document.querySelector(".no-autodetect");
noDetectEl.classList.add("hidden");
// Hide Mac hint
document.querySelector(".mac-switch").classList.add("hidden");
}

function onTabClick(evt) {
// Get target and ID
const {triple, id} = evt.currentTarget.dataset;
if (triple) {
// Find corresponding content elements
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
// Find old tab to unselect
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
// Hide old content element
if (oldContentEl && oldTabEl) {
oldContentEl.classList.add("hidden");
oldTabEl.classList.remove("selected");
}

// Unhide new content element
newContentEl.classList.remove("hidden");
// Select new tab element
evt.currentTarget.classList.add("selected");
}
}

const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
let hit = allPlatforms.find(
(a) => {
// Show Intel Mac downloads if no M1 Mac downloads are available
if (
a.attributes["data-arch"].value.includes(options.mac64) &&
os.includes(options.macSilicon) &&
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
// Unhide hint
document.querySelector(".mac-switch").classList.remove("hidden");
return true;
}
return a.attributes["data-arch"].value.includes(os);
}
);

if (hit) {
hit.classList.remove("hidden");
const selectEl = document.querySelector("#install-arch-select");
selectEl.value = hit.dataset.arch;
const firstContentChild = hit.querySelector(".install-content:first-of-type");
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
firstContentChild.classList.remove("hidden");
if (firstTabChild) {
firstTabChild.classList.add("selected");
}
} else {
const noDetectEl = document.querySelector(".no-autodetect");
if (noDetectEl) {
const noDetectElDetails = document.querySelector(".no-autodetect-details");
if (noDetectElDetails) {
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
}
noDetectEl.classList.remove("hidden");
}
}

let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
if (copyButtons.length) {
copyButtons.forEach(function (element) {
element.addEventListener("click", () => {
navigator.clipboard.writeText(element.attributes["data-copy"].value);
});
});
}

// Toggle for pre releases
const checkbox = document.getElementById("show-prereleases");

if (checkbox) {
checkbox.addEventListener("click", () => {
const all = document.getElementsByClassName("pre-release");

if (all) {
for (var item of all) {
item.classList.toggle("hidden");
}
}
});
}
141 changes: 141 additions & 0 deletions changelog/2.0.0/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<!DOCTYPE html>
<html lang="en" id="oranda" class="dark">
<head>
<title>rustlings</title>

<meta property="og:url" content="https://rustlings.cool" />


<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<meta name="description" content="Small exercises to get you used to reading and writing Rust code!" />
<meta property="og:description" content="Small exercises to get you used to reading and writing Rust code!" />

<meta property="og:type" content="website" />
<meta property="og:title" content="rustlings" />



<meta http-equiv="Permissions-Policy" content="interest-cohort=()" />
<link rel="stylesheet" href="/oranda-v0.3.1.css" />


</head>
<body>
<div class="container">
<div class="page-body">

<div class="repo_banner">
<a href="https://github.com/rust-lang/rustlings">
<div class="github-icon" aria-hidden="true"></div>
Check out our GitHub!
</a>
</div>


<main>
<header>

<h1 class="title">rustlings</h1>

<nav class="nav">
<ul>
<li><a href="/">Home</a></li>










<li><a href="/changelog/">Changelog</a></li>

</ul>
</nav>

</header>


<div>
<h1>2.0.0</h1>
<div class="releases-body">


<section class="release ">

<div class="release-info">
<span class="flex items-center gap-2">
<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'>
<path stroke-linecap='round' stroke-linejoin='round' d='M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z' />
<path stroke-linecap='round' stroke-linejoin='round' d='M6 6h.008v.008H6V6z' /></svg>
2.0.0
</span>
<span class="flex items-center gap-2">

<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-6 h-6'><path stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5' /></svg>
Nov 12 2019 at 11:26 UTC

</span>
</div>
<div class="release-body">
<h4>Bug Fixes</h4>
<ul>
<li><strong>default:</strong> Clarify the installation procedure (<a href="https://github.com/rust-lang/rustlings/commit/c371b853afa08947ddeebec0edd074b171eeaae0" rel="noopener noreferrer">c371b853</a>)</li>
<li><strong>info:</strong> Fix trailing newlines for hints (<a href="https://github.com/rust-lang/rustlings/commit/795b6e348094a898e9227a14f6232f7bb94c8d31" rel="noopener noreferrer">795b6e34</a>)</li>
<li><strong>run:</strong> make <code>run</code> never prompt (<a href="https://github.com/rust-lang/rustlings/commit/4b26546589f7d2b50455429482cf1f386ceae8b3" rel="noopener noreferrer">4b265465</a>)</li>
</ul>
<h4>Breaking Changes</h4>
<ul>
<li>Refactor hint system (<a href="https://github.com/rust-lang/rustlings/commit/9bdb0a12e45a8e9f9f6a4bd4a9c172c5376c7f60" rel="noopener noreferrer">9bdb0a12</a>)</li>
<li>improve <code>watch</code> execution mode (<a href="https://github.com/rust-lang/rustlings/commit/2cdd61294f0d9a53775ee24ad76435bec8a21e60" rel="noopener noreferrer">2cdd6129</a>)</li>
<li>Index exercises by name (<a href="https://github.com/rust-lang/rustlings/commit/627cdc07d07dfe6a740e885e0ddf6900e7ec336b" rel="noopener noreferrer">627cdc07</a>)</li>
<li><strong>run:</strong> makes <code>run</code> never prompt (<a href="https://github.com/rust-lang/rustlings/commit/4b26546589f7d2b50455429482cf1f386ceae8b3" rel="noopener noreferrer">4b265465</a>)</li>
</ul>
<h4>Features</h4>
<ul>
<li><strong>cli:</strong> check for rustc before doing anything (<a href="https://github.com/rust-lang/rustlings/commit/36a033b87a6549c1e5639c908bf7381c84f4f425" rel="noopener noreferrer">36a033b8</a>)</li>
<li><strong>hint:</strong> Add test for hint (<a href="https://github.com/rust-lang/rustlings/commit/ce9fa6ebbfdc3e7585d488d9409797285708316f" rel="noopener noreferrer">ce9fa6eb</a>)</li>
</ul>
<p><a rel="noopener noreferrer"></a></p>
<h3>1.5.1 (2019-11-11)</h3>
<h4>Bug Fixes</h4>
<ul>
<li><strong>errors3:</strong> Update hint (<a href="https://github.com/rust-lang/rustlings/commit/dcfb427b09585f0193f0a294443fdf99f11c64cb" rel="noopener noreferrer">dcfb427b</a>, closes <a href="https://github.com/rust-lang/rustlings/issues/185" rel="noopener noreferrer">#185</a>)</li>
<li><strong>if1:</strong> Remove <code>return</code> reference (<a href="https://github.com/rust-lang/rustlings/commit/ad03d180c9311c0093e56a3531eec1a9a70cdb45" rel="noopener noreferrer">ad03d180</a>)</li>
<li><strong>strings:</strong> Move Strings before Structs (<a href="https://github.com/rust-lang/rustlings/commit/6dcecb38a4435593beb87c8e12d6314143631482" rel="noopener noreferrer">6dcecb38</a>, closes <a href="https://github.com/rust-lang/rustlings/issues/204" rel="noopener noreferrer">#204</a>)</li>
<li><strong>structs1:</strong> Remove misleading comment (<a href="https://github.com/rust-lang/rustlings/commit/f72e5a8f05568dde04eaeac10b9a69872f21cb37" rel="noopener noreferrer">f72e5a8f</a>)</li>
<li><strong>threads:</strong> Move Threads behind SLT (<a href="https://github.com/rust-lang/rustlings/commit/fbe91a67a482bfe64cbcdd58d06ba830a0f39da3" rel="noopener noreferrer">fbe91a67</a>, closes <a href="https://github.com/rust-lang/rustlings/issues/205" rel="noopener noreferrer">#205</a>)</li>
<li><strong>watch:</strong> clear screen before each <code>verify()</code> (<a href="https://github.com/rust-lang/rustlings/commit/3aff59085586c24196a547c2693adbdcf4432648" rel="noopener noreferrer">3aff590</a>)</li>
</ul>
<p><a rel="noopener noreferrer"></a></p>

</div>
</section>
</div>
</div>

</main>
</div>

<footer>

<a href="https://github.com/rust-lang/rustlings"><div class="github-icon" aria-hidden="true"></div></a>

<span>
rustlings, MIT
</span>
</footer>
</div>


<script defer="true" data-domain="rustlings.cool" src="https://plausible.io/js/script.js"></script>




</body>
</html>
Loading

0 comments on commit 0830d0f

Please sign in to comment.