@6i/ink-tools 中文文档教程

发布于 4年前 浏览 25 项目主页 更新于 3年前

ink-tools

将 inkle 的故事 Ink 文件编译成 JSON,带有观看模式。

ink-tools CLI application

Features

ink-utils 是一个使用 commander.js。 它的设计是为了促进与 inkjs 的集成,inkle 的 ink 脚本语言的 javascript 实现,并使用 ink story到 Web 应用程序(SPA、React、Angular …)

中 ink-utils 可以:

  • Compile a ink file into Json.
  • Watch for ink file changes, in order to perform compilation each time.

Installation

使用 npm纱线

全局安装:

$ yarn global add @6i/ink-tools

作为本地开发依赖项:

$ yarn add @6i/ink-tools --dev

Usages

Options

compile 命令有很多选项:

optionsdescription
-s, --silentDo not output any message
-vǀ-vvǀ-vvv, --verboseIncrease the verbosity level : level 1 for normal information, 2 more verbose for debugging and 3 for full debug.
-o, --outputChange the output where JSON file is created.
-w, --watchEnable watch mode, to detect if ink file has changed and start compilation each time.

Make a single compilation

compile 命令等待 *.ink 文件作为第一个参数。 如果没有其他选项,它将编译成一个与输入墨水文件同名且相同文件夹的 json 文件。

# Simple usage
$ ink-tools compile .\ink\story-basic.ink

=== Start compilation ===
[success] Inklecate compilation has finished !

您可以使用 -v 添加详细信息,并使用 --output 更改输出,如下所示:

# Change output JSON
$ ink-tools compile .\ink\story-basic.ink -v --output .\myStory.json

=== Start compilation ===
[info] Ink name file: story-basic.ink
[info] Ink path file: D:\6i\ink-tools\ink\story-basic.ink
[info] Output JSON: D:\6i\ink-tools\myStory.json
[info] Inklecate bin: D:\6i\ink-tools\bin\inklecate\inklecate_win.exe
[info] Ink compilation is starting.
[success] Inklecate compilation has finished !

Watch for ink file change

要启用监视模式,只需添加 --watch< /code> compile 命令中的选项。

$ ink-tools compile .\ink\story-basic.ink --watch -v

该程序可以监听墨水文件的变化,并在每次检测到变化时开始编译。 它使用文件的 MD5 校验和来检查文件是否真的改变了。

ink-tools CLI application

Ink story

Ink 是 < a href="http://www.inklestudios.com">inkle 用于编写交互式叙述的脚本语言,既适用于以文本为中心的游戏,也适用于包含高度分支故事的更多图形游戏。 它旨在易于学习,但具有足够强大的功能以允许高级结构化。

License

MIT 许可下发布。

版权所有 (c) 2020 by 2o1oo vb20100bv@gmail.com

ink-tools

Compile inkle's story Ink file into JSON, with watching mode.

ink-tools CLI application

Features

ink-utils is a CLI application built in node.js with commander.js. It was designed in order to facilitate its integration wiht inkjs, the javascript implementation of inkle's ink scripting language, and to consume ink story into a web application (SPA, React, Angular …)

ink-utils can :

  • Compile a ink file into Json.
  • Watch for ink file changes, in order to perform compilation each time.

Installation

Install with npm or yarn.

Global installation:

$ yarn global add @6i/ink-tools

As local developpement dependencies:

$ yarn add @6i/ink-tools --dev

Usages

Options

The compile command have many options :

optionsdescription
-s, --silentDo not output any message
-vǀ-vvǀ-vvv, --verboseIncrease the verbosity level : level 1 for normal information, 2 more verbose for debugging and 3 for full debug.
-o, --outputChange the output where JSON file is created.
-w, --watchEnable watch mode, to detect if ink file has changed and start compilation each time.

Make a single compilation

The compile command wait as first argument an *.ink file. Without another option, it will compil into a json file with the same name and the same folder of input ink file.

# Simple usage
$ ink-tools compile .\ink\story-basic.ink

=== Start compilation ===
[success] Inklecate compilation has finished !

You can add verbosity with -v, and change output with --output <jsonFile> like this :

# Change output JSON
$ ink-tools compile .\ink\story-basic.ink -v --output .\myStory.json

=== Start compilation ===
[info] Ink name file: story-basic.ink
[info] Ink path file: D:\6i\ink-tools\ink\story-basic.ink
[info] Output JSON: D:\6i\ink-tools\myStory.json
[info] Inklecate bin: D:\6i\ink-tools\bin\inklecate\inklecate_win.exe
[info] Ink compilation is starting.
[success] Inklecate compilation has finished !

Watch for ink file change

To enable watch mode, just add --watch option in compile command.

$ ink-tools compile .\ink\story-basic.ink --watch -v

The program can listen for ink file changes and start compilation each time it detects changement. It use an MD5 checksum of the file in order to check if the file has really changed.

ink-tools CLI application

Ink story

Ink is inkle's scripting language for writing interactive narrative, both for text-centric games as well as more graphical games that contain highly branching stories. It's designed to be easy to learn, but with powerful enough features to allow an advanced level of structuring.

License

Release under MIT license.

Copyright (c) 2020 by 2o1oo vb20100bv@gmail.com

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文