Passed through golint only to get a load of garbage
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: file:///srv/svn/repo/aya/trunk@77 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
parent
1256d7ca18
commit
cdccb2a932
5
LICENSE
5
LICENSE
@ -1,7 +1,7 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 zserge
|
||||
Copyright (c) 2023 Izuru Yakumo
|
||||
Copyright (c) 2014 Serge Zaitsev <hello@zserge.com>
|
||||
Copyright (c) 2023 Izuru Yakumo <yakumo.izuru@chaotic.ninja>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -20,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.7 2023-12-04 01:55:36+0000, yakumo_izuru Exp $
|
||||
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.8 2023-12-04 15:43:44+0000, yakumo_izuru Exp $
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -141,21 +141,21 @@ func getVars(path string, globals Vars) (Vars, string, error) {
|
||||
|
||||
// Render expanding aya plugins and variables
|
||||
func render(s string, vars Vars) (string, error) {
|
||||
delim_open := "{{"
|
||||
delim_close := "}}"
|
||||
delimOpen := "{{"
|
||||
delimClose := "}}"
|
||||
|
||||
out := &bytes.Buffer{}
|
||||
for {
|
||||
if from := strings.Index(s, delim_open); from == -1 {
|
||||
if from := strings.Index(s, delimOpen); from == -1 {
|
||||
out.WriteString(s)
|
||||
return out.String(), nil
|
||||
} else {
|
||||
if to := strings.Index(s, delim_close); to == -1 {
|
||||
return "", fmt.Errorf("Close delim not found")
|
||||
if to := strings.Index(s, delimClose); to == -1 {
|
||||
return "", fmt.Errorf("Closing delimiter not found")
|
||||
} else {
|
||||
out.WriteString(s[:from])
|
||||
cmd := s[from+len(delim_open) : to]
|
||||
s = s[to+len(delim_close):]
|
||||
cmd := s[from+len(delimOpen) : to]
|
||||
s = s[to+len(delimClose):]
|
||||
m := strings.Fields(cmd)
|
||||
if len(m) == 1 {
|
||||
if v, ok := vars[m[0]]; ok {
|
||||
@ -308,7 +308,7 @@ func build(path string, w io.Writer, vars Vars) error {
|
||||
ext := filepath.Ext(path)
|
||||
if ext == ".md" || ext == ".mkd" || ext == ".markdown" {
|
||||
return buildMarkdown(path, w, vars)
|
||||
} else if ext == ".html" || ext == ".xml" {
|
||||
} else if ext == ".htm" || ext == ".html" || ext == ".xht" || ext == ".xhtml" {
|
||||
return buildHTML(path, w, vars)
|
||||
} else if ext == ".amber" {
|
||||
return buildAmber(path, w, vars)
|
||||
|
4
doc.go
4
doc.go
@ -16,8 +16,8 @@
|
||||
// This is a hard fork of git.mills.io/prologic/zs, which in turn is a fork of zserge's zs
|
||||
// This one (re)incorporates the features removed in the former from the latter
|
||||
|
||||
// Copyright (c) 2014 Serge Zaitsev
|
||||
// Copyright (c) 2023 Izuru Yakumo
|
||||
// Copyright (c) 2014 Serge Zaitsev <hello@zserge.com>
|
||||
// Copyright (c) 2023 Izuru Yakumo <yakumo.izuru@chaotic.ninja>
|
||||
|
||||
// Ayaya~
|
||||
package aya
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
|
||||
var (
|
||||
// Set to current tag
|
||||
Version = "v0.6.7"
|
||||
Version = "v0.6.8"
|
||||
Time = time.Now()
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user