Ink for the Web
Learning Ink
- Part 1: Installing Inky and Common Terms
- Part 2: Choices and Knots
- Part 3: Sticky and Advanced Choices
- Part 4: Includes and Stitches
- Part 5: Alternatives, Sequences, Cycles, and Shuffles
- Part 6: Gather Points and Labelled Options
- Part 7: Global, Temporary, and Constant Variables
- Part 8: Knot Parameters and Functions
- Part 9: Tunnels and Threads
- Part 10: Lists
Ink is a scripting language for creating interactive fiction like choose-you-own-adventures and other vast, branching stories.
Using the Inky editor and Ink’s tagging system, projects can be created for play in a web browser through adding images, using meta instructions, and customizing layout and styles using CSS.
Exporting for the Web
When using the Inky Editor, code written in Ink can be exported for the web. When used in this way, a compiled Ink project can be played in a web browser and shared on sites like Itch.io for others to see.
When used for the first time with a project, Inky will save the project based on the file name, creating a folder based on what is inputted in the Save As field.
Note: Screenshots from the MacOS X version of Inky.
Folder Organization
Inside the exported project folder will be five files: index.html, ink.js, main.js, style.css, and nameOfProject.js.
To play the project locally, open the index.html file in a web browser. It should appear as it did in the editor view but with the name of the project included at the top.
Editing Files
To prepare a project for others to play, two files are more important than the others: index.html and style.css. Unfortunately, these two files will be replaced each time the Export to Web process is completed.
When editing the style.css file (to change CSS rules), use the “Export story.js only…” option from the File menu and select the nameOfProject.js file to replace only that file each time.
Note: Screenshots from the MacOS X version.