Last active
May 4, 2023 08:48
-
-
Save ilius/bde2c7b7bf5374ac151b0f6d4bb254fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Go's template funcs: | |
# https://github.com/golang/go/blob/master/src/text/template/funcs.go | |
header_template = """ | |
<b><font color='#ccf'>{{.DictName}}</font></b> | |
<font color='#aaa'> [%{{.Score}}]</font> | |
{{if .ShowTerms }} | |
<div dir="ltr" style="font-size: large;font-weight:bold;"> | |
{{ index .Terms 0 }} | |
</div> | |
{{if gt (len .Terms) 1}} | |
{{range $lineI, $terms := wrapterms (slice .Terms 1) 40}} | |
{{if gt $lineI 0 }} | |
<br> | |
{{else}} | |
<font color="#ffaaaa"> | </font> | |
{{end}} | |
{{range $termI, $term := $terms }} | |
<span dir="ltr" style="font-weight:bold;"> | |
{{if gt $termI 0 }} | |
<font color="#ffaaaa"> | </font> | |
{{end}} | |
{{ $term }} | |
</span> | |
{{end}} | |
{{end}} | |
{{end}} | |
{{end}} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment