aboutsummaryrefslogtreecommitdiff
path: root/hswg/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-10-06 19:12:42 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-10-08 17:00:55 +0200
commitc3cc608570aa473d8777496e857e69637507da25 (patch)
tree8b4606d6661a1bb188703cfd970022c6fd4c64ec /hswg/main.go
parentd643187333e1318e2fbf6314d07d1f6c6bd54930 (diff)
downloadhaven-c3cc608570aa473d8777496e857e69637507da25.tar.gz
haven-c3cc608570aa473d8777496e857e69637507da25.tar.xz
haven-c3cc608570aa473d8777496e857e69637507da25.zip
hswg: bump libasciidoc to master
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