From c5b49775129885651c3c98cc92ca1232e7060fce Mon Sep 17 00:00:00 2001 From: Yannick Lohse Date: Wed, 21 Sep 2016 20:55:20 +0200 Subject: [PATCH] Updated doc and formats --- Gruntfile.js | 6 +++--- README.md | 16 +++++++++++----- package.json | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b9fa7e4e..7e703fb2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -18,7 +18,7 @@ module.exports = function(grunt) { moduleName: 'inkjs', }, release: { - dest: 'dist/ink.js', + dest: 'dist/ink-es2015.js', src: exposedFiles }, legacy: { @@ -31,7 +31,7 @@ module.exports = function(grunt) { }), ], }, - dest: 'dist/ink-legacy.js', + dest: 'dist/ink.js', src: exposedFiles }, legacy_min: { @@ -45,7 +45,7 @@ module.exports = function(grunt) { uglify(), ], }, - dest: 'dist/ink-legacy.min.js', + dest: 'dist/ink.min.js', src: exposedFiles } }, diff --git a/README.md b/README.md index c172e3ce..4ef01796 100644 --- a/README.md +++ b/README.md @@ -2,21 +2,27 @@ This is a javascript port of inkle's [ink](https://github.com/inkle/ink), a scripting language for writing interactive narrative. Please have a look at [the demo](http://yannick-lohse.fr/inkjs/)! -inkjs should support pretty much everything the original version does. If you find any bugs, please report them here! The code has zero dependencies and it should work in node and all evergreen browsers. +inkjs should support pretty much everything the original version does. If you find any bugs, please report them here! The code has zero dependencies and it should work in node.js and all evergreen browsers. ## Getting started *browser version* ### Installation -Grab the most convenient format for you from the [release page](https://github.com/y-lohse/inkjs/releases). If in doubt, use the iife version. +Grab the ink.js file from the [latest release](https://github.com/y-lohse/inkjs/releases). -It's also available on bower: `bower install inkjs` +There's an ES2015 version available if you only target browsers with basic ES 2015 support that has a lighter footprint. +Both versions use Universal Module Definition (UMD), so you can use it with [RequireJS](http://requirejs.org/) or basically any other module loader. If you don't know what any of this means, don't worry, you'll be fine too. +It's also available on bower: `bower install inkjs`. ### Loading inkjs -If you're using the IIFE version, add the script to your page and it will create aglobal object called `inkjs`. If you're using the AMD/UMD version, you need to require the package using your prefered mechanism. +Add the script to your page: -The `inkjs` has a property called `Story`. This is the main class we will interact with. +``` + +``` + +This will create a global object named `inkjs`. It has a property called `Story` which is the main class we will interact with. ### Loading a json file diff --git a/package.json b/package.json index ba6a0a45..66132727 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "inkjs", "version": "1.1.1", "description": "A javascript port of inkle's ink scripting language (http://www.inklestudios.com/ink/)", - "main": "dist/ink.js", + "main": "dist/ink-es2015.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "grunt rollup",