Skip to content

Commit

Permalink
feat(renderer): support 'toc-title' attribute (#918)
Browse files Browse the repository at this point in the history
Parse the `toc-title` attribute value during rendering

Fixes #915

Signed-off-by: Xavier Coulon <[email protected]>
  • Loading branch information
xcoulon authored Jan 30, 2022
1 parent 397035b commit b8f27ce
Show file tree
Hide file tree
Showing 183 changed files with 5,567 additions and 5,277 deletions.
4 changes: 2 additions & 2 deletions cmd/libasciidoc/cmd_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main_test

import (
. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt

"testing"

Expand Down
2 changes: 1 addition & 1 deletion cmd/libasciidoc/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewRootCmd() *cobra.Command {
for _, sourcePath := range args {
out, close := getOut(cmd, sourcePath, outputName)
if out != nil {
defer close() //nolint errcheck
defer close() // nolint errcheck
// log.Debugf("Starting to process file %v", path)
config := configuration.NewConfiguration(
configuration.WithFilename(sourcePath),
Expand Down
4 changes: 2 additions & 2 deletions cmd/libasciidoc/root_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

main "github.com/bytesparadise/libasciidoc/cmd/libasciidoc"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("root cmd", func() {
Expand Down
4 changes: 2 additions & 2 deletions cmd/libasciidoc/version_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

main "github.com/bytesparadise/libasciidoc/cmd/libasciidoc"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("version cmd", func() {
Expand Down
4 changes: 2 additions & 2 deletions libasciidoc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package libasciidoc_test
import (
"testing"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

func TestLibasciidoc(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions libasciidoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/attribute_substitution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("attribute substitutions", func() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/parser/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/ginkgo/extensions/table" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/ginkgo/extensions/table" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("attributes", func() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/parser/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (

"github.com/bytesparadise/libasciidoc/pkg/parser"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/ginkgo/extensions/table" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/ginkgo/extensions/table" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/blank_line_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("blank lines", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/check_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("checked lists", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("comments", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/cross_reference_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("cross references", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_admonition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser_test
import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"
. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("admonition blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("example blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_fenced_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("fenced blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_listing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("listing blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_literal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("literal blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_markdown_quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("markdown-style quote blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_passthrough_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("passthrough blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_quote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("quote blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_sidebar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
. "github.com/bytesparadise/libasciidoc/testsupport"
log "github.com/sirupsen/logrus"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("sidebar blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("source blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/delimited_block_verse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("verse blocks", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_fragment_processing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("document processing", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("headers", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/configuration"
"github.com/bytesparadise/libasciidoc/pkg/types"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("preprocessing condition stack", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_conditionals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/configuration"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
)

var _ = Describe("conditional inclusions", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_preprocessing_include_files_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golintt
log "github.com/sirupsen/logrus"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("include preamble and table of contents when aggregating fragments", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/parser/document_processing_apply_substitutions.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ const (
// Callouts the "callouts" substitution
Callouts string = "callouts"
// InlinePassthroughs the "inline_passthrough" substitution
InlinePassthroughs string = "inline_passthrough" // nolint: gosec
InlinePassthroughs string = "inline_passthrough" // nolint:gosec
// Macros the "macros" substitution
Macros string = "macros"
// None the "none" substitution
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_apply_substitutions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("apply substitutions", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_collect_footnotes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("collect footnotes", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_filter_elements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser
import (
"github.com/bytesparadise/libasciidoc/pkg/types"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("element filters", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_insert_preamble_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser
import (
"github.com/bytesparadise/libasciidoc/pkg/types"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("insert preambles", func() {
Expand Down
4 changes: 2 additions & 2 deletions pkg/parser/document_processing_parse_fragments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"github.com/bytesparadise/libasciidoc/pkg/types"
. "github.com/bytesparadise/libasciidoc/testsupport"

. "github.com/onsi/ginkgo" //nolint golint
. "github.com/onsi/gomega" //nolint golint
. "github.com/onsi/ginkgo" // nolint:golint
. "github.com/onsi/gomega" // nolint:golint
)

var _ = Describe("document fragment parsing", func() {
Expand Down
Loading

0 comments on commit b8f27ce

Please sign in to comment.