large changes
This commit is contained in:
22
modules/doc/doc.go
Normal file
22
modules/doc/doc.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package doc
|
||||
|
||||
import (
|
||||
"fes/modules/config"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/pkg/browser"
|
||||
)
|
||||
|
||||
func Open() error {
|
||||
fmt.Println("Opening documentation in browser")
|
||||
|
||||
tmpFile := filepath.Join(os.TempDir(), "doc.html")
|
||||
|
||||
if err := os.WriteFile(tmpFile, []byte(config.Doc), 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return browser.OpenFile(tmpFile)
|
||||
}
|
||||
Reference in New Issue
Block a user