lib/twee2/story_file.rb in twee2-0.3.3 vs lib/twee2/story_file.rb in twee2-0.4.1
- old
+ new
@@ -1,5 +1,6 @@
+require 'rubygems'
require 'haml'
require 'coffee_script'
require 'sass'
require 'builder'
@@ -87,10 +88,18 @@
end
@story_start_pid = (@passages[@story_start_name] || {pid: 1})[:pid]
# Generate XML in Twine 2 format
@story_data = Builder::XmlMarkup.new
# TODO: what is tw-storydata's "options" attribute for?
- @story_data.tag!('tw-storydata', { name: Twee2::build_config.story_name, startnode: @story_start_pid, creator: 'Twee2', 'creator-version' => Twee2::VERSION, ifid: 'TODO', format: '{{STORY_FORMAT}}', options: '' }) do
+ @story_data.tag!('tw-storydata', {
+ name: Twee2::build_config.story_name,
+ startnode: @story_start_pid,
+ creator: 'Twee2',
+ 'creator-version' => Twee2::VERSION,
+ ifid: Twee2::build_config.story_ifid,
+ format: '{{STORY_FORMAT}}',
+ options: ''
+ }) do
@story_data.style(story_css, role: 'stylesheet', id: 'twine-user-stylesheet', type: 'text/twine-css')
@story_data.script(story_js, role: 'script', id: 'twine-user-script', type: 'text/twine-javascript')
@passages.each do |k,v|
unless v[:exclude_from_output]
@story_data.tag!('tw-passagedata', { pid: v[:pid], name: k, tags: v[:tags].join(' '), position: v[:position] }, v[:content])
\ No newline at end of file