-
Notifications
You must be signed in to change notification settings - Fork 33
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
Showing
1,403 changed files
with
66,309 additions
and
140,983 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
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,7 @@ | ||
# Docs Builder | ||
|
||
```bash | ||
$ npm i minify -g | ||
$ npm i js-beautify -g | ||
$ npm i highlight.js-cli -g | ||
``` |
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
Binary file not shown.
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
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,52 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"net/smtp" | ||
"os" | ||
"os/exec" | ||
"strings" | ||
|
||
cli "github.com/urfave/cli/v2" | ||
) | ||
|
||
func testMail(c *cli.Context) error { | ||
from := c.String("mailto") | ||
pass := c.String("mailpwd") | ||
to := c.String("mailto") | ||
|
||
// 透過 `css-minify` 將 `/dist/tocas.css` 的內容最小化。 | ||
if err := exec.Command("css-minify", "-f", "./../../src/email.css", "-o", "./").Run(); err != nil { | ||
return err | ||
} | ||
|
||
b, err := os.ReadFile("./email.min.css") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
bb, err := os.ReadFile(c.String("mailtmpl")) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
body := string(bb) | ||
|
||
body = strings.ReplaceAll(body, `<link rel="stylesheet" href="./email.css" />`, fmt.Sprintf(`<style type="text/css">%s</style>`, string(b))) | ||
|
||
msg := "From: " + from + "\n" + | ||
"To: " + to + "\n" + | ||
"Subject: 測試郵件\n" + | ||
"MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n" + | ||
body | ||
|
||
err = smtp.SendMail("smtp.gmail.com:587", | ||
smtp.PlainAuth("", from, pass, "smtp.gmail.com"), | ||
from, []string{to}, []byte(msg)) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
return 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,18 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os/exec" | ||
|
||
cli "github.com/urfave/cli/v2" | ||
) | ||
|
||
func compressScreenshots(c *cli.Context) error { | ||
// pngquant -f --ext .png ./../../examples/screenshots/*.png | ||
b, err := exec.Command("pngquant", "-f", "--ext", ".png", "./../../examples/screenshots/*.png").CombinedOutput() | ||
if err != nil { | ||
log.Println(string(b)) | ||
return err | ||
} | ||
return nil | ||
} |
Oops, something went wrong.