forked from mmarkdown/mmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtitle.go
105 lines (90 loc) · 2.09 KB
/
title.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
package mast
import (
"time"
"github.com/gomarkdown/markdown/ast"
"github.com/mmarkdown/mmark/v2/mast/reference"
)
// Title represents the TOML encoded title block.
type Title struct {
ast.Leaf
*TitleData
}
// NewTitle returns a pointer to TitleData with some defaults set.
func NewTitle() *Title {
t := &Title{
TitleData: &TitleData{
Area: "Internet",
Ipr: "trust200902",
Consensus: true,
IndexInclude: true,
},
}
return t
}
// TitleData holds all the elements of the title.
type TitleData struct {
Title string
Abbrev string
SeriesInfo reference.SeriesInfo
IndexInclude bool
Consensus bool
TocDepth int
Ipr string // See https://tools.ietf.org/html/rfc7991#appendix-A.1
Obsoletes []int
Updates []int
Links []Link
SubmissionType string // IETF, IAB, IRTF or independent, defaults to IETF.
Date time.Time
Area string
Workgroup string
Keyword []string
Author []Author
Contact []Contact
Language string
}
type Link struct {
Href string
Rel string
}
// Author denotes an RFC author.
type Author struct {
Initials string
Surname string
Fullname string
Organization string
OrganizationAbbrev string `toml:"abbrev"`
Role string
ASCII string
Address Address
}
// Contact denotes an RFC contact.
type Contact Author
// Address denotes the address of an RFC author.
type Address struct {
Phone string
Email string
URI string
Postal AddressPostal
Emails []string // Plurals when these need to be specified multiple times.
}
// AddressPostal denotes the postal address of an RFC author.
type AddressPostal struct {
Street string
City string
CityArea string
Code string
Country string
ExtAddr string
Region string
PoBox string
PostalLine []string
// Plurals when these need to be specified multiple times.
Streets []string
Cities []string
CityAreas []string
Codes []string
Countries []string
Regions []string
PoBoxes []string
ExtAddrs []string
}