Skip to content

Commit 491c3a5

Browse files
authored
docs: add compile time pseudo variables in path for $embed_file (after #26319) (#26325)
1 parent 2ce4090 commit 491c3a5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎doc/docs.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6558,6 +6558,13 @@ fn main() {
65586558
V can embed arbitrary files into the executable with the `$embed_file(<path>)`
65596559
compile time call. Paths can be absolute or relative to the source file.
65606560
6561+
Paths could also use the compile time pseudo variables `@VEXEROOT`,
6562+
`@VMODROOT`, `@DIR`, `$d` and `$env`.
6563+
6564+
```v ignore
6565+
logo := $embed_file('@VEXEROOT/examples/assets/logo.png')
6566+
```
6567+
65616568
Note that by default, using `$embed_file(file)`, will always embed the whole content
65626569
of the file, but you can modify that behaviour by passing: `-d embed_only_metadata`
65636570
when compiling your program. In that case, the file will not be embedded. Instead,

0 commit comments

Comments
 (0)