mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Merge branch 'sunface:master' into master
This commit is contained in:
@ -1 +1 @@
|
||||
practice.rs
|
||||
practice.course.rs
|
@ -1,26 +0,0 @@
|
||||
(function () {
|
||||
var path = window.location.pathname;
|
||||
var link = "https://practice.rs" + path;
|
||||
var word = "English";
|
||||
var lang = "zh-CN";
|
||||
var changeLang = "切换到英语";
|
||||
|
||||
if (window.location.href.indexOf("zh.") == -1) {
|
||||
link = "https://zh.practice.rs" + path;
|
||||
word = "简体中文";
|
||||
lang = "en";
|
||||
changeLang = "Switch to Chinese"
|
||||
}
|
||||
|
||||
var lang_node = '';
|
||||
if (link != '') {
|
||||
lang_node = '<a href="' + link + '" title="' + changeLang + '" aria-label="' + changeLang + '"><i id="change-language-button" class="fa fa-language"> ' + word + '</i></a>';
|
||||
}
|
||||
|
||||
console.log(lang_node)
|
||||
var insertNode = document.getElementsByClassName('right-buttons');
|
||||
if (insertNode.length > 0) {
|
||||
var html = insertNode[0].innerHTML;
|
||||
insertNode[0].innerHTML = html + lang_node;
|
||||
}
|
||||
})()
|
35
en/assets/lang1.js
Normal file
35
en/assets/lang1.js
Normal file
@ -0,0 +1,35 @@
|
||||
(function () {
|
||||
var path = window.location.pathname;
|
||||
var link = "https://practice.course.rs" + path;
|
||||
var word = "English";
|
||||
var lang = "zh-CN";
|
||||
var changeLang = "切换到英语";
|
||||
|
||||
if (window.location.href.indexOf("zh.") == -1) {
|
||||
link = "https://practice-zh.course.rs" + path;
|
||||
word = "简体中文";
|
||||
lang = "en";
|
||||
changeLang = "Switch to Chinese";
|
||||
}
|
||||
|
||||
var lang_node = "";
|
||||
if (link != "") {
|
||||
lang_node =
|
||||
'<a href="' +
|
||||
link +
|
||||
'" title="' +
|
||||
changeLang +
|
||||
'" aria-label="' +
|
||||
changeLang +
|
||||
'"><i id="change-language-button" class="fa fa-language"> ' +
|
||||
word +
|
||||
"</i></a>";
|
||||
}
|
||||
|
||||
console.log(lang_node);
|
||||
var insertNode = document.getElementsByClassName("right-buttons");
|
||||
if (insertNode.length > 0) {
|
||||
var html = insertNode[0].innerHTML;
|
||||
insertNode[0].innerHTML = html + lang_node;
|
||||
}
|
||||
})();
|
@ -14,9 +14,9 @@ level = 1
|
||||
|
||||
[output.html]
|
||||
additional-css = ["theme/style1.css"]
|
||||
additional-js = ["assets/custom3.js","assets/lang.js"]
|
||||
additional-js = ["assets/custom3.js", "assets/lang1.js"]
|
||||
git-repository-url = "https://github.com/sunface/rust-by-practice"
|
||||
edit-url-template = "https://github.com/sunface/rust-by-practice/edit/master/en/{path}"
|
||||
|
||||
[rust]
|
||||
edition = "2021"
|
||||
edition = "2021"
|
||||
|
@ -24,7 +24,7 @@ Tutorial [`https://www.flenker.blog/hecto/`](https://www.flenker.blog/hecto/) wi
|
||||
[This project](https://github.com/kyclark/command-line-rust) is for the book `Command-Line Rust(O'Reily)`, it will show you how to write small CLIs (clones of `head`, `cat`, `ls`).
|
||||
|
||||
### 5. pngme book
|
||||
[This book](https://picklenerd.github.io/pngme_book/) will guide you to make a command line program that lets you hide secret messages in PNG files. The primary goal here is to get you writing code. The secondary goal is to get you reading documentation.
|
||||
[This book](https://jrdngr.github.io/pngme_book/) will guide you to make a command line program that lets you hide secret messages in PNG files. The primary goal here is to get you writing code. The secondary goal is to get you reading documentation.
|
||||
|
||||
### 6. Writing an OS in Rust
|
||||
|
||||
@ -40,7 +40,7 @@ On [CodeCrafters](https://codecrafters.io/for/rust), you can recreate your favor
|
||||
|
||||
### 9. Writing Interpreters in Rust
|
||||
|
||||
[This online book](https://github.com/rust-hosted-langs/book) will walk through the basics of interpreted language implementation in Rust with a focus on the challenges that are specific to using Rust.
|
||||
[This online book](https://rust-hosted-langs.github.io/book/) will walk through the basics of interpreted language implementation in Rust with a focus on the challenges that are specific to using Rust.
|
||||
|
||||
---
|
||||
|
||||
|
Reference in New Issue
Block a user