mirror of
https://github.com/tmedwards/tweego.git
synced 2025-07-05 14:10:27 -04:00
Buggy assed GitHub mobile client
This commit is contained in:
parent
a5565f8f3e
commit
0c351725a8
1 changed files with 57 additions and 2 deletions
57
storydata.go
57
storydata.go
|
@ -13,24 +13,78 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"name": "Example",
|
||||||
|
"ifid": "D674C58C-DEFA-4F70-B7A2-27742230C0FC",
|
||||||
|
"format": "Snowman",
|
||||||
|
"format-version": "3.0.2",
|
||||||
|
"start": "My Starting Passage",
|
||||||
|
"tag-colors": {
|
||||||
|
"bar": "Green",
|
||||||
|
"foo": "red",
|
||||||
|
"qaz": "blue"
|
||||||
|
},
|
||||||
|
"zoom": 0.25,
|
||||||
|
"creator": "Twine",
|
||||||
|
"creator-version": "2.8",
|
||||||
|
"style": "",
|
||||||
|
"script": "",
|
||||||
|
"passages": [
|
||||||
|
{
|
||||||
|
"name": "My Starting Passage",
|
||||||
|
"tags": ["tag1", "tag2"],
|
||||||
|
"metadata": {
|
||||||
|
"position":"600,400",
|
||||||
|
"size":"100,200"
|
||||||
|
},
|
||||||
|
"text": "Double-click this passage to edit it."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
*/
|
||||||
type storyJSON struct {
|
type storyJSON struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Ifid string `json:"ifid,omitempty"`
|
Ifid string `json:"ifid,omitempty"`
|
||||||
Start string `json:"start,omitempty"`
|
|
||||||
Options []string `json:"options,omitempty"`
|
Options []string `json:"options,omitempty"`
|
||||||
|
Start string `json:"start,omitempty"`
|
||||||
|
Tags []string `json:"tags,omitempty"`
|
||||||
|
TagColors twine2TagColorsMap `json:"tag-colors,omitempty"`
|
||||||
Format string `json:"format,omitempty"`
|
Format string `json:"format,omitempty"`
|
||||||
FormatVersion string `json:"format-version,omitempty"`
|
FormatVersion string `json:"format-version,omitempty"`
|
||||||
Creator string `json:"creator,omitempty"`
|
Creator string `json:"creator,omitempty"`
|
||||||
CreatorVersion string `json:"creator-version,omitempty"`
|
CreatorVersion string `json:"creator-version,omitempty"`
|
||||||
|
Zoom float64 `json:"zoom,omitempty"`
|
||||||
|
/*
|
||||||
|
style
|
||||||
|
script
|
||||||
|
*/
|
||||||
Passages []*passageJSON `json:"passages"`
|
Passages []*passageJSON `json:"passages"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
<tw-storydata
|
||||||
|
name="${escape(story.name)}"
|
||||||
|
startnode="${startLocalId || ''}"
|
||||||
|
creator="${escape(appInfo.name)}"
|
||||||
|
creator-version="${escape(appInfo.version)}"
|
||||||
|
format="${escape(story.storyFormat)}"
|
||||||
|
format-version="${escape(story.storyFormatVersion)}"
|
||||||
|
ifid="${escape(story.ifid)}"
|
||||||
|
options="${escape(formatOptions)}"
|
||||||
|
tags="${escape(story.tags.join(' '))}"
|
||||||
|
zoom="${escape(story.zoom.toString())}"
|
||||||
|
hidden
|
||||||
|
>
|
||||||
|
*/
|
||||||
|
|
||||||
type storyDataJSON struct {
|
type storyDataJSON struct {
|
||||||
Ifid string `json:"ifid,omitempty"`
|
Ifid string `json:"ifid,omitempty"`
|
||||||
Format string `json:"format,omitempty"`
|
Format string `json:"format,omitempty"`
|
||||||
FormatVersion string `json:"format-version,omitempty"`
|
FormatVersion string `json:"format-version,omitempty"`
|
||||||
Options []string `json:"options,omitempty"`
|
Options []string `json:"options,omitempty"`
|
||||||
Start string `json:"start,omitempty"`
|
Start string `json:"start,omitempty"`
|
||||||
|
Tags []string `json:"tags,omitempty"`
|
||||||
TagColors twine2TagColorsMap `json:"tag-colors,omitempty"`
|
TagColors twine2TagColorsMap `json:"tag-colors,omitempty"`
|
||||||
Zoom float64 `json:"zoom,omitempty"`
|
Zoom float64 `json:"zoom,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -43,6 +97,7 @@ func (s *story) marshalStoryData() []byte {
|
||||||
s.twine2.formatVersion,
|
s.twine2.formatVersion,
|
||||||
twine2OptionsMapToSlice(s.twine2.options),
|
twine2OptionsMapToSlice(s.twine2.options),
|
||||||
s.twine2.start,
|
s.twine2.start,
|
||||||
|
s.twine2.tags,
|
||||||
s.twine2.tagColors,
|
s.twine2.tagColors,
|
||||||
s.twine2.zoom,
|
s.twine2.zoom,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue