Skip to content

Commit 7b4a239

Browse files
committed
contmeta: render rest of meta data for content, also super / subscript
1 parent d118d08 commit 7b4a239

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

content/content.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,14 @@ func (ct *Content) pageMaker(p *tree.Plan, tabIdx int) {
241241
})
242242
})
243243
}
244+
if !ct.inPDFRender && len(ct.current.Page.Affiliations) > 0 {
245+
tree.Add(p, func(w *core.Text) {
246+
w.SetType(core.TextBodyLarge)
247+
w.Updater(func() {
248+
w.SetText(ct.current.Page.Affiliations)
249+
})
250+
})
251+
}
244252
if !ct.inPDFRender && !ct.current.Page.Date.IsZero() {
245253
tree.Add(p, func(w *core.Text) {
246254
w.SetType(core.TextTitleMedium)
@@ -249,6 +257,14 @@ func (ct *Content) pageMaker(p *tree.Plan, tabIdx int) {
249257
})
250258
})
251259
}
260+
if !ct.inPDFRender && len(ct.current.Page.Abstract) > 0 {
261+
tree.Add(p, func(w *core.Text) {
262+
w.SetType(core.TextBodyLarge)
263+
w.Updater(func() {
264+
w.SetText("<b>Abstract:</b> " + ct.current.Page.Abstract)
265+
})
266+
})
267+
}
252268
tree.Add(p, func(w *core.Frame) {
253269
w.Styler(func(s *styles.Style) {
254270
s.Direction = styles.Column

content/examples/basic/content/button.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
+++
22
Categories = ["Widgets"]
33
Authors = "Bea A. Author<sup>1</sup> and Test Ing Name<sup>2</sup>"
4-
Affiliations = "<sup>1</sup>University of Somwhere <sup>2</sup>University of Elsewhere"
4+
Affiliations = "<sup>1</sup>University of Somewhere <sup>2</sup>University of Elsewhere"
55
Abstract = "The button is an essential element of any GUI framework, with the capability of triggering actions of any sort. Actions are very important because they allow people to actually do something."
6+
Date = "2026-05-01"
67
+++
78

89
A **button** is a [[widget]] that a user can click on to trigger a described action. See [[func button]] for a button [[value binding|bound]] to a function. There are various [[#types]] of buttons.

docs/content/text.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ core.NewText(b).SetText("Hello,\n\tworld!").Styler(func(s *styles.Style) {
4343
s.Font.Family = rich.Monospace
4444
})
4545
```
46+
47+
The `Type` of text provides predefined size values according to the Material 3 standards, with the default being `TextBodyLarge`:
48+
49+
```Go
50+
for _, typ := range core.TextTypesValues() {
51+
s := strcase.ToSentence(typ.String())
52+
core.NewText(b).SetType(typ).SetText(s)
53+
}
54+
```
55+

0 commit comments

Comments
 (0)