aboutsummaryrefslogtreecommitdiff
path: root/hswg/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'hswg/main.go')
-rw-r--r--hswg/main.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/hswg/main.go b/hswg/main.go
index dca9fea..3c7582e 100644
--- a/hswg/main.go
+++ b/hswg/main.go
@@ -23,7 +23,6 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/configuration"
"github.com/bytesparadise/libasciidoc/pkg/parser"
- "github.com/bytesparadise/libasciidoc/pkg/renderer"
"github.com/bytesparadise/libasciidoc/pkg/renderer/sgml/html5"
"github.com/bytesparadise/libasciidoc/pkg/types"
"github.com/bytesparadise/libasciidoc/pkg/validator"
@@ -92,8 +91,7 @@ func Render(r io.Reader, config *configuration.Configuration) (
for _, problem := range problems {
fmt.Fprintln(os.Stderr, problem.Message)
}
- ctx := renderer.NewContext(doc, config)
- meta.Metadata, err = html5.Render(ctx, doc, html)
+ meta.Metadata, err = html5.Render(doc, config, html)
}
if err != nil {
// Fallback: output all the text sanitized for direct inclusion.
@@ -124,7 +122,7 @@ type Entry struct {
// Published returns the date when the entry was published, or nil if unknown.
func (e *Entry) Published() *time.Time {
- if d, ok, err := e.Attributes.GetAsString("date"); !ok || err != nil {
+ if d, ok := e.Attributes.GetAsString("date"); !ok {
return nil
} else if t, err := time.Parse(time.RFC3339, d); err == nil {
return &t
@@ -194,7 +192,7 @@ func renderEntry(name string, e *Entry) error {
configuration.WithFilename(e.PathSource),
configuration.WithLastUpdated(e.mtime),
configuration.WithAttribute("toc", "preamble"),
- configuration.WithAttribute("toc-title", "+++<h2>Contents</h2>+++"),
+ configuration.WithAttribute("toc-title", "<h2>Contents</h2>"),
configuration.WithAttribute("source-highlighter", "chroma"),
)); err != nil {
return err