+++
title = "Code Blocks Theme"
description = "Sample article showcasing syntax highlighting and formatting for Code Blocks with a custom theme."
date = 2022-05-16
draft = false
[taxonomies]
tags = ["Features","Markdown"]
[extra]
keywords = "Code, Code Blocks, Syntax, Syntax Highlighting, Theme"
toc = true
series = "Features"
+++
This article shows various Code Blocks allowing to easily compare sublime themes.
## Code Blocks
Code blocks.. ❤️ with automatic syntax highlighting ✨
See [the docs](https://www.getzola.org/documentation/content/syntax-highlighting/) for options.
### Inline Code block
If we want, we can also `specify inline code` which is useful for `the small stuff`.
### Rust
```rust
fn main() {
let greetings = ["Hello", "Hola", "Bonjour",
"Ciao", "こんにちは", "안녕하세요",
"Cześć", "Olá", "Здравствуйте",
"Chào bạn", "您好", "Hallo",
"Hej", "Ahoj", "سلام",
"Hej", "Hallo", "Hei",
"Helló", "Hallo", "Buna ziua",
"Merhaba"];
for (num, greeting) in greetings.iter().enumerate() {
print!("{} : ", greeting);
match num {
0 => println!("This code is editable and runnable!"),//en English
1 => println!("¡Este código es editable y ejecutable!"),//es Spanish
2 => println!("Ce code est modifiable et exécutable !"),//fr French
3 => println!("Questo codice è modificabile ed eseguibile!"),//it Italian
4 => println!("このコードは編集して実行出来ます!"),//jp Japanese
5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"),//ko Korean
6 => println!("Ten kod można edytować oraz uruchomić!"),//pl Polish
7 => println!("Este código é editável e executável!"),//pt Portuguese
8 => println!("Этот код можно отредактировать и запустить!"),//ru Russian
9 => println!("Bạn có thể edit và run code trực tiếp!"),//vi Vietnamese
10 => println!("这段代码是可以编辑并且能够运行的!"),//zh Chinese
11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"),//de German
12 => println!("Den här koden kan redigeras och köras!"),//sv Swedish
13 => println!("Tento kód můžete upravit a spustit"),//cs Czech
14 => println!("این کد قابلیت ویرایش و اجرا دارد!"),//fa Persian
15 => println!("Denne kode kan redigeres og køres!"),//da Danish
16 => println!("Deze code is bewerkbaar en uitvoerbaar!"),//du Dutch
17 => println!("Tämä koodi on muokattavissa ja ajettavissa!"),//fi Finnish
18 => println!("Ez a kód szerkeszthető és futtatható!"),//hu Hungarian
19 => println!("Denne koden er redigerbar og kjørbar!"),//no Norwegian
20 => println!("Acest cod este editabil și rulabil!"),//ro Romanian
21 => println!("Bu kod düzenlenebilir ve çalıştırılabilir!"),//tr Turkish
_ => {},
}
}
}
```
### Bash
```bash
#!/bin/bash
for d in /sys/kernel/iommu_groups/*/devices/*; do
n=${d#*/iommu_groups/*}; n=${n%%/*}
printf 'IOMMU Group %s ' "$n"
lspci -nns "${d##*/}"
done
```
### TOML
```toml,linenos,hl_lines=3
base_url = "https://abridge.netlify.app/"
title = "Abridge"
description = "Abridge is a fast and lightweight Zola theme using semantic html, abridge.css class-light CSS, and No Mandatory JS."
default_language = "en"
#theme = "abridge"
build_search_index = true
minify_html = false
feed_filename = "atom.xml"
taxonomies = [
{name = "categories", feed = true},
{name = "tags", feed = true},
]
```
### HTML
```html
Example HTML5 Document
Test
```
### CSS
```css
html {
font-size: var(--fs);
}
.c {
text-align: center;
}
```
### SCSS
```scss
$font: Roboto system-ui -apple-system BlinkMacSystemFont "Segoe UI" Oxygen Ubuntu Cantarell "Fira Sans" "Droid Sans" "Helvetica Neue" "Noto Sans" Helvetica Arial sans-serif !default;
$font-mono: ui-monospace Menlo Monaco Consolas "SF Mono" "Cascadia Mono" "Segoe UI Mono" "DejaVu Sans Mono" "Liberation Mono" "Roboto Mono" "Oxygen Mono" "Ubuntu Monospace" "Ubuntu Mono" "Source Code Pro" "Fira Mono" "Droid Sans Mono" "Courier New" Courier monospace !default;
@mixin font {
// convert space separated list to comma separated list
$font: list.join($font, "", $separator: comma);
$font: functions.remove($font, "");
$font-mono: list.join($font-mono, "", $separator: comma);
$font-mono: functions.remove($font-mono, "");
$font: functions.font-var($font, $fontExt-Main, $findFont-Main);
$font-mono: functions.font-var($font-mono, $fontExt-Code, $findFont-Code);
#{--ff}: $font;
#{--fm}: $font-mono;//code
}
```
### Javascript
```javascript
function closeSearch() {//close the search displaying the regular page.
const e = document.querySelector("main");
e.innerHTML = window.main
}
function goSearch() {// on enter key or search icon click display results to the page.
const e = document.querySelector("main");
window.main || (window.main = e.innerHTML);
var t = document.getElementById("suggestions"),
n = ((ResultsClone = t.cloneNode(!0)).id = "results", document.createElement("div")),
o = '