summaryrefslogtreecommitdiffhomepage
path: root/markup
diff options
context:
space:
mode:
Diffstat (limited to 'markup')
-rw-r--r--markup/asciidocext/convert.go18
-rw-r--r--markup/converter/converter.go2
-rw-r--r--markup/internal/external.go4
-rw-r--r--markup/org/convert.go6
-rw-r--r--markup/pandoc/convert.go2
-rw-r--r--markup/rst/convert.go4
6 files changed, 18 insertions, 18 deletions
diff --git a/markup/asciidocext/convert.go b/markup/asciidocext/convert.go
index f3e451496..a92b6f9e3 100644
--- a/markup/asciidocext/convert.go
+++ b/markup/asciidocext/convert.go
@@ -82,7 +82,7 @@ func (a *asciidocConverter) Supports(_ identity.Identity) bool {
func (a *asciidocConverter) getAsciidocContent(src []byte, ctx converter.DocumentContext) []byte {
path := getAsciidoctorExecPath()
if path == "" {
- a.cfg.Logger.ERROR.Println("asciidoctor not found in $PATH: Please install.\n",
+ a.cfg.Logger.Errorln("asciidoctor not found in $PATH: Please install.\n",
" Leaving AsciiDoc content unrendered.")
return src
}
@@ -90,7 +90,7 @@ func (a *asciidocConverter) getAsciidocContent(src []byte, ctx converter.Documen
args := a.parseArgs(ctx)
args = append(args, "-")
- a.cfg.Logger.INFO.Println("Rendering", ctx.DocumentName, "with", path, "using asciidoctor args", args, "...")
+ a.cfg.Logger.Infoln("Rendering", ctx.DocumentName, "with", path, "using asciidoctor args", args, "...")
return internal.ExternallyRenderContent(a.cfg, ctx, src, path, args)
}
@@ -103,7 +103,7 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
for _, extension := range cfg.Extensions {
if !asciidocext_config.AllowedExtensions[extension] {
- a.cfg.Logger.ERROR.Println("Unsupported asciidoctor extension was passed in. Extension `" + extension + "` ignored.")
+ a.cfg.Logger.Errorln("Unsupported asciidoctor extension was passed in. Extension `" + extension + "` ignored.")
continue
}
@@ -112,7 +112,7 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
for attributeKey, attributeValue := range cfg.Attributes {
if asciidocext_config.DisallowedAttributes[attributeKey] {
- a.cfg.Logger.ERROR.Println("Unsupported asciidoctor attribute was passed in. Attribute `" + attributeKey + "` ignored.")
+ a.cfg.Logger.Errorln("Unsupported asciidoctor attribute was passed in. Attribute `" + attributeKey + "` ignored.")
continue
}
@@ -125,7 +125,7 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
destinationDir := a.cfg.Cfg.GetString("destination")
if destinationDir == "" {
- a.cfg.Logger.ERROR.Println("markup.asciidocext.workingFolderCurrent requires hugo command option --destination to be set")
+ a.cfg.Logger.Errorln("markup.asciidocext.workingFolderCurrent requires hugo command option --destination to be set")
}
if !filepath.IsAbs(destinationDir) && sourceDir != "" {
destinationDir = filepath.Join(sourceDir, destinationDir)
@@ -144,14 +144,14 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
if ok {
postDir = filepath.Base(page.RelPermalink())
} else {
- a.cfg.Logger.ERROR.Println("unable to cast interface to pageSubset")
+ a.cfg.Logger.Errorln("unable to cast interface to pageSubset")
}
outDir, err = filepath.Abs(filepath.Join(destinationDir, filepath.Dir(ctx.DocumentName), postDir))
}
if err != nil {
- a.cfg.Logger.ERROR.Println("asciidoctor outDir: ", err)
+ a.cfg.Logger.Errorln("asciidoctor outDir: ", err)
}
args = append(args, "--base-dir", contentDir, "-a", "outdir="+outDir)
@@ -160,7 +160,7 @@ func (a *asciidocConverter) parseArgs(ctx converter.DocumentContext) []string {
if cfg.NoHeaderOrFooter {
args = append(args, "--no-header-footer")
} else {
- a.cfg.Logger.WARN.Println("asciidoctor parameter NoHeaderOrFooter is expected for correct html rendering")
+ a.cfg.Logger.Warnln("asciidoctor parameter NoHeaderOrFooter is expected for correct html rendering")
}
if cfg.SectionNumbers {
@@ -187,7 +187,7 @@ func (a *asciidocConverter) appendArg(args []string, option, value, defaultValue
if allowedValues[value] {
args = append(args, option, value)
} else {
- a.cfg.Logger.ERROR.Println("Unsupported asciidoctor value `" + value + "` for option " + option + " was passed in and will be ignored.")
+ a.cfg.Logger.Errorln("Unsupported asciidoctor value `" + value + "` for option " + option + " was passed in and will be ignored.")
}
}
return args
diff --git a/markup/converter/converter.go b/markup/converter/converter.go
index 63434e045..231527441 100644
--- a/markup/converter/converter.go
+++ b/markup/converter/converter.go
@@ -31,7 +31,7 @@ type ProviderConfig struct {
Cfg config.Provider // Site config
ContentFs afero.Fs
- Logger *loggers.Logger
+ Logger loggers.Logger
Highlight func(code, lang, optsStr string) (string, error)
}
diff --git a/markup/internal/external.go b/markup/internal/external.go
index 2105e7cff..fc7fddb23 100644
--- a/markup/internal/external.go
+++ b/markup/internal/external.go
@@ -25,11 +25,11 @@ func ExternallyRenderContent(
for _, item := range strings.Split(cmderr.String(), "\n") {
item := strings.TrimSpace(item)
if item != "" {
- logger.ERROR.Printf("%s: %s", ctx.DocumentName, item)
+ logger.Errorf("%s: %s", ctx.DocumentName, item)
}
}
if err != nil {
- logger.ERROR.Printf("%s rendering %s: %v", path, ctx.DocumentName, err)
+ logger.Errorf("%s rendering %s: %v", path, ctx.DocumentName, err)
}
return normalizeExternalHelperLineFeeds(out.Bytes())
diff --git a/markup/org/convert.go b/markup/org/convert.go
index 7a3ad7076..34043e18d 100644
--- a/markup/org/convert.go
+++ b/markup/org/convert.go
@@ -47,7 +47,7 @@ type orgConverter struct {
func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, error) {
logger := c.cfg.Logger
config := org.New()
- config.Log = logger.WARN
+ config.Log = logger.Warn()
config.ReadFile = func(filename string) ([]byte, error) {
return afero.ReadFile(c.cfg.ContentFs, filename)
}
@@ -55,7 +55,7 @@ func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e
writer.HighlightCodeBlock = func(source, lang string, inline bool) string {
highlightedSource, err := c.cfg.Highlight(source, lang, "")
if err != nil {
- logger.ERROR.Printf("Could not highlight source as lang %s. Using raw source.", lang)
+ logger.Errorf("Could not highlight source as lang %s. Using raw source.", lang)
return source
}
return highlightedSource
@@ -63,7 +63,7 @@ func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e
html, err := config.Parse(bytes.NewReader(ctx.Src), c.ctx.DocumentName).Write(writer)
if err != nil {
- logger.ERROR.Printf("Could not render org: %s. Using unrendered content.", err)
+ logger.Errorf("Could not render org: %s. Using unrendered content.", err)
return converter.Bytes(ctx.Src), nil
}
return converter.Bytes([]byte(html)), nil
diff --git a/markup/pandoc/convert.go b/markup/pandoc/convert.go
index d6d5ab18c..074e97d96 100644
--- a/markup/pandoc/convert.go
+++ b/markup/pandoc/convert.go
@@ -57,7 +57,7 @@ func (c *pandocConverter) getPandocContent(src []byte, ctx converter.DocumentCon
logger := c.cfg.Logger
path := getPandocExecPath()
if path == "" {
- logger.ERROR.Println("pandoc not found in $PATH: Please install.\n",
+ logger.Println("pandoc not found in $PATH: Please install.\n",
" Leaving pandoc content unrendered.")
return src
}
diff --git a/markup/rst/convert.go b/markup/rst/convert.go
index 64cc8b511..cbc15c81a 100644
--- a/markup/rst/convert.go
+++ b/markup/rst/convert.go
@@ -60,11 +60,11 @@ func (c *rstConverter) getRstContent(src []byte, ctx converter.DocumentContext)
path := getRstExecPath()
if path == "" {
- logger.ERROR.Println("rst2html / rst2html.py not found in $PATH: Please install.\n",
+ logger.Println("rst2html / rst2html.py not found in $PATH: Please install.\n",
" Leaving reStructuredText content unrendered.")
return src
}
- logger.INFO.Println("Rendering", ctx.DocumentName, "with", path, "...")
+ logger.Println("Rendering", ctx.DocumentName, "with", path, "...")
var result []byte
// certain *nix based OSs wrap executables in scripted launchers
// invoking binaries on these OSs via python interpreter causes SyntaxError