Compare commits
No commits in common. "4e82edce066ba2b953abca9c7f106bf361e1844c" and "acf8b73315e3e3bced6c00a1c52efe7c9a3db991" have entirely different histories.
4e82edce06
...
acf8b73315
|
@ -65,8 +65,6 @@
|
||||||
code: (
|
code: (
|
||||||
theme: "res/abb.tmTheme",
|
theme: "res/abb.tmTheme",
|
||||||
font: "FiraCode Nerd Font",
|
font: "FiraCode Nerd Font",
|
||||||
lines: false,
|
|
||||||
size: 10pt,
|
|
||||||
tab-size: 4),
|
tab-size: 4),
|
||||||
link: (
|
link: (
|
||||||
color: ABB-GRAY-02)))
|
color: ABB-GRAY-02)))
|
||||||
|
|
|
@ -78,59 +78,7 @@
|
||||||
set raw(
|
set raw(
|
||||||
tab-size: style.code.tab-size,
|
tab-size: style.code.tab-size,
|
||||||
theme: style.code.theme)
|
theme: style.code.theme)
|
||||||
show raw: set text(font: style.code.font, size: style.code.size)
|
show raw: set text(font: style.code.font)
|
||||||
show figure.where(kind: raw): it => align(left)[
|
|
||||||
#let content = it.body
|
|
||||||
#block(
|
|
||||||
width: 100%,
|
|
||||||
fill: ABB-GRAY-06,
|
|
||||||
stroke: none,
|
|
||||||
radius: 0.5em,
|
|
||||||
inset: 0.75em,
|
|
||||||
clip: false,
|
|
||||||
{
|
|
||||||
let (columns, align, make_row) = {
|
|
||||||
if style.code.lines {(
|
|
||||||
(auto, 1fr),
|
|
||||||
(right + top, left),
|
|
||||||
e => {
|
|
||||||
let (i, l) = e
|
|
||||||
let n = i + 1
|
|
||||||
let n_str = if (calc.rem(n, 1) == 0) or (true and i == 0) { text(font: style.code.font, size: style.code.size, fill: ABB-BLACK, str(n)) } else { none }
|
|
||||||
(n_str + h(0.5em), raw(lang: content.lang, l))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
( ( 1fr, ),
|
|
||||||
( left, ),
|
|
||||||
e => {
|
|
||||||
let (i, l) = e
|
|
||||||
raw( lang:content.lang, l)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
grid(
|
|
||||||
stroke: none,
|
|
||||||
columns: columns,
|
|
||||||
rows: (auto,),
|
|
||||||
gutter: 0pt,
|
|
||||||
inset: 0.25em,
|
|
||||||
align: (col, _) => align.at(col),
|
|
||||||
fill: ABB-GRAY-06,
|
|
||||||
..content
|
|
||||||
.text
|
|
||||||
.split("\n")
|
|
||||||
.enumerate()
|
|
||||||
.map(make_row)
|
|
||||||
.flatten()
|
|
||||||
.map(c => if c.has("text") and c.text == "" { v(1em) } else { c })
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
#v(-1em)
|
|
||||||
#align(center + top, it.caption)
|
|
||||||
]
|
|
||||||
|
|
||||||
show figure: set block(breakable: true)
|
show figure: set block(breakable: true)
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#show: dhbw-template.with((
|
#show: dhbw-template.with((
|
||||||
lang: "en",
|
lang: "en",
|
||||||
region: "en",
|
region: "en",
|
||||||
draft: false,
|
|
||||||
author: (
|
author: (
|
||||||
name: "Sven Vogel",
|
name: "Sven Vogel",
|
||||||
semester: 4,
|
semester: 4,
|
||||||
|
@ -81,8 +80,6 @@ $
|
||||||
|
|
||||||
#pagebreak()
|
#pagebreak()
|
||||||
|
|
||||||
#lorem(100)
|
|
||||||
|
|
||||||
#figure(
|
#figure(
|
||||||
```rust
|
```rust
|
||||||
use std::env;
|
use std::env;
|
||||||
|
@ -90,12 +87,37 @@ use std::fs::OpenOptions;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, World!!!");
|
// Get the file path from the environment variable
|
||||||
|
let file_path = match env::var("OUTPUT_FILE") {
|
||||||
|
Ok(path) => path,
|
||||||
|
Err(_) => {
|
||||||
|
eprintln!("Error: OUTPUT_FILE environment variable is not set");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Open the file in append mode, create it if it doesn't exist
|
||||||
|
let mut file = match OpenOptions::new()
|
||||||
|
.append(true)
|
||||||
|
.create(true)
|
||||||
|
.open(&file_path)
|
||||||
|
{
|
||||||
|
Ok(file) => file,
|
||||||
|
Err(e) => {
|
||||||
|
eprintln!("Error opening file {}: {}", file_path, e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Write "Hello, World" to the file
|
||||||
|
if let Err(e) = writeln!(file, "Hello, World") {
|
||||||
|
eprintln!("Error writing to file: {}", e);
|
||||||
|
} else {
|
||||||
|
println!("Successfully appended 'Hello, World' to {}", file_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```, caption: [Some code])
|
```, caption: [Some code])
|
||||||
|
|
||||||
#lorem(100)
|
|
||||||
|
|
||||||
#pagebreak()
|
#pagebreak()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue