twee2 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80fdeb6e878761f0e195156ed16776fdc086b1cf
4
- data.tar.gz: 575b4e716c1b2594c9cde614b221403541a759e6
3
+ metadata.gz: 5398fec3430c5139d62f6d413df6481fbb125e8c
4
+ data.tar.gz: f78a473f5417d415893d0ce53cc22e7c115d736b
5
5
  SHA512:
6
- metadata.gz: 55b0a31d371fa8cfc7ddb4a96f98d970670aa6080f8eecf929f5f079d5ebac9d5e4b6242b97a23838f632025d208094396c716a6753b810bd6026ce13bcd97ef
7
- data.tar.gz: 4e54befc3dac3dcaa6a5d92b318230c590b84a9916847a1abb2887bdde3c13697f05b632d576b56c8c10393f720435bcc108914a911e36135a1143b36c51a082
6
+ metadata.gz: 2109f1466112cde4ab400d26e463d92480d8926bd0183d49a7e7a1e196eff0e9371c932a1601c1058fe8f0ffa9bf44183d3049e882fb6113efe676aa9e047153
7
+ data.tar.gz: 0b020b7a8e362aefd5c3a094b5551cf0e329d364cb911cc19d2dec69d21d6b929df4f99c74ad7724b9a91e92f2b8463efc55b5256c0ca9ecbce6aec32c9f17ae
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Twee2
2
2
 
3
- Command-line tool to compile Twee-style (.tw, .twine) interactive fiction source files to Twine 2-style (non-Tiddlywiki) output.
3
+ Command-line tool to compile Twee-style (.tw, .twine) interactive fiction source files to [Twine 2](http://twinery.org/)-style output. Use your favourite text editor to write Twine 2 interactive fiction.
4
4
 
5
- Designed for those who preferred the Twee (for Twine 1) approach to source management, because the command-line is awesome, but who want to take advantage of the new features in Twine 2. Note that this is NOT a Twine 1 to Twine 2 converter, although parts of its functionality go some way to achieving this goal.
5
+ Designed for those who preferred the Twee approach to source management, because the command-line is awesome, but who want to take advantage of the new features in Twine 2. With a little work, this tool may also function as a partial Twine 1 to Twine 2 converter.
6
+
7
+ For installation and usage, see https://avapoet.github.io/twee2/
6
8
 
7
9
  ## Philosophy
8
10
 
@@ -10,13 +12,7 @@ Designed for those who preferred the Twee (for Twine 1) approach to source manag
10
12
 
11
13
  I love the direction that Twine 2 has been going in, in regard to ditching the old Tiddlywiki backend and making it easier than ever for developers to integrate their own CSS and Javascript into their stories. However, as a fan of plain-old text editors and not of IDEs, I'm not so keen on the fact that it's now almost-impossible to develop a Twine adventure from the command-line only (there's no "Twee" equivalent for Twine 2). For my own benefit and enjoyment, I aim to fill that gap. If it helps you too, then that's just a bonus.
12
14
 
13
- Right now Twee2 doesn't even support the diversity of original Twee, and it's possible that it never will. As the need arises, though, I may add additional features that seemed to be 'missing' from Twee, to me.
14
-
15
- I'd love to hear your thoughts about the future of this gem.
16
-
17
- ## Prerequisites
18
-
19
- You'll need Ruby. Instructions on easily installing it on MacOS, Windows, and Linux can be found at https://www.ruby-lang.org/en/documentation/installation/.
15
+ I'd love to hear your thoughts about the future of this gem. Pull requests are also welcome.
20
16
 
21
17
  ## Installation
22
18
 
@@ -24,11 +20,9 @@ Install using gem
24
20
 
25
21
  gem install twee2
26
22
 
27
- ## Usage
28
-
29
- To see usage examples and fuller instructions (documentation on this page is lacking, but as-yet no documentation is complete):
23
+ * [Full installation instructions](https://avapoet.github.io/twee2/install.html).
30
24
 
31
- twee2
25
+ ## Basic Usage
32
26
 
33
27
  To compile a Twee file into a HTML file using the default format (Harlowe):
34
28
 
@@ -38,80 +32,25 @@ To use a specific format, e.g. Snowman:
38
32
 
39
33
  twee2 build inputfile.twee outputfile.html --format=Snowman
40
34
 
41
- For additional features (e.g. listing known formats, watch-for-changes mode), run twee2 without any parameters.
35
+ For additional features (e.g. listing known formats, watch-for-changes mode), run twee2 without any parameters. Or see the full documentation at https://avapoet.github.io/twee2/documentation.html.
42
36
 
43
37
  ## Special features
44
38
 
45
- Aside from the regular Twee features, Twee2 provides the following enhancements:
46
-
47
- ### Multi-file inclusion (super-experimental)
48
-
49
- You can combine multiple input files into one via either (or both!) of two different methods:
50
-
51
- #### StoryIncludes
52
-
53
- Borrowed from Twee: simply list the files to include in the special StoryIncludes passage. Each will be appended to the end of your source file on compilation.
54
-
55
- ```
56
- ::StoryIncludes
57
- my-sub-story.tw2
58
- ```
59
-
60
- Looking for something more-powerful? Use ::@include-syntax, e.g.:
61
-
62
- ```
63
- ::IncompleteRoom [haml]
64
- %p
65
- This room is incomplete. Come back later.
66
- :coffeescript
67
- ::@include incomplete-room-js.coffee
68
- ```
69
-
70
- The requested file will be nested directly in place. Indent levels will be preserved, which makes it safe for use within HAML, Coffeescript, and SASS. This makes it easy to re-use content throughout your story by simply inserting it in multiple places.
71
-
72
- ### HAML support
73
-
74
- You can declare your passages using [HAML markup](http://haml.info/docs/yardoc/file.REFERENCE.html) by applying a 'haml' tag to the passage, e.g.:
75
-
76
- ```
77
- ::DarkCorridor [haml]
78
- %p
79
- The floorboards creak beneath your feet as you creep into the darkness of the corridor.
80
- ```
81
-
82
- ### Coffeescript
83
-
84
- If you'd rather write your Javascript in [Coffeescript](http://coffeescript.org/) style, just use a HAML ':coffeescript' block or tag your 'script' block with 'coffee':
85
-
86
- ```
87
- ::MyJavascripts [coffee script]
88
- $ ->
89
- alert 'Welcome to my game!'
90
- ```
91
-
92
- ### SASS/SCSS stylesheets
93
-
94
- Prefer SASS for your stylesheets? Just use a 'sass' or 'scss' tag alongside your 'stylesheet' tag, or use a :sass or :scss block in HAML:
39
+ Aside from the obvious benefits of a "use your own editor" solution, Twee2 provides the following enhancements over Twine 2:
95
40
 
96
- ```
97
- ::MyStylesheet [scss stylesheet]
98
- body {
99
- color: #eee;
100
- }
101
- tw-passage {
102
- tw-link {
103
- color: red;
104
- }
105
- }
106
- ```
41
+ * Multi-file inclusion - spread your work over multiple files to improve organisation, facilitate better source control, collaborate with others, or make re-usable modules.
42
+ * [HAML](http://haml.info/) support - for those who prefer HAML to Markdown, and for advanced embedding of scripting into passages.
43
+ * [Coffeescript](http://coffeescript.org/) transpiler - optionally write your Javascript in Coffeescript for a smarter, lighter syntax.
44
+ * [SASS/SCSS](http://sass-lang.com/) stylesheets - optionally enhance your CSS with syntactic awesome.
45
+ * Ruby-powered dynamic generation - automate parts of your build chain (e.g. how about a procedurally-built maze of twisty little passages... or even something actually *good*) with Ruby scripting
46
+ * Twine 2 decompilation - reverse-engineer Twine 2 stories into Twee2 source code to convert your projects or to understand other people's.
107
47
 
108
48
  ## Notes
109
49
 
110
- * This is not a Twee to Harlowe converter. You'll still need to change your macros as described at http://twine2.neocities.org/, and/or rewrite them as Javascript code.
111
- * Some special story segments (e.g. StorySubtitle) are ignored. You will be warned when this happens.
112
- * The HTML files that are produced by this can not be readily re-opened by Twine 2 (I think it's because of the missing passage coordinate data).
113
- * Seriously: this is very-much an experiment and you probably shouldn't use it.
50
+ * This is not a Twee to Harlowe converter. You'll still need to change your macros as described at http://twine2.neocities.org/, and/or rewrite them as Javascript code. However, it might help your efforts to update Twee sources to Twine 2 output.
51
+ * Some special story segments (e.g. StorySubtitle) used in Twee 1 are ignored. You will be warned when this happens.
52
+ * The Twine 2 editor might not be able to re-open stories compiled using Twee2, because Twee2 does not automatically include positional data used by the visual editor (however, you can add this manually if you like).
114
53
 
115
54
  ## License
116
55
 
117
- This code is released under the GPL, version 2. It includes code (in the storyFormats directory) by other authors, including Leon Arnott: please read their licenses before redistributing.
56
+ This code is released under the GPL, version 2. It includes code (in the storyFormats directory) by other authors, including Leon Arnott: please read their licenses before redistributing.
@@ -28,6 +28,16 @@ module Twee2
28
28
  exit
29
29
  end
30
30
  end
31
+ # Load story format, if for some reason Twee2::build_config.story_format is set to a string rather than an instance
32
+ if build_config.story_format.is_a?(String)
33
+ new_format = build_config.story_format
34
+ begin
35
+ build_config.story_format = StoryFormat::new(new_format)
36
+ rescue StoryFormatNotFoundException
37
+ puts "ERROR: story format '#{new_format}' not found."
38
+ exit
39
+ end
40
+ end
31
41
  # Warn if IFID not specified
32
42
  if !build_config.story_ifid_specified
33
43
  puts "NOTICE: You haven't specified your IFID. Consider adding to your code -"
@@ -1,3 +1,3 @@
1
1
  module Twee2
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -8,8 +8,8 @@
8
8
  </title>
9
9
  <meta content='IE=edge' http-equiv='X-UA-Compatible'>
10
10
  <meta content='width=device-width, initial-scale=1' name='viewport'>
11
- <link href="/stylesheets/all.css" rel="stylesheet" />
12
- <script src="/javascripts/all.js"></script>
11
+ <link href='stylesheets/all.css' rel='stylesheet'>
12
+ <script src='javascripts/all.js'></script>
13
13
  </head>
14
14
  <body>
15
15
  <div class='navbar navbar-default navbar-static-top'>
@@ -8,8 +8,8 @@
8
8
  </title>
9
9
  <meta content='IE=edge' http-equiv='X-UA-Compatible'>
10
10
  <meta content='width=device-width, initial-scale=1' name='viewport'>
11
- <link href="/stylesheets/all.css" rel="stylesheet" />
12
- <script src="/javascripts/all.js"></script>
11
+ <link href='stylesheets/all.css' rel='stylesheet'>
12
+ <script src='javascripts/all.js'></script>
13
13
  </head>
14
14
  <body>
15
15
  <div class='navbar navbar-default navbar-static-top'>
@@ -8,8 +8,8 @@
8
8
  </title>
9
9
  <meta content='IE=edge' http-equiv='X-UA-Compatible'>
10
10
  <meta content='width=device-width, initial-scale=1' name='viewport'>
11
- <link href="/stylesheets/all.css" rel="stylesheet" />
12
- <script src="/javascripts/all.js"></script>
11
+ <link href='stylesheets/all.css' rel='stylesheet'>
12
+ <script src='javascripts/all.js'></script>
13
13
  </head>
14
14
  <body>
15
15
  <div class='navbar navbar-default navbar-static-top'>
@@ -8,8 +8,8 @@
8
8
  </title>
9
9
  <meta content='IE=edge' http-equiv='X-UA-Compatible'>
10
10
  <meta content='width=device-width, initial-scale=1' name='viewport'>
11
- <link href="/stylesheets/all.css" rel="stylesheet" />
12
- <script src="/javascripts/all.js"></script>
11
+ <link href='stylesheets/all.css' rel='stylesheet'>
12
+ <script src='javascripts/all.js'></script>
13
13
  </head>
14
14
  <body>
15
15
  <div class='navbar navbar-default navbar-static-top'>
@@ -7,8 +7,8 @@
7
7
  = " | #{current_page.data.title}" if current_page.data.title
8
8
  %meta{'http-equiv' => 'X-UA-Compatible', content: 'IE=edge'}
9
9
  %meta{name: 'viewport', content: 'width=device-width, initial-scale=1'}
10
- = stylesheet_link_tag 'all'
11
- = javascript_include_tag 'all'
10
+ %link{href: 'stylesheets/all.css', rel: 'stylesheet'}/
11
+ %script{src: 'javascripts/all.js'}
12
12
  %body
13
13
  .navbar.navbar-default.navbar-static-top
14
14
  .container
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twee2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Q
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -373,7 +373,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  version: '0'
374
374
  requirements: []
375
375
  rubyforge_project:
376
- rubygems_version: 2.2.2
376
+ rubygems_version: 2.4.3
377
377
  signing_key:
378
378
  specification_version: 4
379
379
  summary: Command-line tool to compile Twee-style (.tw, .twine) interactive fiction