Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/mindoc-org/mindoc/commands"
"github.com/mindoc-org/mindoc/commands/daemon"
_ "github.com/mindoc-org/mindoc/routers"
"github.com/mindoc-org/mindoc/utils"
)

func isViaDaemonUnix() bool {
Expand Down Expand Up @@ -49,6 +50,11 @@ func main() {

d := daemon.NewDaemon()

// 安卓 go/src/time/zoneinfo_android.go 固定localLoc 为 UTC
if runtime.GOOS == "android" {
utils.FixTimezone()
}

if runtime.GOOS != "windows" && !isViaDaemonUnix() {
s, err := service.New(d, d.Config())

Expand Down
19 changes: 19 additions & 0 deletions utils/android_time.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package utils

import (
"os/exec"
"strings"
"time"
)

func FixTimezone() {
out, err := exec.Command("/system/bin/getprop", "persist.sys.timezone").Output()
if err != nil {
return
}
timeZone, err := time.LoadLocation(strings.TrimSpace(string(out)))
if err != nil {
return
}
time.Local = timeZone
}
7 changes: 7 additions & 0 deletions views/document/cherry_read.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
display: none;
}
}

.m-manual.manual-reader .manual-article.cherry-markdown .article-body .toc {
max-height: calc(100vh - 180px);
overflow-y: auto;
overflow-x: hidden;
-webkit-overflow-scrolling: touch;
}
</style>
</head>
<body>
Expand Down
Loading