|
@@ -24,21 +24,29 @@ def files
|
|
|
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"
|
|
|
end
|
|
|
|
|
|
-task watch: %w(bundle_install) do
|
|
|
+task watch: %w(bundle_install storyjs) do
|
|
|
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
|
|
|
|
|
|
-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
|
|
|
|
|
|
desc 'export sub files to Twine 2'
|
|
|
-task export: %w(bundle_install) do
|
|
|
+task export: %w(bundle_install storyjs) do
|
|
|
files.each do |file|
|
|
|
IO.write file.wrapper_file, <<~EOF
|
|
|
::StoryTitle
|
|
@@ -48,7 +56,7 @@ task export: %w(bundle_install) do
|
|
|
@story_start_name = 'Start #{file.long_name}'
|
|
|
Twee2::build_config.story_format = '#{STORY_FORMAT}'
|
|
|
Twee2::build_config.story_format_version = '#{STORY_FORMAT_VERSION}'
|
|
|
-
|
|
|
+
|
|
|
::StoryIncludes
|
|
|
images.tw2
|
|
|
stylesheet.tw2
|