|
@@ -24,21 +24,29 @@ def files
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-task develop: %w(bundle_install) do
|
|
|
|
|
|
+task develop: %w(bundle_install storyjs) do
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 develop.html"
|
|
sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 develop.html"
|
|
end
|
|
end
|
|
|
|
|
|
-task watch: %w(bundle_install) do
|
|
|
|
|
|
+task watch: %w(bundle_install storyjs) do
|
|
sh 'start watch.html' # FIXME non-windows
|
|
sh 'start watch.html' # FIXME non-windows
|
|
- sh "bundle exec twee2 watch main.tw2 watch.html"
|
|
|
|
|
|
+ sh "bundle exec twee2 watch '--format=#{STORY_FORMAT_PATH}' main.tw2 watch.html"
|
|
end
|
|
end
|
|
|
|
|
|
-task release: %w(bundle_install) do
|
|
|
|
- sh "bundle exec twee2 build main.tw2 release.html"
|
|
|
|
|
|
+task release: %w(bundle_install storyjs) do
|
|
|
|
+ sh "bundle exec twee2 build '--format=#{STORY_FORMAT_PATH}' main.tw2 release.html"
|
|
|
|
+end
|
|
|
|
+
|
|
|
|
+task :storyjs do
|
|
|
|
+ File.write(
|
|
|
|
+ 'storyjs.tw2',
|
|
|
|
+ File.read('storyjs.tw2')\
|
|
|
|
+ .sub(/\$STORY_FORMAT_VERSION = '[^']*'/, "$STORY_FORMAT_VERSION = '#{STORY_FORMAT_VERSION}'")
|
|
|
|
+ )
|
|
end
|
|
end
|
|
|
|
|
|
desc 'export sub files to Twine 2'
|
|
desc 'export sub files to Twine 2'
|
|
-task export: %w(bundle_install) do
|
|
|
|
|
|
+task export: %w(bundle_install storyjs) do
|
|
files.each do |file|
|
|
files.each do |file|
|
|
IO.write file.wrapper_file, <<~EOF
|
|
IO.write file.wrapper_file, <<~EOF
|
|
::StoryTitle
|
|
::StoryTitle
|
|
@@ -48,7 +56,7 @@ task export: %w(bundle_install) do
|
|
@story_start_name = 'Start #{file.long_name}'
|
|
@story_start_name = 'Start #{file.long_name}'
|
|
Twee2::build_config.story_format = '#{STORY_FORMAT}'
|
|
Twee2::build_config.story_format = '#{STORY_FORMAT}'
|
|
Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
|
|
Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
|
|
-
|
|
|
|
|
|
+
|
|
::StoryIncludes
|
|
::StoryIncludes
|
|
images.tw2
|
|
images.tw2
|
|
stylesheet.tw2
|
|
stylesheet.tw2
|