36 lines
814 B
Go
36 lines
814 B
Go
|
package lib
|
||
|
|
||
|
import (
|
||
|
"text/template"
|
||
|
|
||
|
"git.ymnuktech.ru/ymnuk/yt-gen-app/lib/templ"
|
||
|
)
|
||
|
|
||
|
func docSinglePage() {
|
||
|
var err error
|
||
|
var tmpl *template.Template
|
||
|
var out []byte
|
||
|
if tmpl, err = templ.ReadTmplFile("tmpl/docs/single-index.tmpl"); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if out, err = templ.ExecuteTmplFile(tmpl, Project); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
if AppConfig.IsMarkdown {
|
||
|
if err = templ.WriteFile(AppConfig.OutdirDoc+"/index.md", out); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
if AppConfig.IsHtml {
|
||
|
var buff []byte
|
||
|
if buff, err = templ.Content.ReadFile("tmpl/docs/styles.tmpl"); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
//{{ includeTemplPart "tmpl/docs/styles.tmpl" nil }}
|
||
|
out = append(buff, out...)
|
||
|
if err = templ.WriteFile(AppConfig.OutdirDoc+"/index.html", mdToHTML(out)); err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|
||
|
}
|