From d459dfac74e90c29950d49a82edc19fd913d435e Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 29 Jul 2021 08:25:05 +0000 Subject: update to bootstrap 5.0.2 --- .../site/layouts/shortcodes/scss-docs.html | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 vendor/twbs/bootstrap/site/layouts/shortcodes/scss-docs.html (limited to 'vendor/twbs/bootstrap/site/layouts/shortcodes/scss-docs.html') diff --git a/vendor/twbs/bootstrap/site/layouts/shortcodes/scss-docs.html b/vendor/twbs/bootstrap/site/layouts/shortcodes/scss-docs.html new file mode 100644 index 000000000..16a906e77 --- /dev/null +++ b/vendor/twbs/bootstrap/site/layouts/shortcodes/scss-docs.html @@ -0,0 +1,33 @@ +{{- /* + Usage: `scss-docs name="name" file="file/_location.scss"` + + Prints everything between `// scss-docs-start "name"` and `// scss-docs-end "name"` + comments in the docs. + + Optional parameters: + strip-default: Remove the ` !default` flag from variable assignments - default: `true` +*/ -}} + +{{- $name := .Get "name" -}} +{{- $file := .Get "file" -}} +{{- $strip_default := .Get "strip-default" | default "true" -}} + +{{- $start := printf "// scss-docs-start %s\n" $name -}} +{{- $end := printf "// scss-docs-end %s" $name -}} +{{- $regex := printf "%s(.|\n)*%s" $start $end -}} + +{{- $css := readFile $file -}} +{{- $match := findRE $regex $css 1 -}} + +{{- if (eq (len $match) 0) -}} + {{- errorf "Got no matches for %q in %q! (called in %q)" $name $file $.Page.Path -}} +{{- end -}} + +{{- $remove_start := replace (index $match 0) $start "" -}} +{{- $result := replace $remove_start $end "" -}} + +{{- if (ne $strip_default "false") -}} + {{- $result = replace $result " !default" "" -}} +{{- end -}} + +{{- highlight $result "scss" "" -}} -- cgit v1.2.3