, July 27, 2024

Các element blog content

👌
List vài element mới (Ghost 5.x) và tips/tricts thôi nhé anh em, còn lại cứ dùng trong bộ editor nhé.

Các đầu mục H2->H6

Ở đầu dòng gõ liên tiếp các ký tự # rồi space. Lưu ý không dùng H1. VD ### + space là H3.

Heading H2

Heading H3

Heading H4

Heading H5
Heading H6

Highlight từ khoá

Sử dụng cặp "`" như sau `keyword/value`. Kết qủa: keyword/value

Insert source code

Gõ 3 lần "`" rồi enter, nhập source code vào và điền tên ngôn ngữ ở box trên bên trái.

Các ngôn ngữ 200Lab có hỗ trợ:

  • HTML
  • CSS
  • Javascript
  • Bash (bash script)
  • Dart
  • Docker (dockerfile)
  • Git
  • Go (Golang)
  • GraphQL
  • Java
  • JSON
  • Kotlin
  • Latex
  • Lua
  • Nginx
  • PHP
  • JSX
  • Rust
  • SASS
  • Scala
  • SQL
  • Swift
  • Typescript
  • Yaml
use std::io;
use rand::Rng;

fn main() {
    println!("Guess the number!");

    let secret_number = rand::thread_rng().gen_range(1..=100);

    println!("The secret number is: {secret_number}");

    println!("Please input your guess.");

    let mut guess = String::new();

    io::stdin()
        .read_line(&mut guess)
        .expect("Failed to read line");

    println!("You guessed: {guess}");
}
Ví dụ một program Rust cơ bản

Code line highlight

Dùng để highlight các dòng code cần chú ý, hoặc cần chú giải. Chỗ này cần HTML:

<pre data-line="7,15-17" class="language-rust line-numbers"><code>use std::io;
use rand::Rng;

fn main() {
    println!("Guess the number!");

    let secret_number = rand::thread_rng().gen_range(1..=100);

    println!("The secret number is: {secret_number}");

    println!("Please input your guess.");

    let mut guess = String::new();

    io::stdin()
        .read_line(&mut guess)
        .expect("Failed to read line");

    println!("You guessed: {guess}");
}
</code></pre>
Dòng 7 và dòng 15 tới 17 sẽ được highlight

Kết quả:

use std::io;
use rand::Rng;

fn main() {
    println!("Guess the number!");

    let secret_number = rand::thread_rng().gen_range(1..=100);

    println!("The secret number is: {secret_number}");

    println!("Please input your guess.");

    let mut guess = String::new();

    io::stdin()
        .read_line(&mut guess)
        .expect("Failed to read line");

    println!("You guessed: {guess}");
}
  • Line 7: Generate một số từ trong quãng 1-100.
  • Line 15-17: Nhận dữ liệu nhập vào, gán vào guess, nếu có lỗi sẽ in ra Failed to read line

Toggle Card

Cái này hiệu quả cho các nội dung dài, cần rút gọn kiểu collapse.

Cách dùng: Gõ / + t, chọn Toogle Card. Demo:

Cách 1

Nội dung cách 1

Cách 2

Nội dung cách 2

Callout Card

Dùng để format các thông tin quan trọng.

Cách dùng: Gõ / + c rồi chọn Callout Card. Demo:

⚠️
Nội dung cảnh báo...
👌
Thông báo thành công...

Button (CTA Button)

/ + bu rồi chọn Button. Demo:

Product Box

/ + prod rồi chọn Product. Demo:

Khoá học lập trình NFT, Web3

Chỉ dạy code, không dạy trading, lùa gà

Mua liền

Footnotes

Dùng để ghi chú và giải thích các định nghĩa.

Cách dùng là thông qua markdown:


Here's a short footnote,[^1] and here's a longer one.[^longnote]

[^1]: This is a short footnote.

[^longnote]: This is a longer footnote with paragraphs, and code.Indent paragraphs to include them in the footnote.

Kết quả:

Here's a short footnote,[1] and here's a longer one.[2]


  1. This is a short footnote. ↩︎

  2. This is a longer footnote with paragraphs, and code.Indent paragraphs to include them in the footnote. ↩︎

jkjkj