diff options
| author | Shulhan <ms@kilabit.info> | 2024-08-13 07:35:12 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-08-13 07:38:35 +0700 |
| commit | b8fdcc2be2fcae1bfd3dd62b8bc2d4abe75e78d0 (patch) | |
| tree | 6572805cdfff4a9fa6c2a17337c977ae4a202674 /attribute_entry.go | |
| parent | 741463b99f14f1869c804cd4c6b15be155a7c27e (diff) | |
| download | asciidoctor-go-b8fdcc2be2fcae1bfd3dd62b8bc2d4abe75e78d0.tar.xz | |
all: rename struct "AttributeEntry" to "DocumentAttribute"
This is to make the struct is clear that it represent the document
attribute.
Diffstat (limited to 'attribute_entry.go')
| -rw-r--r-- | attribute_entry.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/attribute_entry.go b/attribute_entry.go deleted file mode 100644 index 98db699..0000000 --- a/attribute_entry.go +++ /dev/null @@ -1,33 +0,0 @@ -// SPDX-FileCopyrightText: 2020 M. Shulhan <ms@kilabit.info> -// SPDX-License-Identifier: GPL-3.0-or-later - -package asciidoctor - -import "strings" - -// AttributeEntry contains the mapping of global attribute keys in the headers -// with its value. -type AttributeEntry map[string]string - -func newAttributeEntry() AttributeEntry { - return AttributeEntry{ - MetaNameGenerator: `asciidoctor-go ` + Version, - metaNameLastUpdateLabel: `Last updated`, - metaNameLastUpdateValue: ``, - metaNameSectIDs: ``, - metaNameShowTitle: ``, - metaNameTableCaption: ``, - metaNameVersionLabel: ``, - } -} - -func (entry *AttributeEntry) apply(key, val string) { - switch { - case key[0] == '!': - delete(*entry, strings.TrimSpace(key[1:])) - case key[len(key)-1] == '!': - delete(*entry, strings.TrimSpace(key[:len(key)-1])) - default: - (*entry)[key] = val - } -} |
