Hello, this topic is a question, so please use Questions category for such topics.
First of all, passwords are a very sensitive topic, so I hope you know what you are doing.
There can be various solutions, but here is a very simple one + I simplified your code:
#let passwords = ```yaml
--- # User, Password, Shell
-
- "u1"
- "p1"
- "/bin/sh"
-
- "u2"
- "p2"
- "/bin/sh"
-
- "u3"
- "p3"
- "/opt/homebrew/bin/bash"
```.text
#let OBF = false
#let OBF = true // Comment this to toggle.
#let HASH = "###########"
#let data = yaml(bytes(passwords))
#if OBF {
data = data.map(row => {
row.at(1) = HASH
row
})
}
#show table.cell.where(y: 0): strong
#figure(
table(
columns: 3,
align: (x, y) => if y == 0 { center } else { left },
table.header[User][Password][Shell],
..data.flatten(),
),
caption: [passwords.yaml],
) <passwords.yaml>
