2021-07-10 20:02:16 +00:00
|
|
|
// Package help contains help messages and the utilities for retrieving them.
|
|
|
|
package help
|
|
|
|
|
|
|
|
import (
|
|
|
|
"embed"
|
|
|
|
)
|
|
|
|
|
2021-07-12 10:01:53 +00:00
|
|
|
//go:embed en en.myco
|
2021-09-06 17:46:34 +00:00
|
|
|
//go:embed ru ru.myco
|
2021-07-10 20:02:16 +00:00
|
|
|
var fs embed.FS
|
|
|
|
|
|
|
|
// Get determines what help text you need and returns it. The path is a substring from URL, it follows this form:
|
|
|
|
// <language>/<topic>
|
|
|
|
func Get(path string) ([]byte, error) {
|
2021-07-12 10:01:53 +00:00
|
|
|
if path == "" {
|
|
|
|
return Get("en")
|
|
|
|
}
|
2021-07-10 20:02:16 +00:00
|
|
|
return fs.ReadFile(path + ".myco")
|
|
|
|
}
|