mirror of
https://github.com/arnaucube/konstrui.git
synced 2026-02-07 03:26:43 +01:00
prints cleaned
This commit is contained in:
@@ -76,7 +76,7 @@ func writeFile(path string, newContent string) {
|
|||||||
check(err)
|
check(err)
|
||||||
|
|
||||||
color.Green(path + ":")
|
color.Green(path + ":")
|
||||||
color.Blue(newContent)
|
//color.Blue(newContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*func generatePageFromTemplateAndData(templateContent string, entry dataEntry) string {
|
/*func generatePageFromTemplateAndData(templateContent string, entry dataEntry) string {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Jeffail/gabs"
|
"github.com/Jeffail/gabs"
|
||||||
@@ -15,7 +13,8 @@ func duplicateText(original string, count int) string {
|
|||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
func replaceEntryOLD(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string {
|
|
||||||
|
/*func replaceEntryOLD(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string {
|
||||||
//replace {{}} with data
|
//replace {{}} with data
|
||||||
var keys []string
|
var keys []string
|
||||||
for key, _ := range entry {
|
for key, _ := range entry {
|
||||||
@@ -36,7 +35,7 @@ func replaceEntryOLD(templateContent string, entry dataEntry, jsonData *gabs.Con
|
|||||||
}
|
}
|
||||||
|
|
||||||
return templateContent
|
return templateContent
|
||||||
}
|
}*/
|
||||||
func replaceEntry(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string {
|
func replaceEntry(templateContent string, entry dataEntry, jsonData *gabs.Container, elemName string) string {
|
||||||
//fmt.Println(jsonData)
|
//fmt.Println(jsonData)
|
||||||
children, _ := jsonData.S().ChildrenMap()
|
children, _ := jsonData.S().ChildrenMap()
|
||||||
@@ -106,7 +105,7 @@ func konstruiRepeatElem(templateContent string, entry dataEntry, jsonData *gabs.
|
|||||||
children, _ := jsonData.S(elemName).Children()
|
children, _ := jsonData.S(elemName).Children()
|
||||||
var replaced string
|
var replaced string
|
||||||
for _, child := range children {
|
for _, child := range children {
|
||||||
fmt.Println(child.Data().(string))
|
//fmt.Println(child.Data().(string))
|
||||||
replacedElem := strings.Replace(f, "{{"+elemName+"}}", child.Data().(string), -1)
|
replacedElem := strings.Replace(f, "{{"+elemName+"}}", child.Data().(string), -1)
|
||||||
replaced = replaced + replacedElem
|
replaced = replaced + replacedElem
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user