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