` element within a single passage.
6 |
7 | Other Google Fonts could be imported and applied using the same method, creating new class or ID style rules to be applied for and across different HTML elements in the same way.
8 |
9 | ## Example
10 |
11 | [Download](snowman_googlefonts_example.html){: target="_top" download="snowman_googlefonts_example.html"}
12 |
13 | ## Twee Code
14 |
15 | ```twee
16 | :: StoryTitle
17 | Snowman: Google Fonts
18 |
19 | :: StoryStylesheet[stylesheet]
20 | @import url('https://fonts.googleapis.com/css?family=Roboto');
21 |
22 | .message {
23 | font-family: 'Roboto', sans-serif;
24 | }
25 |
26 | :: Start
27 |
28 |
29 | ```
30 |
31 | [Twee Download](snowman_googlefonts_twee.txt){ target="_top" download="snowman_googlefonts_twee.txt"}
32 |
--------------------------------------------------------------------------------
/pages/googlefonts/snowman/snowman_googlefonts_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Google Fonts
3 |
4 | :: StoryStylesheet[stylesheet]
5 | @import url('https://fonts.googleapis.com/css?family=Roboto');
6 |
7 | .message {
8 | font-family: 'Roboto', sans-serif;
9 | }
10 |
11 | :: Start
12 |
13 |
--------------------------------------------------------------------------------
/pages/googlefonts/sugarcane/sugarcane_googlefonts_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Responsive: Google Fonts
3 |
4 | :: StoryAuthor
5 | @videlais
6 |
7 | :: StoryStylesheet [stylesheet]
8 | @import url('https://fonts.googleapis.com/css?family=Roboto');
9 |
10 | .message {
11 | font-family: 'Roboto', sans-serif;
12 | }
13 |
14 | :: Start
15 |
16 |
--------------------------------------------------------------------------------
/pages/googlefonts/sugarcube/sugarcube_googlefonts.md:
--------------------------------------------------------------------------------
1 | # "Google Fonts": SugarCube (v2.18)
2 |
3 | ## Summary
4 |
5 | "Google Fonts" uses a [Google Font](https://fonts.google.com/) loaded via the CSS **@import** at-rule. A class style rule ("message") is then created using the imported font-family and applied to a `
` element within a single passage.
6 |
7 | Other Google Fonts could be imported and applied using the same method, creating new class or ID style rules to be applied for and across different HTML elements in the same way.
8 |
9 | ## Example
10 |
11 | [Download](sugarcube_googlefonts_example.html){: target="_top" download="sugarcube_googlefonts_example.html"}
12 |
13 | ## Twee Code
14 |
15 | ```twee
16 | :: StoryTitle
17 | SugarCube: Google Fonts
18 |
19 | :: StoryStylesheet[stylesheet]
20 | @import url('https://fonts.googleapis.com/css?family=Roboto');
21 |
22 | .message {
23 | font-family: 'Roboto', sans-serif;
24 | }
25 |
26 | :: Start
27 |
This text is styled using a Google Font
28 |
29 | ```
30 |
31 | [Twee Download](sugarcube_googlefonts_twee.txt){ target="_top" download="sugarcube_googlefonts_twee.txt"}
32 |
--------------------------------------------------------------------------------
/pages/googlefonts/sugarcube/sugarcube_googlefonts_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Google Fonts
3 |
4 | :: StoryStylesheet[stylesheet]
5 | @import url('https://fonts.googleapis.com/css?family=Roboto');
6 |
7 | .message {
8 | font-family: 'Roboto', sans-serif;
9 | }
10 |
11 | :: Start
12 |
This text is styled using a Google Font
13 |
--------------------------------------------------------------------------------
/pages/headersandfooters/chapbook/chapbook_headersandfooters.md:
--------------------------------------------------------------------------------
1 | # "Headers and Footers": Chapbook (v1.0.0)
2 |
3 | ## Summary
4 |
5 | Chapbook provides two global variables, [*config.header* and *config.footer*](https://klembot.github.io/chapbook/guide/customization/header-and-footer.html), that each have the properties *left*, *right*, and *center*. When set, these properties show their content as the header or footer in the particular position matching its property name.
6 |
7 | ## Example
8 |
9 | [Download](chapbook_headersandfooters_example.html){: target="_top" download="chapbook_headersandfooters_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Chapbook: Header and Footer
16 |
17 | :: Start
18 | config.header.center: "This is the header!"
19 | config.footer.center: "This is the footer!"
20 | --
21 | This is content.
22 | ```
23 |
24 | [Twee Download](chapbook_headersandfooters_twee.txt){ target="_top" download="chapbook_headersandfooters_twee.txt"}
25 |
--------------------------------------------------------------------------------
/pages/headersandfooters/chapbook/chapbook_headersandfooters_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Header and Footer
3 |
4 | :: Start
5 | config.header.center: "This is the header!"
6 | config.footer.center: "This is the footer!"
7 | --
8 | This is content.
9 |
--------------------------------------------------------------------------------
/pages/headersandfooters/harlowe/harlowe_headersandfooters.md:
--------------------------------------------------------------------------------
1 | # "Headers and Footers": Harlowe (v2.0)
2 |
3 | ## Summary
4 |
5 | "Headers and Footers" demonstrates the use of the ["header" and "footer" passage tags](https://twine2.neocities.org/#passagetag_header). When used in passages, they are either prepended (header) or appended (footer) to every passage. Multiple passages can have the tags and are loaded alphabetically when detected.
6 |
7 | ## Example
8 |
9 | [Download](harlowe_headersandfooters_example.html){: target="_top" download="harlowe_headersandfooters_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Harlowe: Headers and Footers
16 |
17 | :: Start
18 | This is content between the header and the footer.
19 |
20 |
21 | :: Header[header]
22 | This is the header!
23 |
24 |
25 | :: Footer[footer]
26 | This is the footer!
27 | ```
28 |
29 | [Twee Download](harlowe_headersandfooters_twee.txt){ target="_top" download="harlowe_headersandfooters_twee.txt"}
30 |
--------------------------------------------------------------------------------
/pages/headersandfooters/harlowe/harlowe_headersandfooters_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Headers and Footers
3 |
4 | :: Start
5 | This is content between the header and the footer.
6 |
7 |
8 | :: Header[header]
9 | This is the header!
10 |
11 |
12 | :: Footer[footer]
13 | This is the footer!
14 |
15 |
--------------------------------------------------------------------------------
/pages/headersandfooters/snowman/snowman_headersandfooters_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Headers and Footers
3 |
4 | :: Start
5 | <%= window.story.render("Header") %>
6 |
7 | This content is between the header and the footer.
8 |
9 | <%= window.story.render("Footer") %>
10 |
11 | :: Header
12 | This is the header!
13 |
14 | :: Footer
15 | This is the footer!
16 |
--------------------------------------------------------------------------------
/pages/headersandfooters/sugarcube/sugarcube_headersandfooters.md:
--------------------------------------------------------------------------------
1 | # "Headers and Footers": Sugarcube (v2.18)
2 |
3 | ## Summary
4 |
5 | "Headers and Footers" demonstrates the use of "[PassageHeader](http://www.motoslave.net/sugarcube/2/docs/special-names.html#special-passages-passageheader)" and "[PassageFooter](http://www.motoslave.net/sugarcube/2/docs/special-names.html#special-passages-passagefooter)" special names for passages. When these special names are used, the 'Header' is prepended and the 'Footer' name is appended to all passages.
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_headersandfooters_example.html){: target="_top" download="sugarcube_headersandfooters_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | SugarCube: Headers and Footers
16 |
17 | :: Start
18 | This is content between the header and the footer.
19 |
20 | :: PassageHeader
21 | This is the header!
22 |
23 | :: PassageFooter
24 | This is the footer!
25 |
26 | ```
27 |
28 | [Twee Download](sugarcube_headersandfooters_twee.txt){ target="_top" download="sugarcube_headersandfooters_twee.txt"}
29 |
30 | ## See Also
31 |
32 | [Passage Events](../../passageevents/sugarcube/sugarcube_passage_events.md)
33 |
--------------------------------------------------------------------------------
/pages/headersandfooters/sugarcube/sugarcube_headersandfooters_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Headers and Footers
3 |
4 | :: Start
5 | This is content between the header and the footer.
6 |
7 |
8 | :: PassageHeader
9 | This is the header!
10 |
11 |
12 | :: PassageFooter
13 | This is the footer!
14 |
15 |
--------------------------------------------------------------------------------
/pages/html/storyformats/snowman.md:
--------------------------------------------------------------------------------
1 | # Snowman HTML
2 |
3 | Snowman uses a variety of HTML elements and attributes to organize its stories.
4 |
5 | The following are snapshots of HTML element differences between major versions in Snowman.
6 |
7 | ## Snowman 1.X
8 |
9 | ```html
10 |
11 |
12 |
13 |
Double-click this passage to edit it.
14 |
15 |
16 |
17 | ```
18 |
19 | ## Snowman 2.X
20 |
21 | ```html
22 |
23 |
24 |
25 | Double-click this passage to edit it.
26 |
27 |
28 |
29 | ```
30 |
--------------------------------------------------------------------------------
/pages/importexternaljs/harlowe/harlowe_importexternaljs_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Importing External JavaScript
3 |
4 |
5 | :: UserScript [script]
6 | /* import jQuery UI library. */
7 | $(function () {
8 | $.getScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js",
9 | function (data, textStatus, jqxhr) {
10 | console.log('jquery ui file loaded');
11 | }
12 | );
13 | });
14 |
15 |
16 | :: Start
17 |
Click on the grey box below to see it bounce.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/pages/importexternaljs/snowman/snowman_importexternaljs_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Importing External JavaScript
3 |
4 |
5 | :: UserScript [script]
6 | /* import jQuery UI library. */
7 | $(function () {
8 | $.getScript("https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js",
9 | function (data, textStatus, jqxhr) {
10 | console.log('jquery ui file loaded');
11 | }
12 | );
13 | });
14 |
15 |
16 | :: Start
17 |
Click on the grey box below to see it bounce.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/pages/importexternaljs/sugarcube/sugarcube_importexternaljs_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Importing External JavaScript
3 |
4 |
5 | :: UserScript [script]
6 | /* import jQuery UI library. */
7 | importScripts("https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js");
8 |
9 |
10 | :: Start
11 |
Click on the grey box below to see it bounce.
12 |
13 |
14 | <>
--------------------------------------------------------------------------------
/pages/introduction/images/AddAFormat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/AddAFormat.png
--------------------------------------------------------------------------------
/pages/introduction/images/AddPassage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/AddPassage.png
--------------------------------------------------------------------------------
/pages/introduction/images/Archive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Archive.png
--------------------------------------------------------------------------------
/pages/introduction/images/CurrentStoryFormats.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/CurrentStoryFormats.png
--------------------------------------------------------------------------------
/pages/introduction/images/DebugHarlowe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/DebugHarlowe.png
--------------------------------------------------------------------------------
/pages/introduction/images/DebugSnowman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/DebugSnowman.png
--------------------------------------------------------------------------------
/pages/introduction/images/DebugSugarCube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/DebugSugarCube.png
--------------------------------------------------------------------------------
/pages/introduction/images/FindAndReplace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/FindAndReplace.png
--------------------------------------------------------------------------------
/pages/introduction/images/FindAndReplace_Button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/FindAndReplace_Button.png
--------------------------------------------------------------------------------
/pages/introduction/images/Formats.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Formats.png
--------------------------------------------------------------------------------
/pages/introduction/images/Help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Help.png
--------------------------------------------------------------------------------
/pages/introduction/images/ImportFromFile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/ImportFromFile.png
--------------------------------------------------------------------------------
/pages/introduction/images/Language.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Language.png
--------------------------------------------------------------------------------
/pages/introduction/images/LanguageChoice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/LanguageChoice.png
--------------------------------------------------------------------------------
/pages/introduction/images/OpenStoryMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/OpenStoryMenu.png
--------------------------------------------------------------------------------
/pages/introduction/images/PassageTitles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/PassageTitles.png
--------------------------------------------------------------------------------
/pages/introduction/images/PassageView.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/PassageView.png
--------------------------------------------------------------------------------
/pages/introduction/images/PlayStory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/PlayStory.png
--------------------------------------------------------------------------------
/pages/introduction/images/PlusStory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/PlusStory.png
--------------------------------------------------------------------------------
/pages/introduction/images/ProofCopy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/ProofCopy.png
--------------------------------------------------------------------------------
/pages/introduction/images/ProofingFormats.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/ProofingFormats.png
--------------------------------------------------------------------------------
/pages/introduction/images/QuickFind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/QuickFind.png
--------------------------------------------------------------------------------
/pages/introduction/images/RemainingSpace.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/RemainingSpace.png
--------------------------------------------------------------------------------
/pages/introduction/images/Rename.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Rename.png
--------------------------------------------------------------------------------
/pages/introduction/images/ReturnStoryList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/ReturnStoryList.png
--------------------------------------------------------------------------------
/pages/introduction/images/SidebarMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/SidebarMenu.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryFormats.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryFormats.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryJavaScript.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryJavaScript.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryList.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryList.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryMenu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryMenu.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryStatistics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryStatistics.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryStructure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryStructure.png
--------------------------------------------------------------------------------
/pages/introduction/images/StoryStylesheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/StoryStylesheet.png
--------------------------------------------------------------------------------
/pages/introduction/images/TestStory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/TestStory.png
--------------------------------------------------------------------------------
/pages/introduction/images/Theme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/Theme.png
--------------------------------------------------------------------------------
/pages/introduction/images/TitlesAndExcerpts.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/TitlesAndExcerpts.png
--------------------------------------------------------------------------------
/pages/introduction/images/VersionAndBug.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/VersionAndBug.png
--------------------------------------------------------------------------------
/pages/introduction/images/introduction-color-spacing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/introduction-color-spacing.png
--------------------------------------------------------------------------------
/pages/introduction/images/introduction-passage-title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/introduction-passage-title.png
--------------------------------------------------------------------------------
/pages/introduction/images/introduction-tag-colors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/introduction/images/introduction-tag-colors.png
--------------------------------------------------------------------------------
/pages/js/storyformats/harlowe.md:
--------------------------------------------------------------------------------
1 | # Harlowe JavaScript
2 |
3 | Harlowe provides many [macros](https://twine2.neocities.org/#markup_macro) for editing how content is displayed or used in a story.
4 |
5 | The Harlowe documentation purposely does not include instructions for editing or changing the JavaScript code or related values used in the story format.
6 |
7 | It is *strongly recommended* to not change the JavaScript code or any of its values in Harlowe.
8 |
--------------------------------------------------------------------------------
/pages/js/storyformats/sugarcube.md:
--------------------------------------------------------------------------------
1 | # SugarCube JavaScript
2 |
3 | The SugarCube documentation provides details for using [Scripting Macros](https://www.motoslave.net/sugarcube/2/docs/#macros-scripting) with JavaScript code. It also provides multiple application programming interfaces (APIs) for using JavaScript with its own built-in functionality.
4 |
5 | ## `window.setup`
6 |
7 | When working with [Story JavaScript](../../introduction/twine2_passages_view.md#edit-story-javascript), it is strongly recommended, to use the [**setup**](https://www.motoslave.net/sugarcube/2/docs/#special-variable-setup) object in SugarCube to add functionality.
8 |
9 | ```javascript
10 | window.setup = window.setup || {};
11 | ```
12 |
13 | ## SugarCube Addons
14 |
15 | Working with [SugarCube Addons](https://www.motoslave.net/sugarcube/2/) requires using Story JavaScript. The provided instructions with the addon often require copying and pasting code into this area or configuring other options.
16 |
--------------------------------------------------------------------------------
/pages/keyboard/chapbook/chapbook_keyboard_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Keyboard
3 |
4 | :: UserScript[script]
5 | (function () {
6 | document.addEventListener('keyup', function (ev) {
7 | /* the ev variable contains a keyup event object.
8 | *
9 | * ev.keyCode - contains the ASCII code of the key that was released, this property is supported in effectively all browsers.
10 | * ev.key - contains the key value of the key that was released, this property is supported by most modern browsers.
11 | *
12 | */
13 |
14 | /* the following shows an alert when the 'a' key is released. */
15 | if (ev.key === 'a') {
16 | alert("the 'a' key was released.");
17 | }
18 | });
19 | }());
20 |
21 |
22 | :: Start
23 | Press and release the ''a'' key to show an Alert dialog.
24 |
--------------------------------------------------------------------------------
/pages/keyboard/harlowe/harlowe_keyboard_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Keyboard
3 |
4 |
5 | :: UserScript[script]
6 | (function () {
7 | $(document).on('keyup', function (ev) {
8 | /* the ev variable contains a keyup event object.
9 | *
10 | * ev.keyCode - contains the ASCII code of the key that was released, this property is supported in effectively all browsers.
11 | * ev.key - contains the key value of the key that was released, this property is supported by most modern browsers.
12 | *
13 | */
14 |
15 |
16 | /* the following shows an alert when the 'a' key is released. */
17 | if (ev.key === 'a') {
18 | alert("the 'a' key was released.");
19 | }
20 | });
21 | }());
22 |
23 |
24 | :: Start
25 | Press and release the ''a'' key to show an Alert dialog.
26 |
--------------------------------------------------------------------------------
/pages/keyboard/snowman/snowman_keyboard_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Keyboard
3 |
4 |
5 | :: UserScript[script]
6 | (function () {
7 | $(document).on('keyup', function (ev) {
8 | /* the ev variable contains a keyup event object.
9 | *
10 | * ev.keyCode - contains the ASCII code of the key that was released, this property is supported in effectively all browsers.
11 | * ev.key - contains the key value of the key that was released, this property is supported by most modern browsers.
12 | *
13 | */
14 |
15 |
16 | /* the following shows an alert when the 'a' key is released. */
17 | if (ev.key === 'a') {
18 | alert("the 'a' key was released.");
19 | }
20 | });
21 | }());
22 |
23 |
24 | :: Start
25 | Press and release the ''a'' key to show an Alert dialog.
26 |
--------------------------------------------------------------------------------
/pages/keyboard/sugarcube/sugarcube_keyboard_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Keyboard
3 |
4 | :: UserScript[script]
5 | (function () {
6 | $(document).on('keyup', function (ev) {
7 | /* the ev variable contains a keyup event object.
8 | *
9 | * ev.keyCode - contains the ASCII code of the key that was released, this property is supported in effectively all browsers.
10 | * ev.key - contains the key value of the key that was released, this property is supported by most modern browsers.
11 | *
12 | */
13 |
14 |
15 | /* the following shows an alert when the 'a' key is released. */
16 | if (ev.key === 'a') {
17 | UI.alert("the 'a' key was released.");
18 | }
19 | });
20 | }());
21 |
22 |
23 | :: Start
24 | Press and release the ''a'' key to show an Alert dialog.
25 |
--------------------------------------------------------------------------------
/pages/loadscreen/sugarcube/sugarcube_loadscreen.md:
--------------------------------------------------------------------------------
1 | # "Loading Screen": SugarCube (v2.18)
2 |
3 | ## Summary
4 |
5 | "Loading Screen" demonstrates how the **[LockScreen.lock()](http://www.motoslave.net/sugarcube/2/docs/#loadscreen-api-method-lock)** and **[LockScreen.unlock()](http://www.motoslave.net/sugarcube/2/docs/#loadscreen-api-method-lock)** functions work in SugarCube. (This example also uses the **[setTimeout()](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout)** JavaScript function.)
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_loadscreen_example.html){: target="_top" download="sugarcube_loadscreen_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Loading Screen in SugarCube
16 |
17 | :: UserScript[script]
18 | // Lock the screen and save the ID
19 | var lockID = LoadScreen.lock();
20 |
21 | // Pause for 5 second before unlocking the screen
22 | setTimeout(function(){
23 | LoadScreen.unlock(lockID);
24 | }, 5000);
25 |
26 | :: Start
27 | You can now see this after the long pause!
28 |
29 | ```
30 |
31 | [Twee Download](sugarcube_loadscreen_twee.txt){ target="_top" download="sugarcube_loadscreen_twee.txt"}
32 |
--------------------------------------------------------------------------------
/pages/loadscreen/sugarcube/sugarcube_loadscreen_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Loading Screen in SugarCube
3 |
4 | :: UserScript[script]
5 | // Lock the screen and save the ID
6 | var lockID = LoadScreen.lock();
7 |
8 | // Pause for 5 second before unlocking the screen
9 | setTimeout(function(){
10 | LoadScreen.unlock(lockID);
11 | }, 5000);
12 |
13 | :: Start
14 | You can now see this after the long pause!
15 |
--------------------------------------------------------------------------------
/pages/lockandkey_variable/chapbook/chapbook_lockandkey_variable_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Lock and Key: Variable
3 |
4 | :: Start
5 | key: false
6 | --
7 |
8 | Rooms:
9 |
10 | [[Front Room]]
11 |
12 | [[Back Room]]
13 |
14 |
15 | :: Front Room
16 | [if key == true]
17 | [[Unlock the door->Exit]]
18 | [else]
19 | *Locked Door*
20 | [continued]
21 |
22 | Rooms:
23 |
24 | [[Back Room]]
25 |
26 |
27 | :: Back Room
28 | [if key == false]
29 | Items:
30 | {reveal link: 'Pick up key', passage: 'Key'}
31 | [else]
32 | There is nothing here.
33 | [continued]
34 |
35 | Rooms:
36 |
37 | [[Front Room]]
38 |
39 | :: Exit
40 | You found the key and went through the door!
41 |
42 | :: Key
43 | key: true
44 | --
45 | You picked up the key!
46 |
--------------------------------------------------------------------------------
/pages/lockandkey_variable/harlowe/harlowe_lockandkey_variable_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Lock and Key: Variable in Harlowe
3 |
4 | :: Start
5 | (set: $key to false)
6 |
7 | Rooms:
8 | [[Front Room]]
9 | [[Back Room]]
10 |
11 | :: Front Room
12 | (if: $key is true)[
13 | [[Exit]]
14 | ]
15 | (else:)[
16 | *Locked Door*
17 | ]
18 |
19 | Rooms:
20 | [[Back Room]]
21 |
22 | :: Back Room
23 | (if: $key is false)[
24 | Items:
25 | (link: "Pick up key")[(set: $key to true)You have a key.]
26 | ]
27 | (else:)[
28 | There is nothing here.
29 | ]
30 |
31 | Rooms:
32 | [[Front Room]]
33 |
34 | :: Exit
35 | You found the key and went through the door!
36 |
--------------------------------------------------------------------------------
/pages/lockandkey_variable/snowman/snowman_lockandkey_variable_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Lock and Key: Variable in Snowman
3 |
4 | :: Start
5 | Rooms:
6 | - [[Front Room]]
7 | - [[Back Room]]
8 |
9 | :: Front Room
10 | <% if (s.key) { %>
11 | [[Exit]]
12 | <% } else { %>
13 | *Locked Door*
14 | <% } %>
15 |
16 | Rooms:
17 | - [[Back Room]]
18 |
19 | :: Back Room
20 | <% if (!s.key) { %>
21 | Items:
22 | -
Pick up key
23 | <% } else { %>
24 | There is nothing here.
25 | <% } %>
26 |
27 | <%
28 | $(function() {
29 | $('.key-item').click(function() {
30 | s.key = true;
31 | $(this).replaceWith('
You have a key.');
32 | });
33 | });
34 | %>
35 |
36 | Rooms:
37 | - [[Front Room]]
38 |
39 | :: Exit
40 | You found the key and went through the door!
41 |
--------------------------------------------------------------------------------
/pages/lockandkey_variable/sugarcube/sugarcube_lockandkey_variable_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Lock and Key: Variable in SugarCube
3 |
4 | :: Start
5 | <
>
6 |
7 | Rooms:
8 | [[Back Room]]
9 | [[Front Room]]
10 |
11 | :: Back Room
12 | <>
13 | Items:
14 | <><>You have a key.<>
15 | <>
16 | There is nothing here.
17 | <>
18 |
19 | Rooms:
20 | [[Front Room]]
21 |
22 | :: Front Room
23 | <>
24 | [[Exit]]
25 | <>
26 | Locked Door
27 | <>
28 |
29 | Rooms:
30 | [[Back Room]]
31 |
32 | :: Exit
33 | You found the key and went through the door!
34 |
--------------------------------------------------------------------------------
/pages/looping/chapbook/chapbook_looping_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Looping
3 |
4 | :: Start
5 | exampleArray: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61]
6 | --
7 |
8 | The values of the array are:
9 |
10 | [JavaScript]
11 | exampleArray.forEach(function(value, index){
12 | write("- " + value + "
");
13 | });
14 | [continued]
15 |
16 |
17 |
--------------------------------------------------------------------------------
/pages/looping/harlowe/harlowe_looping_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Looping in Harlowe
3 |
4 | :: Start
5 |
6 | (set: $arrayInventory to (a: "Bread", "Pan", "Book") )
7 |
8 |
9 |
10 | (for: each _temp, ...$arrayInventory)[
11 | You have _temp.]
12 |
13 |
--------------------------------------------------------------------------------
/pages/looping/snowman/snowman_looping_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Looping in Snowman
3 |
4 | :: Start
5 | <%
6 | // An array of the strings "Bread", "Pan", "Book"
7 | s.arrayInventory = ["Bread", "Pan", "Book"];
8 |
9 | // An example using JavaScript
10 | for (var i = 0; i < s.arrayInventory.length; i++){
11 | %>You have <%= s.arrayInventory[i] %>.
<%
12 | }
13 | %>
14 |
15 |
16 | <%
17 | // An example using Underscore.js
18 | _.each(s.arrayInventory, function(item) {
19 | %>You have <%= item %>.
<%
20 | });
21 | %>
22 |
23 |
24 | <%
25 | // An example using jQuery
26 | jQuery.each(s.arrayInventory, function( index, value ) {
27 | %>You have <%= value %>.
<%
28 | });
29 |
30 | %>
31 |
--------------------------------------------------------------------------------
/pages/looping/sugarcube/sugarcube_looping_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Looping in SugarCube
3 |
4 | :: Start
5 |
6 | <>
7 |
8 |
9 | <>
10 | You have $arrayInventory[_i]
11 | <>
12 |
--------------------------------------------------------------------------------
/pages/markup/snowman/snowman_markup_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Style Markup in Snowman
3 |
4 | :: Start
5 | *Emphasis* or _Emphasis_.
6 |
7 | **Strong emphasis** or __Strong emphasis__.
8 |
9 | ~~Strikethrough~~
10 |
11 | 1. First ordered list item
12 | 2. Another item
13 |
14 | # H1
15 | ## H2
16 | ### H3
17 | #### H4
18 | ##### H5
19 | ###### H6
20 |
21 | ```
22 | Escaped code line.
23 | Another line of code.
24 | ```
25 |
26 | | Tables | Are | Cool |
27 | | ------------- |:-------------:| -------------:|
28 | | col 3 | is | right-aligned |
29 | | col 2 | is | centered |
30 | | col 1 | is | left-aligned |
31 |
32 | > Blockquotes are useful.
33 | > This line is part of the same quote.
34 |
--------------------------------------------------------------------------------
/pages/markup/sugarcane/sugarcane_markup_twee.txt:
--------------------------------------------------------------------------------
1 | :: Start
2 | Italics: //text//
3 | Boldface: ''text''
4 | Underline: __text__
5 | Strikethrough: ==text==
6 | Subscript: H~~2~~O
7 | Superscript: meters/second^^2^^
8 | Escaped: {{{a //word//}}}
9 | Comment: /%a comment%/
10 | Error: @@error@@
11 | Inline styling: @@font-weight:bold;text@@
12 | Bulleted list:
13 | * one
14 | * two
15 | Numbered list:
16 | # one
17 | # two
18 | !Heading 1
19 | !!Heading 2
20 | !!!Heading 3
21 | !!!!Heading 4
22 | !!!!!Heading 5
23 | !!!!!!Heading 6
24 | |!table header |!table header |!table header |
25 | |row 1|row 1|row 1|
26 | |row 2|row 2|row 2|
27 | |>|row 3|row 3|
28 | |>|>|row 4|
29 | |rows 5 and 6|row 5|row 5|
30 | |~|row 6|row 6|
31 | |rows 7, 8 and 9|>|row 7|
32 | |~|>|row 8|
33 | |~|row 9|row 9|
34 | |table caption|c
35 |
36 |
37 | :: StoryTitle
38 | Style Markup
39 |
40 |
41 | :: StoryAuthor
42 | Videlais
43 |
44 |
45 |
--------------------------------------------------------------------------------
/pages/markup/sugarcube/sugarcube_markup.md:
--------------------------------------------------------------------------------
1 | # "Style Markup": SugarCube (v2.18)
2 |
3 | ## Summary
4 |
5 | [In SugarCube](http://www.motoslave.net/sugarcube/2/docs/markup.html#basic-formatting), style markup follows initial rules established in earlier versions of Twine while also adding many new ones.
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_markup_example.html){: target="_top" download="sugarcube_markup_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Style Markup in SugarCube
16 |
17 | :: Start
18 | //Emphasis//
19 | ''Strong Emphasis''
20 | ==Strikethrough==
21 | Super^^script^^
22 | Sub~~script~~
23 | > Quote
24 | >> Nested quote
25 | * A list item
26 | * Another list item
27 | # A list item
28 | # Another list item
29 | """No //format//"""
30 | @@Highlight Inline@@
31 | !Level 1 Heading
32 | !!Level 2 Heading
33 | !!!Level 3 Heading
34 | !!!!Level 4 Heading
35 | !!!!!Level 5 Heading
36 | !!!!!!Level 6 Heading
37 | ```
38 |
39 | [Twee Download](sugarcube_markup_twee.txt){ target="_top" download="sugarcube_markup_twee.txt"}
40 |
--------------------------------------------------------------------------------
/pages/markup/sugarcube/sugarcube_markup_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Style Markup in SugarCube
3 |
4 | :: Start
5 | //Emphasis//
6 | ''Strong Emphasis''
7 | ==Strikethrough==
8 | Super^^script^^
9 | Sub~~script~~
10 | > Quote
11 | >> Nested quote
12 | {{{
13 | Code
14 | More code
15 | }}}
16 | * A list item
17 | * Another list item
18 | # A list item
19 | # Another list item
20 | """No //format//"""
21 | @@Highlight Inline@@
22 | !Level 1 Heading
23 | !!Level 2 Heading
24 | !!!Level 3 Heading
25 | !!!!Level 4 Heading
26 | !!!!!Level 5 Heading
27 | !!!!!!Level 6 Heading
28 |
--------------------------------------------------------------------------------
/pages/modal/harlowe/harlowe_modal_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Modal
3 |
4 | :: Header[header]
5 | |modalhooks>[]
6 |
7 | :: Modal code
8 | (replace: ?modalhooks)[{
9 | (css:"
10 | position: fixed;
11 | display:block;
12 | z-index: 1;
13 | left: 0;
14 | top: 0;
15 | width: 100%; /* Full width */
16 | height: 100%; /* Full height */
17 | overflow: auto; /* Enable scroll if needed */
18 | background-color: rgba(0,0,0,0.4);
19 | ")[
20 | (css:"
21 | display:block;
22 | margin: 15% auto;
23 | padding: 20px;
24 | width: 80%;
25 | border: 1px solid white;
26 | ")|modal>[
27 | (css:"float:right")+(link-repeat:"×")[(replace: ?modalhooks)[]]
28 | ]
29 | ]
30 | }]
31 |
32 | :: Start
33 | (link-repeat:"Open Modal!")[(display:"Modal code")(append:?modal)[Some text in the modal...]]
34 |
--------------------------------------------------------------------------------
/pages/modal/sugarcube/sugarcube_modal.md:
--------------------------------------------------------------------------------
1 | # "Modal (Pop-up Window)": SugarCube (v2.18)
2 |
3 | ## Summary
4 |
5 | This example uses the built-in *[Dialog](http://www.motoslave.net/sugarcube/2/docs/api-dialog.html)* object to **setup()**, add content ( **wiki()** ), and finally **open()** the dialog window. SugarCube also comes with [additional functionality](http://www.motoslave.net/sugarcube/2/docs/api-dialog.html) to adjust other settings.
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_modal_example.html){: target="_top" download="sugarcube_modal_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | SugarCube: Modal
16 |
17 | :: Start
18 | <>
19 | <>
24 | <>
25 |
26 |
27 | ```
28 |
29 | [Twee Download](sugarcube_modal_twee.txt){ target="_top" download="sugarcube_modal_twee.txt"}
30 |
--------------------------------------------------------------------------------
/pages/modal/sugarcube/sugarcube_modal_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Modal
3 |
4 | :: Start
5 | <>
6 | <>
11 | <>
12 |
--------------------------------------------------------------------------------
/pages/modularity/harlowe/harlowe_modularity.md:
--------------------------------------------------------------------------------
1 | # "Modularity": Harlowe (v2.0)
2 |
3 | ## Summary
4 |
5 | In programming terminology, modularity refers to dividing software into different sections related to their purpose or to better organize the whole. In Harlowe, this technique can be used through the [`(display:)`](https://twine2.neocities.org/#macro_display) macro to print the contents of one passage in another. Parts of a story can often be re-used in this way.
6 |
7 | ## Example
8 |
9 | [Download](harlowe_modularity_example.html){: target="_top" download="harlowe_modularity_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Modularity in Harlowe
16 |
17 | :: Start
18 | (set: $lineOne to "Give us a verse")
19 | (set: $lineTwo to "Drop some knowledge")
20 |
21 | (display: "showLineOne")
22 | (display: "showLineTwo")
23 |
24 | :: showLineOne
25 | $lineOne
26 |
27 | :: showLineTwo
28 | $lineTwo
29 | ```
30 |
31 | [Twee Download](harlowe_modularity_twee.txt){ target="_top" download="harlowe_modularity_twee.txt"}
32 |
--------------------------------------------------------------------------------
/pages/modularity/harlowe/harlowe_modularity_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Modularity in Harlowe
3 |
4 | :: Start
5 | (set: $lineOne to "Give us a verse")
6 | (set: $lineTwo to "Drop some knowledge")
7 |
8 | (display: "showLineOne")
9 | (display: "showLineTwo")
10 |
11 | :: showLineOne
12 | $lineOne
13 |
14 | :: showLineTwo
15 | $lineTwo
16 |
--------------------------------------------------------------------------------
/pages/modularity/snowman/snowman_modularity.md:
--------------------------------------------------------------------------------
1 | # "Modularity": Snowman (v1.3.0)
2 |
3 | ## Summary
4 |
5 | In programming terminology, modularity refers to dividing software into different sections related to their purpose or to better organize the whole. In Snowman, this technique can be used through the **[window.story.render()](https://videlais.github.io/snowman/#/1/window_story/functions/render)** function to print the contents of one passage in another. Parts of a story can often be re-used in this way.
6 |
7 | ## Example
8 |
9 | [Download](snowman_modularity_example.html){: target="_top" download="snowman_modularity_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Modularity in Snowman
16 |
17 | :: Start
18 | <%
19 | s.lineOne = "Give us a verse";
20 | s.lineTwo = "Drop some knowledge";
21 | %>
22 |
23 | <%= window.story.render("showLineOne") %>
24 | <%= window.story.render("showLineTwo") %>
25 |
26 |
27 | :: showLineOne
28 | <%= s.lineOne %>
29 |
30 | :: showLineTwo
31 | <%= s.lineTwo %>
32 | ```
33 |
34 | [Twee Download](snowman_modularity_twee.txt){ target="_top" download="snowman_modularity_twee.txt"}
35 |
--------------------------------------------------------------------------------
/pages/modularity/snowman/snowman_modularity_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Modularity in Snowman
3 |
4 | :: Start
5 | <%
6 | s.lineOne = "Give us a verse";
7 | s.lineTwo = "Drop some knowledge";
8 | %>
9 |
10 | <%= window.story.render("showLineOne") %>
11 | <%= window.story.render("showLineTwo") %>
12 |
13 |
14 | :: showLineOne
15 | <%= s.lineOne %>
16 |
17 | :: showLineTwo
18 | <%= s.lineTwo %>
19 |
--------------------------------------------------------------------------------
/pages/modularity/sugarcube/sugarcube_modularity_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Modularity in SugarCube
3 |
4 | :: Start
5 | <>
6 | <>
7 |
8 | <>
9 | <>
10 |
11 | <>
12 | <>
13 |
14 | :: showLineWidget [widget]
15 | <>\
16 | <>
17 | <>
18 | $lineOne
19 | <>
20 | $lineTwo
21 | <>
22 | <>\
23 | <>
24 |
25 | :: showLineOne
26 | $lineOne
27 |
28 | :: showLineTwo
29 | $lineTwo
--------------------------------------------------------------------------------
/pages/passageevents/snowman/snowman_passage_events_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Passage Events
3 |
4 | :: UserScript[script]
5 | /*
6 | Prepend the content of the passage "Header" to every passage.
7 | Append the content of the passage "Footer" to every passage.
8 | */
9 | $(window).on('shown.sm.passage', function (eventObject, passageObject) {
10 | var headerContent = window.story.render("Header");
11 | var currentContent = passageObject.passage.render();
12 | var footerContent = window.story.render("Footer");
13 |
14 | $('#main').html(headerContent + currentContent + footerContent);
15 | });
16 |
17 | :: Start
18 | [[Another Passage]]
19 |
20 | :: Another Passage
21 | [[Back to Beginning|Start]]
22 |
23 | :: Header
24 | This is the header!
25 |
26 | :: Footer
27 | This is the footer!
28 |
--------------------------------------------------------------------------------
/pages/passageevents/snowman_2/snowman_passage_events_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman 2: Passage Events
3 |
4 | :: UserScript[script]
5 | /*
6 | Prepend the content of the passage "Header" to every passage.
7 | Append the content of the passage "Footer" to every passage.
8 | */
9 | $(window).on('sm.passage.shown', function (eventObject, passageObject) {
10 | var headerContent = window.story.render("Header");
11 | var currentContent = passageObject.passage.render();
12 | var footerContent = window.story.render("Footer");
13 |
14 | $('tw-passage').html(headerContent + currentContent + footerContent);
15 | });
16 |
17 | :: Start
18 | [[Another Passage]]
19 |
20 | :: Another Passage
21 | [[Back to beginning->Start]]
22 |
23 | :: Header
24 | This is the header!
25 |
26 | :: Footer
27 | This is the footer!
28 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/chapbook/chapbook_passagesinpassages.md:
--------------------------------------------------------------------------------
1 | # "Passages in Passages": Chapbook (v1.0.0)
2 |
3 | ## Summary
4 |
5 | Using the insert [`{embed passage: }`](https://klembot.github.io/chapbook/guide/references/inserts.html), Chapbook can include one passage in another.
6 |
7 | ## Example
8 |
9 | [Download](chapbook_passagesinpassages_example.html){: target="_top" download="chapbook_passagesinpassages_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Chapbook: Passages in Passages
16 |
17 | :: Start
18 | This is the Start passage!
19 | {embed passage: 'Another'}
20 |
21 | :: Another
22 | And this is another passage!
23 |
24 | ```
25 |
26 | [Twee Download](chapbook_passagesinpassages_twee.txt){ target="_top" download="chapbook_passagesinpassages_twee.txt"}
27 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/chapbook/chapbook_passagesinpassages_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Passages in Passages
3 |
4 | :: Start
5 | This is the Start passage!
6 | {embed passage: 'Another'}
7 |
8 | :: Another
9 | And this is another passage!
10 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/harlowe/harlowe_passagesinpassages.md:
--------------------------------------------------------------------------------
1 | # "Passages in Passages": Harlowe (v1.0)
2 |
3 | ## Summary
4 |
5 | The Harlowe story format allows for content in one passage to be displayed in another through the use of the [`(display:)`](https://twine2.neocities.org/#macro_display) macro. Given the name of an existing passage, its contents will added wherever the macro is called.
6 |
7 | ## Example
8 |
9 | [Download](harlowe_passagesinpassages_example.html){: target="_top" download="harlowe_passagesinpassages_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Harlowe: Passages in Passages
16 |
17 | :: Start
18 | This is the Start passage!
19 | (display: "Another")
20 |
21 | :: Another
22 | And this is another passage!
23 |
24 | ```
25 |
26 | [Twee Download](harlowe_passagesinpassages_twee.txt){ target="_top" download="harlowe_passagesinpassages_twee.txt"}
27 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/harlowe/harlowe_passagesinpassages_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Passages in Passages
3 |
4 | :: Start
5 | This is the Start passage!
6 | (display: "Another")
7 |
8 | :: Another
9 | And this is another passage!
10 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/snowman/snowman_passagesinpassages.md:
--------------------------------------------------------------------------------
1 | # "Passages in Passages: Snowman (v1.3)
2 |
3 | ## Summary
4 |
5 | In Snowman, the contents of one passage can be included in another through using the **[window.story.render()](https://videlais.github.io/snowman/#/1/window_story/functions/render)** function. This will find and return the source of an existing passage in the story. Combined with the use of Underscore's [template system](https://videlais.github.io/snowman/#/1/learning/template), the returned value can be included directly where the function is used in a passage.
6 |
7 | ## Example
8 |
9 | [Download](snowman_passagesinpassages_example.html){: target="_top" download="snowman_passagesinpassages_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Snowman: Passages in Passages
16 |
17 | :: Start
18 | This is the Start passage!
19 | <%= window.story.render("Another") %>
20 |
21 | :: Another
22 | And this is Another passage!
23 |
24 | ```
25 |
26 | [Twee Download](snowman_passagesinpassages_twee.txt){ target="_top" download="snowman_passagesinpassages_twee.txt"}
27 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/snowman/snowman_passagesinpassages_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Passages in Passages
3 |
4 | :: Start
5 | This is the Start passage!
6 | <%= window.story.render("Another") %>
7 |
8 | :: Another
9 | And this is Another passage!
10 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/sugarcube/sugarcube_passagesinpassages.md:
--------------------------------------------------------------------------------
1 | # "Passages in Passages": SugarCube (v2.2)
2 |
3 | ## Summary
4 |
5 | In SugarCube, the contents of a passage can be shown in another through the use of the [`<>`](http://www.motoslave.net/sugarcube/2/docs/#macros-macro-include) macro. Through using the name of an existing passage, its contents will be included where the macro is called.
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_passagesinpassages_example.html){: target="_top" download="sugarcube_passagesinpassages_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | SugarCube: Passages in Passages
16 |
17 | :: Start
18 | This is the Start passage!
19 | <>
20 |
21 | :: Another
22 | And this is Another passage!
23 |
24 | ```
25 |
26 | [Twee Download](sugarcube_passagesinpassages_twee.txt){ target="_top" download="sugarcube_passagesinpassages_twee.txt"}
27 |
--------------------------------------------------------------------------------
/pages/passagesinpassages/sugarcube/sugarcube_passagesinpassages_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Passages in Passages
3 |
4 | :: Start
5 | This is the Start passage!
6 | <>
7 |
8 | :: Another
9 | And this is Another passage!
10 |
--------------------------------------------------------------------------------
/pages/passagetags/chapbook/chapbook_passagetags.md:
--------------------------------------------------------------------------------
1 | # "CSS and Passage Tags": Chapbook (v1.0.0)
2 |
3 | ## Summary
4 |
5 | Using the built-in global variable *config*, [text colors and other CSS properties](https://klembot.github.io/chapbook/guide/customization/fonts-and-colors.html) can be programmatically adjusted using the [`[JavaScript]`](https://klembot.github.io/chapbook/guide/advanced/using-javascript-in-passages.html) modifier in Chapbook.
6 |
7 | ## Example
8 |
9 | [Download](chapbook_passagetags_example.html){: target="_top" download="chapbook_passagetags_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Chapbook: CSS and Passage Tags
16 |
17 | :: Start
18 | config.style.page.color: "yellow-4"
19 | --
20 | This is one color!
21 | [JavaScript]
22 | // Overwrite the default text color
23 | config.style.page.color = "violet-6";
24 | [continued]
25 |
26 | And this is the same color!
27 |
28 | ```
29 |
30 | [Twee Download](chapbook_passagetags_twee.txt){ target="_top" download="chapbook_passagetags_twee.txt"}
31 |
--------------------------------------------------------------------------------
/pages/passagetags/chapbook/chapbook_passagetags_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: CSS and Passage Tags
3 |
4 | :: Start
5 | config.style.page.color: "yellow-4"
6 | --
7 | This is one color!
8 | [JavaScript]
9 | // Overwrite the default text color
10 | config.style.page.color = "violet-6";
11 | [continued]
12 |
13 | And this is the same color!
14 |
--------------------------------------------------------------------------------
/pages/passagetags/harlowe/harlowe_passagetags.md:
--------------------------------------------------------------------------------
1 | # "CSS and Passage Tags": Harlowe (v2.0)
2 |
3 | !!! Warning
4 | The following example is designed for use in Harlowe 2.x and later
5 |
6 | ## Summary
7 |
8 | This example shows how to use CSS selectors to selectively style different passages based on how they are tagged. In Harlowe, the "tags" attribute can be used to create different sets of styles and apply them when shown.
9 |
10 | ## Example
11 |
12 | [Download](harlowe_passagetags_example.html){: target="_top" download="harlowe_passagetags_example.html"}
13 |
14 | ## Twee Code
15 |
16 | ```twee
17 | :: StoryTitle
18 | CSS and Passage Tags in Harlowe
19 |
20 | :: UserStylesheet[stylesheet]
21 | [tags="grey"] {
22 | background: grey;
23 | }
24 |
25 | [tags="yellow"] {
26 | background: yellow;
27 | color: black;
28 | }
29 |
30 | :: Start[grey]
31 | This passage has a grey background and (default) white text.
32 | [[Second]]
33 |
34 | :: Second[yellow]
35 | This passage has a yellow background and black text.
36 |
37 |
38 | ```
39 |
40 | [Twee Download](harlowe_passagetags_twee.txt){ target="_top" download="harlowe_passagetags_twee.txt"}
41 |
--------------------------------------------------------------------------------
/pages/passagetags/harlowe/harlowe_passagetags_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | CSS and Passage Tags in Harlowe
3 |
4 | :: UserStylesheet[stylesheet]
5 | [tags="grey"] {
6 | background: grey;
7 | }
8 |
9 | [tags="yellow"] {
10 | background: yellow;
11 | color: black;
12 | }
13 |
14 | :: Start[grey]
15 | This passage has a grey background and (default) white text.
16 | [[Second]]
17 |
18 | :: Second[yellow]
19 | This passage has a yellow background and black text.
20 |
--------------------------------------------------------------------------------
/pages/passagetags/snowman/snowman_passagetags_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | CSS and Passage Tags in Snowman
3 |
4 | :: UserStylesheet[stylesheet]
5 | .grey {
6 | background: grey;
7 | color: white;
8 | }
9 | .yellow {
10 | background: yellow;
11 | color: black;
12 | }
13 |
14 | :: Start[grey]
15 | <% $("body").toggleClass("grey") %>
16 | This passage has a grey background and white text.
17 |
18 | [[Second]]
19 |
20 | :: Second[yellow]
21 | <% $("body").toggleClass("yellow") %>
22 | This passage has a yellow background and black text.
23 |
--------------------------------------------------------------------------------
/pages/passagetags/sugarcane/sugarcane_passagetags_twee.txt:
--------------------------------------------------------------------------------
1 | :: Start [grey]
2 | This passage has a grey background and white text.
3 |
4 | [[Second]]
5 |
6 |
7 | :: Second [yellow]
8 | This passage has a yellow background and black text.
9 |
10 |
11 | :: StoryTitle
12 | CSS and Passage Tags in Twine 1.4.2
13 |
14 |
15 | :: Stylesheet [stylesheet]
16 | [data-tags="grey"] {
17 | background: grey;
18 | color: white;
19 | }
20 |
21 | [data-tags="yellow"] {
22 | background: yellow;
23 | color: black;
24 | }
25 |
26 |
27 | :: StoryAuthor
28 | Videlais
29 |
30 |
31 |
--------------------------------------------------------------------------------
/pages/passagetags/sugarcube/sugarcube_passagetags_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | CSS and Passage Tags in SugarCube
3 |
4 | :: UserStylesheet[stylesheet]
5 | /* Style the entire body when showing passage tagged with grey */
6 | body.grey {
7 | color: green;
8 | }
9 |
10 | /* Style only the inner part of the passage tagged with "grey" */
11 | .passage.grey {
12 | background: grey;
13 | }
14 |
15 | /* Style only the inner part of the passage tagged with "yellow" */
16 | .passage.yellow {
17 | background: yellow;
18 | color: black;
19 | }
20 |
21 | :: Start[grey]
22 | This passage has a grey background and green text.
23 | [[Second]]
24 |
25 | :: Second[yellow]
26 | This passage has a yellow background and black text.
27 |
--------------------------------------------------------------------------------
/pages/passagetoelement/snowman/snowman_passagetoelement_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Render to Element
3 |
4 | :: Start
5 |
6 |
12 |
13 | :: HUD
14 | This is the HUD!
15 |
--------------------------------------------------------------------------------
/pages/passagetoelement/sugarcube/sugarcube_passagetoelement_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Render Passage to Element
3 |
4 | :: Start
5 |
6 | <>
13 |
14 | :: HUD
15 | This is the heads-up display!
16 |
--------------------------------------------------------------------------------
/pages/passagetransitions/harlowe/harlowe_passagetransitions_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe 3: Passage Transitions
3 |
4 | :: Start
5 | (transition-depart: "dissolve")[[Dissolve Passage]]
6 |
7 | :: Dissolve Passage
8 | (transition-arrive: "slide-right")[[Slide-right Passage]]
9 |
10 | :: Slide-right Passage
11 | Double-click this passage to edit it.
12 |
--------------------------------------------------------------------------------
/pages/passagetransitions/snowman/snowman_passagetransitions.md:
--------------------------------------------------------------------------------
1 | # "Passage Transitions": Snowman (v1.3)
2 |
3 | ## Summary
4 |
5 | In Snowman, the "showpassage" event is triggered once a passage is loaded. By listening for this event, [jQuery effects](https://api.jquery.com/category/effects/) can be applied to the passage element to produce a transition.
6 |
7 | ## Example
8 |
9 | [Download](snowman_passagetransitions_example.html){: target="_top" download="snowman_passagetransitions_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Snowman: Passage Transitions
16 |
17 | :: UserScript[script]
18 | $(document).on('showpassage', function(event, passage) {
19 |
20 | $("#passage").hide(0).fadeIn(2000);
21 |
22 | });
23 |
24 | :: Start
25 | [[Another Passage]]
26 |
27 | :: Another Passage
28 | [[A Third Passage]]
29 |
30 | :: A Third Passage
31 | Double-click this passage to edit it.
32 |
33 | ```
34 |
35 | [Twee Download](snowman_passagetransitions_twee.txt){ target="_top" download="snowman_passagetransitions_twee.txt"}
36 |
--------------------------------------------------------------------------------
/pages/passagetransitions/snowman/snowman_passagetransitions_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Passage Transitions
3 |
4 | :: UserScript[script]
5 | $(document).on('showpassage', function(event, passage) {
6 |
7 | $("#passage").hide(0).fadeIn(2000);
8 |
9 | });
10 |
11 | :: Start
12 | [[Another Passage]]
13 |
14 | :: Another Passage
15 | [[A Third Passage]]
16 |
17 | :: A Third Passage
18 | Double-click this passage to edit it.
19 |
--------------------------------------------------------------------------------
/pages/passagetransitions/snowman_2/snowman_2_passagetransitions_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman 2: Passage Transitions
3 |
4 | :: UserScript[script]
5 | $(document).on('sm.passage.showing', function(event, passage) {
6 |
7 | $("tw-passage").hide(0).fadeIn(2000);
8 |
9 | });
10 |
11 | :: Start
12 | [[Another Passage]]
13 |
14 | :: Another Passage
15 | [[A Third Passage]]
16 |
17 | :: A Third Passage
18 | Double-click this passage to edit it.
19 |
--------------------------------------------------------------------------------
/pages/passagetransitions/sugarcube/sugarcube_passagetransitions_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Passage Transitions
3 |
4 | :: UserScript[script]
5 | // Fade in content using jQuery Effects
6 | // Hide and then fade in the content over 2000ms (2s)
7 | $(document).on(':passagerender', function (event) {
8 | $(".passage").hide(0).fadeIn(2000);
9 | });
10 |
11 | :: Start
12 | [[Another passage]]
13 |
14 | :: A third passage
15 | No more content!
16 |
17 | :: Another passage
18 | [[A third passage]]
19 |
--------------------------------------------------------------------------------
/pages/passagevisits/chapbook/chapbook_passagevisits.md:
--------------------------------------------------------------------------------
1 | # "Passage Visits": Chapbook (v1.0.0)
2 |
3 | ## Summary
4 |
5 | In Chapbook, the [lookup](https://klembot.github.io/chapbook/guide/state/objects-and-lookups.html) *passage.visits* variable contains the number of times the current passages has been visited by the user.
6 |
7 | ## Example
8 |
9 | [Download](chapbook_passagevisits_example.html){: target="_top" download="chapbook_passagevisits_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Chapbook: Passage Visits
16 |
17 | :: Start
18 |
19 | [[Another Passage]]
20 |
21 | :: Another Passage
22 | How many times has the current passage been visited? {passage.visits}
23 |
24 | [[Start]]
25 |
26 | ```
27 |
28 | [Twee Download](chapbook_passagevisits_twee.txt){ target="_top" download="chapbook_passagevisits_twee.txt"}
29 |
--------------------------------------------------------------------------------
/pages/passagevisits/chapbook/chapbook_passagevisits_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Passage Visits
3 |
4 | :: Start
5 |
6 | [[Another Passage]]
7 |
8 | :: Another Passage
9 | How many times has the current passage been visited? {passage.visits}
10 |
11 | [[Start]]
12 |
--------------------------------------------------------------------------------
/pages/passagevisits/harlowe/harlowe_passagevisits.md:
--------------------------------------------------------------------------------
1 | # "Passage Visits": Harlowe (v1.0)
2 |
3 | ## Summary
4 |
5 | In Harlowe, the macro [`(count:)`](https://twine2.neocities.org/#macro_count) returns the number of times a value appears in an array. The macro [`(history:)`](https://twine2.neocities.org/#macro_history) returns an array of any passages visited as part of the story.
6 |
7 | Combined together, the macro `(count:)` with the `(history:)` can return the number of times a certain passage has been visited during the course of the story.
8 |
9 | ## Example
10 |
11 | [Download](harlowe_passagevisits_example.html){: target="_top" download="harlowe_passagevisits_example.html"}
12 |
13 | ## Twee Code
14 |
15 | ```twee
16 | :: StoryTitle
17 | Harlowe: Passage Visits
18 |
19 | :: Start
20 | How many times has the passage "Another Passage" been visited? (count: (history: ), "Another Passage")
21 |
22 | [[Another Passage]]
23 |
24 | :: Another Passage
25 | [[Start]]
26 |
27 | ```
28 |
29 | [Twee Download](harlowe_passagevisits_twee.txt){ target="_top" download="harlowe_passagevisits_twee.txt"}
30 |
--------------------------------------------------------------------------------
/pages/passagevisits/harlowe/harlowe_passagevisits_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Passage Visits
3 |
4 | :: Start
5 | How many times has the passage "Another Passage" been visited? (count: (history: ), "Another Passage")
6 |
7 | [[Another Passage]]
8 |
9 | :: Another Passage
10 | [[Start]]
11 |
--------------------------------------------------------------------------------
/pages/passagevisits/harlowe_3.1/harlowe_passagevisits.md:
--------------------------------------------------------------------------------
1 | # "Passage Visits": Harlowe (v3.1)
2 |
3 | ## Summary
4 |
5 | In Harlowe 3.1, the keyword [`visits`](https://twine2.neocities.org/#keyword_visits) is introduced. This value will contains the number of times the current passage has been visited.
6 |
7 | In this example, the macro [`(str:)`](https://twine2.neocities.org/#macro_str) is used with the keyword `visits` to show the value.
8 |
9 | ## Example
10 |
11 | [Download](harlowe_passagevisits_example.html){: target="_top" download="harlowe_passagevisits_example.html"}
12 |
13 | ## Twee Code
14 |
15 | ```twee
16 | :: StoryTitle
17 | Harlowe: Passage Visits
18 |
19 | :: Start
20 | How many times has the passage "Another Passage" been visited? (str: visits)
21 |
22 | [[Another Passage]]
23 |
24 | :: Another Passage
25 | [[Start]]
26 |
27 | ```
28 |
29 | [Twee Download](harlowe_passagevisits_twee.txt){ target="_top" download="harlowe_passagevisits_twee.txt"}
30 |
--------------------------------------------------------------------------------
/pages/passagevisits/harlowe_3.1/harlowe_passagevisits_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Harlowe: Passage Visits
3 |
4 | :: Start
5 | How many times has the passage "Another Passage" been visited? (str: visits)
6 |
7 | [[Another Passage]]
8 |
9 | :: Another Passage
10 | [[Start]]
11 |
--------------------------------------------------------------------------------
/pages/passagevisits/snowman/snowman_passagevisits.md:
--------------------------------------------------------------------------------
1 | # "Passage Visits": Snowman (v2.0)
2 |
3 | ## Summary
4 |
5 | Starting with Snowman 2.0, the global function **[visited()](https://videlais.github.io/snowman/#/2/utility/visited)** returns the number of times one or more passages have been visited during the course of the story. Combined with the use of [Underscore template interpolation](https://videlais.github.io/snowman/#/2/learning/template), the result of a function can be written to a passage.
6 |
7 | ## Example
8 |
9 | [Download](snowman_passagevisits_example.html){: target="_top" download="snowman_passagevisits_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Snowman: Passage Visits
16 |
17 | :: Start
18 | How many times has the passage "Another Passage" been visited? <%= visited("Another Passage") %>
19 |
20 | [[Another Passage]]
21 |
22 | :: Another Passage
23 | [[Start]]
24 |
25 | ```
26 |
27 | [Twee Download](snowman_passagevisits_twee.txt){ target="_top" download="snowman_passagevisits_twee.txt"}
28 |
--------------------------------------------------------------------------------
/pages/passagevisits/snowman/snowman_passagevisits_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Snowman: Passage Visits
3 |
4 | :: Start
5 | How many times has the passage "Another Passage" been visited? <%= visited("Another Passage") %>
6 |
7 | [[Another Passage]]
8 |
9 | :: Another Passage
10 | [[Start]]
11 |
--------------------------------------------------------------------------------
/pages/passagevisits/sugarcube/sugarcube_passagevisits.md:
--------------------------------------------------------------------------------
1 | # "Passage Visits": SugarCube (v2.2)
2 |
3 | ## Summary
4 |
5 | In SugarCube, the global function **[visited()](http://www.motoslave.net/sugarcube/2/docs/#functions-function-visited)** returns the number of times a passage has been visited during the course of the story. Combined with the [`<<= >>`](http://www.motoslave.net/sugarcube/2/docs/#macros-macro-equal) macro expression, the result of a global function can be written to a passage.
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_passagevisits_example.html){: target="_top" download="sugarcube_passagevisits_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | SugarCube: Passage Visits
16 |
17 | :: Start
18 | How many times has the passage "Another Passage" been visited? <<= visited("Another Passage")>>
19 |
20 | [[Another Passage]]
21 |
22 | :: Another Passage
23 | [[Start]]
24 |
25 | ```
26 |
27 | [Twee Download](sugarcube_passagevisits_twee.txt){ target="_top" download="sugarcube_passagevisits_twee.txt"}
28 |
--------------------------------------------------------------------------------
/pages/passagevisits/sugarcube/sugarcube_passagevisits_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | SugarCube: Passage Visits
3 |
4 | :: Start
5 | How many times has the passage "Another Passage" been visited? <<= visited("Another Passage")>>
6 |
7 | [[Another Passage]]
8 |
9 | :: Another Passage
10 | [[Start]]
11 |
--------------------------------------------------------------------------------
/pages/programmaticundo/harlowe/harlowe_programmaticundo.md:
--------------------------------------------------------------------------------
1 | # "Programmatic Undo": Harlowe (v2.0)
2 |
3 | ## Summary
4 |
5 | While Harlowe supports allowing the user to undo and redo moves, the "undo" operation can also be accessed through the [`(undo:)`](https://twine2.neocities.org/#macro_undo) macro. Through its use, changes from the most current action can be "undone."
6 |
7 | ## Example
8 |
9 | [Download](harlowe_programmaticundo_example.html){: target="_top" download="harlowe_programmaticundo_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Programmatic Undo in Harlowe
16 |
17 | :: Start
18 | [[Enter the darkness]]
19 |
20 | :: Enter the darkness
21 | (link: "You are not ready. Go back!")[(undo:)]
22 | ```
23 |
24 | [Twee Download](harlowe_programmaticundo_twee.txt){ target="_top" download="harlowe_programmaticundo_twee.txt"}
25 |
--------------------------------------------------------------------------------
/pages/programmaticundo/harlowe/harlowe_programmaticundo_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Programmatic Undo in Harlowe
3 |
4 | :: Start
5 | [[Enter the darkness]]
6 |
7 | :: Enter the darkness
8 | (link: "You are not ready. Go back!")[(undo:)]
--------------------------------------------------------------------------------
/pages/programmaticundo/snowman/snowman_programmaticundo_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Programmatic Undo in Snowman
3 |
4 | :: UserScript[script]
5 | $(window).on('showpassage:after', function (e, data)
6 | {
7 | window.story.checkpoint(data.passage.name);
8 | });
9 |
10 | :: Start
11 | [[Enter the Darkness]]
12 |
13 | :: Enter the Darkness
14 | You are not ready! Go back!
15 |
--------------------------------------------------------------------------------
/pages/programmaticundo/sugarcube/sugarcube_programmaticundo.md:
--------------------------------------------------------------------------------
1 | # "Programmatic Undo": SugarCube (v2.18)
2 |
3 | ## Summary
4 |
5 | While SugarCube supports allowing the user to undo and redo moves, the "undo" operation can also be accessed through the [`<>`](http://www.motoslave.net/sugarcube/2/docs/macros.html#macros-back) macro. Through its use, changes from the most current action can be "undone."
6 |
7 | ## Example
8 |
9 | [Download](sugarcube_programmaticundo_example.html){: target="_top" download="sugarcube_programmaticundo_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Programmatic Undo in SugarCube
16 |
17 | :: Start
18 | [[Enter the Darkness]]
19 |
20 | :: Enter the Darkness
21 | <>
22 | ```
23 |
24 | [Twee Download](sugarcube_programmaticundo_twee.txt){ target="_top" download="sugarcube_programmaticundo_twee.txt"}
25 |
--------------------------------------------------------------------------------
/pages/programmaticundo/sugarcube/sugarcube_programmaticundo_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Programmatic Undo in SugarCube
3 |
4 | :: Start
5 | [[Enter the Darkness]]
6 |
7 | :: Enter the Darkness
8 | <>
--------------------------------------------------------------------------------
/pages/questions/getting_started.md:
--------------------------------------------------------------------------------
1 | # Getting Started
2 |
3 | ## Online
4 |
5 | Twine 2 can be [accessed online](http://twinery.org/2).
6 |
7 | ## Offline
8 |
9 | Twine 2 can also be downloaded and run on Windows, MacOS X, and Linux systems. The [latest releases on GitHub](https://github.com/klembot/twinejs/releases/latest) has a listing of the current versions per operating system.
10 |
11 | ## Twine 1
12 |
13 | Twine 1 is only a desktop application. While it can still be used, it is not currently maintained or under active development. The current version is 1.4.2. The [IF Archive retains builds for Windows and macOS](https://ifarchive.org/indexes/if-archive/programming/twine/).
14 |
--------------------------------------------------------------------------------
/pages/questions/need_to_know.md:
--------------------------------------------------------------------------------
1 | # Need to Know
2 |
3 | *What do I need to know?*
4 |
5 | Nothing!
6 |
7 | You can make a game, interactive project, or experimental essay without knowing programming or anything other than how to navigate a program and publish HTML using Twine 2!
8 |
9 | However, getting the most out of Twine 2 can often require some knowledge of HTML, CSS, or JavaScript. All [story formats](../terms/terms_storyformats.md) also use markup to style text.
10 |
11 | ## HTML, CSS, and JavaScript
12 |
13 | This Cookbook has entries on [HTML](../terms/terms_html.md), [CSS](../terms/terms_css.md), and [JavaScript](../terms/terms_javascript.md) as they are used in connection with Twine 2.
14 |
15 | ### Markup
16 |
17 | All built-in story formats use different ways of [marking up text](../terms/terms_markdown_and_markup.md) to add some visual *emphasize* or otherwise **style text**. These differ between story formats, and it is highly recommended to consult the individual documentation of the story format for more information and examples.
18 |
--------------------------------------------------------------------------------
/pages/questions/stories_saved.md:
--------------------------------------------------------------------------------
1 | # Saving Stories
2 |
3 | ## Twine 2
4 |
5 | ### Online
6 |
7 | Stories are saved in the [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) of a web browser. This is isolated between a browser and its use of incognito or private windows. *Clearing sessions and cookies in a browser may also clear the storage of Twine 2.* Using a different browser also means accessing different local storage.
8 |
9 | ### Desktop
10 |
11 | When used as a desktop application, Twine 2 stores its files under the current user's files. The current collection of Stories can be accessed through the View -> Show Story Library menu option.
12 |
13 | ## Twine 1
14 |
15 | As a desktop application, it stores its files in either HTML or as [Twee source code](../terms/terms_twee.md) on the local computer. It can import and export both HTML and Twee source code (`.twee` or `.tw`).
16 |
--------------------------------------------------------------------------------
/pages/questions/style_text.md:
--------------------------------------------------------------------------------
1 | # Styling Text
2 |
3 | Each [Story Format](../introduction/story_formats.md) uses their own markdown and special characters to format text. Some common examples are included below.
4 |
5 | | Story Format | Emphasis | Strong Emphasis | Verbatim Text |
6 | |--------------|----------|-----------------|---------------|
7 | | Chapbook | `*Italics*` or `_Italics_` | `__Bold__` or `**Bold**` | Any text following a new line and four spaces or a tab until the end of the line. |
8 | | Harlowe | `*Italics*` or `//Italics//` | `**Bold**` or `''Bold''` | `Verbatim` |
9 | | SugarCube | `//Italics//` | `''Bold''` | `"""Verbatim"""` or `Verbatim` |
10 | | Snowman | `*Italics*` | `**Bold**` | Any text following a new line and four spaces or a tab until the end of the line. |
11 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.1
2 |
3 | ## Editor
4 |
5 | ## Bugfixes
6 |
7 | - Story formats are now preserved during import (thanks Thomas Michael Edwards).
8 | - `$$` and other esoteric-ish characters in passages are no longer inappropriately transformed during the publishing process (thanks Thomas Michael Edwards).
9 | - A bug where passage connections would sometimes not update with zoom level changes has been fixed.
10 | - A cosmetic issue with popup balloons is fixed.
11 | - The link to the Twine forum on the welcome page is fixed.
12 |
13 | ## Features
14 |
15 | - The editor now checks for an updated version against `http://twinery.org/latestversion/2.json` once a day and informs users accordingly.
16 | - Passage connections are now drawn using SVG for improved performance.
17 |
18 | ## Built-In Story Formats
19 |
20 | ### Harlowe
21 |
22 | - TBD
23 |
24 | ### Snowman
25 |
26 | - Now properly uses user-created stylesheets and JavaScript.
27 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.10.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.10
2 |
3 | Release Date: Nov 20, 2015
4 |
5 | ## Editor
6 |
7 | Twine 2.0.10 has the same changelog as 2.0.9, but it includes Harlowe 1.2.1, which fixes a problem with `(else:)` invocations.
8 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.11.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.11
2 |
3 | Release Date: Feb 27, 2016
4 |
5 | ## Features added
6 |
7 | - Includes new localizations for German and Finnish.
8 | - Updates the included version of Harlowe to 1.2.2.
9 | - Updates the included version of Snowman to 1.3.0.
10 | - Updates the included version of SugarCube to 1.3.4.
11 |
12 | ## Bugfixes
13 |
14 | - Resolves several problems in 2.0.10 with Linux.
15 | - Improves link drawing of certain setter links.
16 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.4.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.4
2 |
3 | Release Date: Apr 12, 2015
4 |
5 | ## Editor
6 |
7 | ### Bugfixes
8 |
9 | - The app no longer mistakenly reports an updated version is available immediately after updating.
10 | - If an error occurs within the library used to save stories, a notification is now shown to the user. Previously, notifications were only shown when an error happened within the Twine app itself.
11 |
12 | ## Features
13 |
14 | - The tooltip for the story menu now shows the most recent date/time the story was saved.
15 | - The Story Statistics dialog is back, and now includes the [IFID](http://ifdb.tads.org/help-ifid) for a story.
16 | - Added experimental native app builds saving stories to the Documents folder, under Twine Stories.
17 |
18 | ## Built-In Story Formats
19 |
20 | - Updated Snowman to version 1.0.1.
21 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.6.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.6
2 |
3 | Release Date: May 31, 2015
4 |
5 | ## Editor
6 |
7 | ### Bugfixes
8 |
9 | - Properly includes SugarCube in local app versions.
10 | - Fixes a bug in 2.0.5 where clicking links in testing/play versions of stories did not work.
11 |
12 | ### Known Bugs
13 |
14 | - When testing or playing a SugarCube story in an app version, sidebar links do not work.
15 |
16 | ## Story Formats
17 |
18 | - Updates the remote URL of SugarCube to the latest.
19 | - Updates the included version of SugarCube in local app versions to 1.0.23.
20 | - Updates the included version of Snowman to 1.0.2.
21 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.7.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.7
2 |
3 | Release Date: Jul 4, 2015
4 |
5 | ## Editor
6 |
7 | ### Features
8 |
9 | - Twine is now internationalized, and includes a Spanish localization.
10 | - Importing files has been sped up, as well as the startup time of the local app.
11 |
12 | ### Bugfixes
13 |
14 | - Fixes a bug where clicking links in a story generated from the Test and Play buttons would not work.
15 | - The local application now works properly on Windows 7 Enterprise.
16 |
17 | ## Story Formats
18 |
19 | - Updates the included version of Harlowe to 1.1.
20 | - Updates the included version of Snowman to 1.1.
21 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.0.8.md:
--------------------------------------------------------------------------------
1 | # Twine 2.0.8
2 |
3 | Release Date: Jul 6, 2015
4 |
5 | ## Features added
6 |
7 | - Fixes bug where `<` and `>` characters would be garbled in stories in the native app version has been fixed.
8 | - Updates Harlowe to version 1.1.1.
9 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.1.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.1.1
2 |
3 | Release Date: Mar 1, 2017
4 |
5 | ## Features added
6 |
7 | - Added Czech, German, Italian, and Portuguese localizations.
8 | - Updated SugarCube to version 2.14.0.
9 | - Outdated story formats are now removed automatically.
10 |
11 | ## Bugfixes
12 |
13 | - Improved numerous issues with touch-based devices and Internet Explorer 11 in the story editor.
14 | - Fixed issues with the quick search field in the story editor.
15 | - Fixed a bug where sometimes text would disappear in the desktop application.
16 | - Fixed a bug where the story directory sometimes would not be unlocked when quitting the desktop application.
17 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.1.3.md:
--------------------------------------------------------------------------------
1 | # Twine 2.1.3
2 |
3 | Release Date: May 1, 2017
4 |
5 | ## Bugfixes
6 |
7 | - An issue causing passages to disappear, be positioned incorrectly, or otherwise become corrupted has been fixed.
8 | - Problems causing the search and replace dialog to not work correctly have been fixed.
9 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.2.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.2.1
2 |
3 | Release Date: Dec 20, 2017
4 |
5 | ## Bugfixes
6 |
7 | - Last modified dates on stories in the desktop app are maintained correctly.
8 | - Publishing stories with colored tags now works correctly.
9 | - Publishing stories correctly prefers an HTML version of the story, instead of a ZIP archive (used with iOS only).
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.0.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.0
2 |
3 | Release Date: Apr 14, 2019
4 |
5 | ## Features added
6 |
7 | - The desktop app now uses Electron instead of NW.js. This should resolve many crash issues, and also bring improved performance, as saving changes is now done on a separate processing thread than the main user interface.
8 | - The files in the story directory are now published as full-fledged stories, where possible.
9 | - Bahasa Malaysia and Russian have been added as locale choices.
10 | - Harlowe has been updated to 3.0.1.
11 | - SugarCube has been updated to 2.28.2.
12 |
13 | ## Bugs fixed
14 |
15 | - Issues with passages being placed in strange places after being dragged while Snap to Grid is turned on have been fixed.
16 | - If you have a test or play version of a story already open when you choose to test or play it again, the window or tab should update with the current version.
17 | - The welcome screen now scrolls properly when the **Next** button is used.
18 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.1
2 |
3 | Release Date: Apr 21, 2019
4 |
5 | ## Bugs fixed
6 |
7 | * In the desktop app, file saving is done in a safer manner so that if a problem occurs, any file that would have been overwritten should stay intact.
8 | * The desktop app now keeps short-term backups of your story library in case a bug occurs that affects the data on disk. It saves a backup copy of your library to a Backups folder in the main Twine folder when you first start it up, and every 20 minutes while Twine is running. It only keeps 10 backups at most, deleting older ones as needed, so this is not a full-fledged backup solution (and is not intended to be). It is intended as a way to restore data in the event of a crash or bug that overwrites data saved on disk.
9 | * The Chinese localization that should have appeared in 2.3.0 is in this version.
10 |
11 | ## Features added
12 |
13 | * Harlowe has been updated to version 3.0.2.
14 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.10.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.10
2 |
3 | Release Date: Jan 3, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Updated Harlowe to version 3.2.0.
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.11.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.11
2 |
3 | Release Date: Jan 17, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Updates Harlowe to version 3.2.1.
10 | * Updates Chapbook to version 1.2.1.
11 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.12.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.12
2 |
3 | Release Date: Jan 24, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Updated SugarCube to version 2.34.1.
10 | * Removed the "Reload" menu item in desktop app versions which could cause data loss.
11 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.13.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.13
2 |
3 | Release Date: Feb 15, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Includes a corrected version of Chapbook 1.2.1 that includes testing functionality.
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.14.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.14
2 |
3 | Release Date: May 11, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | Updated Harlowe to 3.2.2.
10 | Bugs fixed
11 | Removed a conflict between JavaScript polyfills provided by core-js and Harlowe.
12 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.15.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.15
2 |
3 | Release Date: Oct 21, 2021
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | Updated Harlowe to 3.2.3.
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.16.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.16
2 |
3 | Release Date: Jan 9, 2022
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | Updated SugarCube to 2.36.1.
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.2.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.2
2 |
3 | Release Date: Jun 10, 2019
4 |
5 | ## Bugs fixed
6 |
7 | * Various issues related to playing and testing stories within Twine have been resolved. Twine now opens playable versions of stories in your default browser instead of inside Twine.
8 | * An error where the editor UI became unresponsive after adding a new passage has been fixed.
9 | * Story formats with additional build information in their version number (e.g. "1.0.0-beta1") are now correctly handled.
10 | * Extraneous story saving, occurring when a passage was clicked but otherwise not moved or edited, has been removed.
11 | * The link to report a bug has been corrected to point to GitHub instead of the previous repository.
12 |
13 | ## Features added
14 |
15 | * Twine supports dark mode in macOS at a basic level. The window frame will change to match the system appearance, but you must still use the toggle in the story list to change theme. This may happen automatically in a future release.
16 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.3.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.3
2 |
3 | Release Date: Jul 22, 2019
4 |
5 | ## Bugs fixed
6 |
7 | * Proofing stories, broken in 2.3.2, is working again.
8 | * In previous versions, pressing control- or command-Z immediately after opening a text editor (passage, JavaScript, or stylesheet) would cause all text to be erased. This behavior no longer occurs.
9 | * The German localization has been improved (thanks to Kai Brueckers).
10 |
11 | ## Features added
12 |
13 | * Added a Catalan localization (thanks to Jordi Mallach).
14 | * Added a Norwegian localization (thanks to sinwes).
15 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.4.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.4
2 |
3 | Release Date: Sep 22, 2019
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Added Chapbook 1.0.0, a new story format.
10 | * Upgraded Harlowe to 3.1.0.
11 | * Upgraded Snowman to 1.4.0 and 2.0.0 respectively.
12 | * Upgraded SugarCube to 2.29.0.
13 | * Added Ukrainian localization (thanks to uk123ua).
14 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.5.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.5
2 |
3 | Release Date: Oct 7, 2019
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * The built-in version of SugarCube has been upgraded to 2.30.0.
10 | * Added Slovenian and Japanese localizations.
11 |
12 | ## Bugs fixed
13 |
14 | * A bug where extra blank lines were added to story JavaScript and CSS when importing a story has been fixed.
15 | * A bug where story formats would load incorrectly in the format dialog or story format chooser has been fixed.
16 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.6.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.6
2 |
3 | Release Date: Mar 30, 2020
4 |
5 | This release is only for the [web based version](https://twinery.org/2). It adds a warning for users of Safari 13.1 and beyond that their story library is at risk, and they should use a different platform. See [this Webkit blog post](https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/) under the "7-Day Cap on All Script-Writeable Storage" heading for technical details.
6 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.7.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.7
2 |
3 | Release Date: Apr 12, 2020
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Updated version of SugarCube story format, 2.31.1.
10 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.8.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.8
2 |
3 | Release Date: May 10, 2020
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * The colors used for syntax coloring in the CSS and JavaScript editors now have an improved contrast ratio.
10 | * On iOS, Twine now prompts to be added to the home screen, which will prevent story data from being automatically [deleted after 7 days of inactivity](https://webkit.org/blog/10218/full-third-party-cookie-blocking-and-more/).
11 | * Updated Chapbook to the latest version, 1.1.0.
12 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.3.9.md:
--------------------------------------------------------------------------------
1 | # Twine 2.3.9
2 |
3 | Release Date: Jul 12, 2020
4 |
5 | This is a maintenance release for Twine 2.3.
6 |
7 | ## Features added
8 |
9 | * Fixed a bug with story renaming in the app version.
10 | * Updated Chapbook to version 1.2.0.
11 | * Fixed a bug with story color selection in the story list.
12 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.5.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.5.1
2 |
3 | Release Date: Aug 28, 2022
4 |
5 | ## Story Format Updates
6 |
7 | Harlowe has been updated to 3.3.3.
8 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.6.1.md:
--------------------------------------------------------------------------------
1 | # Twine 2.6.1
2 |
3 | Release Notes: Feb 5, 2023
4 |
5 | ## New Features Added
6 |
7 | The Dutch translation has been updated.
8 |
9 | ## Bugs Fixed
10 |
11 | - Fixed a bug where passages would appear empty on the map when they weren't.
12 | - The Go To Passage dialog now receives mouse events properly.
13 | - Matches in the Find and Replace dialog should no longer flicker when other changes occur in a story.
14 | - The macOS app is now both signed and notarized, and should not require a right-click to open 🤞 .
15 | - Fixed a bug in Twee import where leading or trailing spaces in a passage name were not preserved.
16 |
--------------------------------------------------------------------------------
/pages/releasenotes/twine2/2.6.2.md:
--------------------------------------------------------------------------------
1 | # Twine 2.6.2
2 |
3 | Release Date: Feb 26, 2023
4 |
5 | ## New Features Added
6 |
7 | - The "Start Story Here" checkbox in passage edit dialogs has been replaced with "Test from Here".
8 |
9 | ## Story Format Updates
10 |
11 | - Chapbook has been updated to version 1.2.3.
12 | - Harlowe has been updated to version 3.3.5.
13 |
--------------------------------------------------------------------------------
/pages/savinggames/harlowe/harlowe_savinggames_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Saving Games in Harlowe
3 |
4 | :: Start
5 | (link:"Save game?")[
6 | (if:(save-game:"Slot A"))[
7 | (if: (saved-games:) contains "Slot A")[
8 | Slot A is in the saved-games datamap!
9 | ]
10 | (link: "Load Slot A?" )[
11 | (load-game: "Slot A")
12 | ]
13 | ](else: )[
14 | Sorry, I couldn't save your game.
15 | ]
16 | ]
17 |
--------------------------------------------------------------------------------
/pages/savinggames/sugarcube/sugarcube_savinggames_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Saving Games in SugarCube
3 |
4 | :: Start
5 | <>
12 |
13 | <>
14 | The first game slot exists! (This session was most likely reloaded from a game save.)
15 | <>
16 |
17 | <>
18 | <>
23 | <>
24 |
25 | <>
26 | <>
31 | <>
32 |
33 | <>
34 | <>
40 | <>
41 |
42 |
--------------------------------------------------------------------------------
/pages/settingandshowing/chapbook/chapbook_settingandshowing_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Setting and Showing Variables in Chapbook
3 |
4 | :: Start
5 | numberVariable: 5
6 | wordVariable: "five"
7 | phraseVariable: "The value"
8 | --
9 |
10 | {phraseVariable} is {numberVariable} and {wordVariable}.
11 |
12 | {embed passage: "Increment number"}
13 |
14 | The number variable was incremented by one to {numberVariable}.
15 |
16 | :: Increment number
17 | numberVariable: numberVariable + 1
18 | --
19 |
--------------------------------------------------------------------------------
/pages/settingandshowing/harlowe/harlowe_settingandshowing_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Setting and Showing Variables in Harlowe
3 |
4 | :: Start
5 | (set: $numberVariable to 5)
6 | (set: $textVariable to "five")
7 | (set: _textVariable to "The values")
8 |
9 | _textVariable are $numberVariable and $textVariable.
10 |
11 | (set: $numberVariable to it + 1)
12 |
13 | _textVariable are $numberVariable and $textVariable.
14 |
--------------------------------------------------------------------------------
/pages/settingandshowing/snowman/snowman_settingandshowing.md:
--------------------------------------------------------------------------------
1 | # "Setting and Showing Variables": Snowman (v1.3.0)
2 |
3 | ## Summary
4 |
5 | In Snowman, the *s* global variable can be used to store and retrieve values. Properties can be created and assigned freely. The [Underscore template functionality](http://underscorejs.org/#template) can be used to define, change, and show the values of variables.
6 |
7 | ## Example
8 |
9 | [Download](snowman_settingandshowing_example.html){: target="_top" download="snowman_settingandshowing_example.html"}
10 |
11 | ## Twee Code
12 |
13 | ```twee
14 | :: StoryTitle
15 | Setting and Showing Variables in Snowman
16 |
17 | :: Start
18 | <%
19 | s.numberVariable = 5;
20 | s.wordVariable = "five";
21 | s.phraseVariable = "The value";
22 | %>
23 |
24 | <%= s.phraseVariable %> is <%= s.numberVariable %> and <%= s.wordVariable %>.
25 |
26 | <%
27 | s.numberVariable++;
28 | %>
29 |
30 | <%= s.phraseVariable %> is <%= s.numberVariable %> and <%= s.wordVariable%>.
31 |
32 | ```
33 |
34 | [Twee Download](snowman_settingandshowing_twee.txt){ target="_top" download="snowman_settingandshowing_twee.txt"}
35 |
--------------------------------------------------------------------------------
/pages/settingandshowing/snowman/snowman_settingandshowing_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Setting and Showing Variables in Snowman
3 |
4 | :: Start
5 | <%
6 | s.numberVariable = 5;
7 | s.wordVariable = "five";
8 | s.phraseVariable = "The value";
9 | %>
10 |
11 | <%= s.phraseVariable %> is <%= s.numberVariable %> and <%= s.wordVariable %>.
12 |
13 | <%
14 | s.numberVariable++;
15 | %>
16 |
17 | <%= s.phraseVariable %> is <%= s.numberVariable %> and <%= s.wordVariable%>.
18 |
--------------------------------------------------------------------------------
/pages/settingandshowing/sugarcube/sugarcube_settingandshowing_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Setting and Showing Variables in SugarCube
3 |
4 | :: Start
5 | <>
6 | <>
7 | <>
8 |
9 | $phraseVariable is $numberVariable and $wordVariable.
10 |
11 | <>
12 |
13 | $phraseVariable is $numberVariable and $wordVariable.
14 |
--------------------------------------------------------------------------------
/pages/sidebar_left/harlowe/harlowe_sidebar_left_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Left Sidebar in Harlowe (both v1.x and v2.x series)
3 |
4 | :: UserStylesheet [stylesheet]
5 | /*
6 | Reposition the Sidebar 'footer' tagged passage.
7 | */
8 | tw-include[title="Sidebar"] {
9 | position: fixed;
10 | top: 0;
11 | left: 0;
12 | width: 20%; /* padding-right of the tw-story element. */
13 | max-height: 100%;
14 | margin-top: calc(5% + 171px); /* padding-top of the tw-story element plus computed height of the tw-sidebar element. */
15 | padding: 0.5em;
16 | background-color: transparent;
17 | text-align: right;
18 | }
19 |
20 | :: Start
21 | (set: $name to "Jane Doe", $location to "Work")\
22 | [[Another passage]]
23 |
24 | :: Sidebar [footer]
25 | Name: $name
26 | Location: $location
27 |
28 | :: Another passage
29 | (set: $name to "John Smith", $location to "Shop")\
30 | [[Start]]
--------------------------------------------------------------------------------
/pages/sidebar_left/harlowe_2/harlowe_sidebar_left_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Left Sidebar in Harlowe (v2.1.0 or later)
3 |
4 | :: UserStylesheet [stylesheet]
5 | /*
6 | Reposition the Sidebar 'footer' tagged passage.
7 | */
8 | tw-sidebar {
9 | position: fixed;
10 | top: 0;
11 | left: 0;
12 | width: 20%; /* padding-right of the tw-story element. */
13 | max-height: 100%;
14 | margin-top: 5%; /* padding-top of the tw-story element. */
15 | padding: 0 0.5em 0.5em 0.5em;
16 | text-align: right;
17 | background-color: transparent;
18 | }
19 | tw-icon {
20 | text-align: right;
21 | padding-right: 0.75em;
22 | }
23 |
24 | :: Start
25 | (set: $name to "Jane Doe", $location to "Work")\
26 | [[Another passage]]
27 |
28 | :: Sidebar [footer]
29 | (append: ?SideBar)[\
30 | Name: $name
31 | Location: $location
32 | ]
33 |
34 | :: Another passage
35 | (set: $name to "John Smith", $location to "Shop")\
36 | [[Start]]
--------------------------------------------------------------------------------
/pages/sidebar_left/snowman/snowman_sidebar_left_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Left Sidebar in Snowman
3 |
4 |
5 | :: UserScript [script]
6 | /*
7 | Create the element to display the contents of the Sidebar passage in.
8 | */
9 | $(document.createElement('div'))
10 | .attr('id', 'sidebar')
11 | .insertBefore('#passage');
12 |
13 | /*
14 | Monitor for the event that is triggered after the current Passage has been shown.
15 | */
16 | $(window).on('showpassage:after', function () {
17 | $('#sidebar').html(window.story.render("Sidebar"));
18 | });
19 |
20 |
21 | :: UserStylesheet[stylesheet]
22 | #passage {
23 | margin-left: 20%;
24 | }
25 |
26 | #sidebar {
27 | position: fixed;
28 | top: 0;
29 | left: 0;
30 | width: 18%;
31 | height: 100%;
32 | margin: 0;
33 | padding: 0.5em;
34 | background-color: black;
35 | color: white;
36 | }
37 |
38 |
39 | :: Start
40 | <% s.name = "Jane Doe"; s.location = "Work" %>
41 | [[Another passage]]
42 |
43 |
44 | :: Sidebar
45 | Name: <%= s.name %>
46 | Location: <%= s.location %>
47 |
48 |
49 | :: Another passage
50 | <% s.name = "John Smith"; s.location = "Shop" %>
51 | [[Start]]
52 |
--------------------------------------------------------------------------------
/pages/sidebar_left/sugarcube/sugarcube_sidebar_left_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Left Sidebar in SugarCube
3 |
4 | :: Start
5 | <>\
6 | [[Another passage]]
7 |
8 |
9 | <>
10 | <>
11 | <>
12 | <>
13 | <>
14 | <>
15 |
16 |
17 | :: StoryBanner
18 |
19 |
20 |
21 | :: StorySubtitle
22 | Version: 0.2.1
23 |
24 |
25 | :: StoryAuthor
26 | by Anonymous
27 |
28 |
29 | :: StoryCaption
30 | Name: $name
31 | Location: $location
32 |
33 |
34 | :: StoryMenu
35 | [[New story link!|Start]]
36 |
37 |
38 | :: StoryShare
39 | [[Twinery|https://twinery.org/]]
40 |
41 |
42 | :: Another passage
43 | <>\
44 | [[Start]]
45 |
--------------------------------------------------------------------------------
/pages/starting/twine2/adding_to_IFDB.md:
--------------------------------------------------------------------------------
1 | # Adding to IFDB
2 |
3 | The [IFDB](http://ifdb.tads.org/) is a user-editable catalog of interactive fiction, starting from the earliest days of *Adventure* (1976) all the way to contemporary works. People use it to discover and discuss IF, and in particular, the showcase of stories on the twinery.org home page is based on data stored there. The one thing the IFDB is not, though, is an archive to store work. It only contains pointers to resources stored elsewhere on the web.
4 |
5 | Existing works can be submitted for inclusion in the IFDB by using the [submission form](http://ifdb.tads.org/editgame?id=new). Most of the fields in the form are self-explanatory, but one that might seem confusing at first is the IFID.
6 |
7 | > **Note:** A IFID is similar to ISBN numbers for books; they uniquely identify a work, no matter its format. In Twine 2, the IFID can be found through opening the story in Twine 2, clicking ont he story menu, and then choosing Story Statistics.
8 |
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-debug-passage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-debug-passage.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-default-text.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-default-text.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-account.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-account.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-browser.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-browser.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-create.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-create.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-devlog.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-devlog.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-embed.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-embed.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-engine.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-engine.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-frame.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-frame.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-project-type.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-project-type.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-upload.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-upload.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-itchio-zip.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-itchio-zip.jpg
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-linked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-linked.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-new-format.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-new-format.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-paperthin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-paperthin.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-passage-editing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-passage-editing.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-passage-link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-passage-link.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-passage-view.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-passage-view.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-play-example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-play-example.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-play-link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-play-link.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-proofing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-proofing.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-second-passage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-second-passage.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-start-passage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-start-passage.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-story-list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-story-list.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-testing-passages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-testing-passages.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-testing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-testing.png
--------------------------------------------------------------------------------
/pages/starting/twine2/images/starting-title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iftechfoundation/twine-cookbook/208a75496a6841797739cdf83a455d5b0fb680c9/pages/starting/twine2/images/starting-title.png
--------------------------------------------------------------------------------
/pages/statichealthbars/chapbook/chapbook_statichealthbars_twee.txt:
--------------------------------------------------------------------------------
1 | :: StoryTitle
2 | Chapbook: Static Healthbars
3 |
4 | :: Start
5 | [JavaScript]
6 | // Create a global variable, health
7 | engine.state.set('health', 80);
8 |
9 | // Get the current value of 'health'
10 | let health = engine.state.get('health');
11 |
12 | // Write description
13 | write("Show a healthbar using a Progress element:
");
14 |
15 | // Write the progress element with dynamic value
16 | write('
');
17 |
18 | // Write description
19 | write("Show a healthbar using a Meter element:
");
20 |
21 | // Write the meter element with dynamic value
22 | write('');
23 |
24 |
--------------------------------------------------------------------------------
/pages/statichealthbars/harlowe/harlowe_statichealthbars.md:
--------------------------------------------------------------------------------
1 | # "Static Healthbars": Harlowe (v2.0)
2 |
3 | ## Summary
4 |
5 | "Static Healthbars" demonstrates how to write HTML elements using variable values. In this example, the [`(print:)`](https://twine2.neocities.org/#macro_print) macro is used to create `