/* Copyright © 2014–2021 Thomas Michael Edwards. All rights reserved. Use of this source code is governed by a Simplified BSD License which can be found in the LICENSE file. */ package main import ( "bytes" "encoding/json" "log" "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 { Name string `json:"name"` Ifid string `json:"ifid,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"` FormatVersion string `json:"format-version,omitempty"` Creator string `json:"creator,omitempty"` CreatorVersion string `json:"creator-version,omitempty"` Zoom float64 `json:"zoom,omitempty"` /* style script */ Passages []*passageJSON `json:"passages"` } /*