1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: support $embed_file('embed.vv', .zlib) (#12654)

This commit is contained in:
Leo Developer
2021-12-04 18:43:19 +01:00
committed by GitHub
parent 0f50ac3260
commit ace63594bf
24 changed files with 411 additions and 72 deletions

View File

@ -4982,6 +4982,17 @@ executable, increasing your binary size, but making it more self contained
and thus easier to distribute. In this case, `embedded_file.data()` will cause *no IO*,
and it will always return the same data.
`$embed_file` supports compression of the embedded file when compiling with `-prod`.
Currently only one compression type is supported: `zlib`
```v ignore
import os
fn main() {
embedded_file := $embed_file('v.png', .zlib) // compressed using zlib
os.write_file('exported.png', embedded_file.to_string()) ?
}
```
#### `$tmpl` for embedding and parsing V template files
V has a simple template language for text and html templates, and they can easily