-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc92ddb
commit 4e0dc54
Showing
8 changed files
with
147 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<style> | ||
.top_right { | ||
position: fixed!important; | ||
top: 1em; | ||
right: 1em; | ||
} | ||
</style> | ||
|
||
<span id="end"></span> | ||
|
||
<section data-background-size="60%" data-background-image="{{.Img}}"> | ||
|
||
<a href="{{.Href}}" class="top_right">🎉</a> | ||
</section> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:is(li, a, span).current-fragment { | ||
color: #ff5a00; | ||
} |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.highlight-line .hljs-comment { | ||
color: #70ff07 !important; | ||
background-color: #000 !important; | ||
font-style: italic; | ||
font-size: large; | ||
} | ||
|
||
.highlight-line .hljs-ln-code { | ||
color: yellow !important; | ||
font-size: large; | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package funcs | ||
|
||
import ( | ||
"bytes" | ||
"io" | ||
"net/http" | ||
"text/template" | ||
) | ||
|
||
func TxtFrom(srcs ...string) (string, error) { | ||
buf := bytes.NewBuffer(nil) | ||
for _, src := range srcs { | ||
resp, err := http.Get(src) | ||
if err != nil { | ||
return "", err | ||
} | ||
var body []byte | ||
body, err = io.ReadAll(resp.Body) | ||
if err != nil { | ||
return "", err | ||
} | ||
buf.Write(body) | ||
_ = resp.Body.Close() | ||
} | ||
return buf.String(), nil | ||
} | ||
|
||
// Tmpl 注意,此template不提供額外的FuncMap | ||
func Tmpl(src string, ctx map[string]any) (string, error) { | ||
resp, err := http.Get(src) | ||
if err != nil { | ||
return "", err | ||
} | ||
var body []byte | ||
body, err = io.ReadAll(resp.Body) | ||
if err != nil { | ||
return "", err | ||
} | ||
_ = resp.Body.Close() | ||
|
||
var t *template.Template | ||
t, err = template.New("").Parse(string(body)) | ||
if err != nil { | ||
return "", err | ||
} | ||
buf := &bytes.Buffer{} | ||
if err = t.Execute(buf, ctx); err != nil { | ||
return "", err | ||
} | ||
return buf.String(), nil | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{{printf "<style>%s</style>" (txtFrom | ||
(printf "%s%s" .BaseURL "/assets/pre.css") | ||
(printf "%s%s" .BaseURL "/assets/fragment.css") | ||
) | ||
}} | ||
|
||
```go [|2|3-5|7|8|7-8] | ||
type VheaTable struct { | ||
Version uint32 // 0x00010000 or 0x00110000 | ||
Ascent int16 | ||
Descent int16 | ||
LineGap int16 // Reserved; set to 0 | ||
AHMax uint16 | ||
|
||
MinTSB int16 | ||
MinBSB int16 | ||
YMaxExtent int16 | ||
CaretSlopeRise int16 | ||
CaretSlopeRun int16 | ||
CaretOffset int16 | ||
reserved1 int16 | ||
reserved2 int16 | ||
reserved3 int16 | ||
reserved4 int16 | ||
MetricDataFormat int16 | ||
|
||
NumMetrics uint16 | ||
} | ||
|
||
``` | ||
|
||
--- | ||
|
||
- This is an <span class="fragment grow">apple</span> | ||
- This is a <span class="fragment grow">pen</span> | ||
|
||
Note: | ||
|
||
透過fragment.css達成grow時顏色修改 `:is(li, a, span).current-fragment {color: #ff5a00;}` | ||
|
||
--- | ||
|
||
{{tmpl (join "" .BaseURL "/assets/end_slides.md") (dict "Img" "/assets/home2.webp" "Href" "/md/example.md?theme=sky#3/2")}} | ||
|
||
Note: | ||
|
||
透過這種方式可以將指定的樣板匯入 |