@@ -57,24 +57,24 @@ func BuildSectionFragment(sectionName string, pageTemplates []any) *Fragment {
5757// Based on reference: {$155: eid, $176: storyline_name, $66: w, $67: h, $156: layout, $140: float, $159: $270}
5858func NewPageTemplateEntry (eid int , storylineName string , width , height int ) StructValue {
5959 return NewStruct ().
60- SetInt (SymUniqueID , int64 (eid )). // $155 = id
60+ SetInt (SymUniqueID , int64 (eid )). // $155 = id
6161 Set (SymStoryName , SymbolByName (storylineName )). // $176 = story_name ref
62- SetInt (SymWidth , int64 (width )). // $66 = width
63- SetInt (SymHeight , int64 (height )). // $67 = height
64- SetSymbol (SymLayout , SymPage ). // $156 = layout = $326 (page)
65- SetSymbol (SymFloat , SymCenter ). // $140 = float = $320 (center)
66- SetSymbol (SymType , SymContainer ) // $159 = type = $270 (container)
62+ SetInt (SymWidth , int64 (width )). // $66 = width
63+ SetInt (SymHeight , int64 (height )). // $67 = height
64+ SetSymbol (SymLayout , SymPage ). // $156 = layout = $326 (page)
65+ SetSymbol (SymFloat , SymCenter ). // $140 = float = $320 (center)
66+ SetSymbol (SymType , SymContainer ) // $159 = type = $270 (container)
6767}
6868
6969// ContentRef represents a reference to content within a storyline.
7070type ContentRef struct {
71- EID int // Element ID ($155)
72- Type int // Content type symbol ($269=text, $270=container, $271=image, etc.)
73- ContentName string // Name of the content fragment
74- ContentOffset int // Offset within content fragment ($403)
75- Style string // Optional style name
71+ EID int // Element ID ($155)
72+ Type int // Content type symbol ($269=text, $270=container, $271=image, etc.)
73+ ContentName string // Name of the content fragment
74+ ContentOffset int // Offset within content fragment ($403)
75+ Style string // Optional style name
7676 StyleEvents []StyleEventRef // Optional inline style events ($142)
77- Children []any // Optional nested content for containers
77+ Children []any // Optional nested content for containers
7878}
7979
8080// StyleEventRef represents a style event for inline formatting ($142).
@@ -89,8 +89,8 @@ type StyleEventRef struct {
8989// Based on reference: {$155: eid, $157: style, $159: type, $145: {name: content_X, $403: offset}}
9090func NewContentEntry (ref ContentRef ) StructValue {
9191 entry := NewStruct ().
92- SetInt (SymUniqueID , int64 (ref .EID )). // $155 = id
93- SetSymbol (SymType , ref .Type ) // $159 = type
92+ SetInt (SymUniqueID , int64 (ref .EID )). // $155 = id
93+ SetSymbol (SymType , ref .Type ) // $159 = type
9494
9595 if ref .Style != "" {
9696 entry .Set (SymStyle , SymbolByName (ref .Style )) // $157 = style as symbol
@@ -102,7 +102,7 @@ func NewContentEntry(ref ContentRef) StructValue {
102102 for _ , se := range ref .StyleEvents {
103103 ev := NewStruct ().
104104 SetInt (SymOffset , int64 (se .Offset )). // $143 = offset
105- SetInt (SymLength , int64 (se .Length )) // $144 = length
105+ SetInt (SymLength , int64 (se .Length )) // $144 = length
106106 if se .Style != "" {
107107 ev .Set (SymStyle , SymbolByName (se .Style )) // $157 = style
108108 }
@@ -116,8 +116,8 @@ func NewContentEntry(ref ContentRef) StructValue {
116116
117117 // Content reference - nested struct with name and offset
118118 contentRef := map [string ]any {
119- "name" : SymbolByName (ref .ContentName ),
120- "$403" : ref .ContentOffset ,
119+ "name" : SymbolByName (ref .ContentName ),
120+ "$403" : ref .ContentOffset ,
121121 }
122122 entry .Set (SymContent , contentRef ) // $145 = content
123123
@@ -131,11 +131,11 @@ func NewContentEntry(ref ContentRef) StructValue {
131131
132132// StorylineBuilder helps build storyline content incrementally.
133133type StorylineBuilder struct {
134- name string // Storyline name (e.g., "l1")
135- sectionName string // Associated section name (e.g., "c0")
134+ name string // Storyline name (e.g., "l1")
135+ sectionName string // Associated section name (e.g., "c0")
136136 contentEntries []ContentRef
137137 eidCounter int
138- pageTemplateEID int // Separate EID for page template container
138+ pageTemplateEID int // Separate EID for page template container
139139}
140140
141141// NewStorylineBuilder creates a new storyline builder.
@@ -144,8 +144,8 @@ func NewStorylineBuilder(storyName, sectionName string, startEID int) *Storyline
144144 return & StorylineBuilder {
145145 name : storyName ,
146146 sectionName : sectionName ,
147- pageTemplateEID : startEID , // First EID goes to page template
148- eidCounter : startEID + 1 , // Content EIDs start after page template
147+ pageTemplateEID : startEID , // First EID goes to page template
148+ eidCounter : startEID + 1 , // Content EIDs start after page template
149149 }
150150}
151151
0 commit comments