1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package markup
- import (
- "path/filepath"
- "strings"
- log "gopkg.in/clog.v1"
- "github.com/chaseadamsio/goorgeous"
- )
- var orgModeExtensions = []string{".org"}
- func IsOrgModeFile(name string) bool {
- extension := strings.ToLower(filepath.Ext(name))
- for _, ext := range orgModeExtensions {
- if strings.ToLower(ext) == extension {
- return true
- }
- }
- return false
- }
- func RawOrgMode(body []byte, urlPrefix string) (result []byte) {
-
- defer func() {
- if err := recover(); err != nil {
- result = body
- log.Warn("PANIC (RawOrgMode): %v", err)
- }
- }()
- return goorgeous.OrgCommon(body)
- }
- func OrgMode(input interface{}, urlPrefix string, metas map[string]string) []byte {
- return Render(ORG_MODE, input, urlPrefix, metas)
- }
|