mirror of
https://github.com/actix/actix-website
synced 2024-11-30 19:14:36 +01:00
8 lines
379 B
HTML
8 lines
379 B
HTML
{{$example := .Get "example"}}
|
|
{{$file := .Get "file" | default "main.rs"}}
|
|
{{$section := .Get "section"}}
|
|
{{$source := readFile (printf "examples/%s/src/%s" $example $file)}}
|
|
{{$source := index (findRE (printf "(?ms)^// <%s>$(.*?)^// </%s>$" $section $section) $source) 0 }}
|
|
{{$source := trim (replaceRE "(?m)^// <[^>]+>" "" $source) "\n" }}
|
|
{{- highlight $source "rust" "" -}}
|