1
0
Fork 0
mirror of https://github.com/Oreolek/raconteur.git synced 2024-05-17 00:08:16 +03:00

Rename project to Raconteur

This commit is contained in:
Bruno Dias 2015-04-10 22:54:03 -03:00
parent 98b2f0bb0b
commit ac4baabb42
6 changed files with 68 additions and 71 deletions

View file

@ -1,45 +1,81 @@
# Undularity
# Raconteur
Undularity is a wrapper library for Undum which provides a lot of commonly-used functionality inspired by common Twine extensions, such as replacer/inserter links. It also provides a new API for Undum, with a DSL-like syntax that is especially suitable to be used with CoffeeScript or ES6.
Raconteur is a wrapper library for Undum, a system for writing hypertext
interactive fiction. Raconteur that to provide a more programmer-friendly
API as well as a bundle of commonly-needed functionality, for novices and
expert users alike.
Undularity is still a work in progress.
Raconteur is still in active development towards its 1.0 release.
## Code example
## Implemented Features
Defining a situation in Undularity using ES6:
- DSL-like syntax for defining situations.
- A powerful situation prototype that bundles a lot of commonly-used
functionality.
- Shorthand for defining common hypertext interactions such as text
replacement or insertion, similar to popular Twine extensions.
- Most properties of situations can be either functions or strings,
making it easy to turn a simple situation into a complex one.
- An interface that is specifically designed to be used with ECMAScript 6 via
Babel, or CoffeeScript.
- Markdown, rather than raw HTML, as the format for most text content using
markdown-it.
- A tool bundle of iterators that makes it easy to define adaptive text
snippets.
- Based on CommonJS principles (Using undum-commonjs), allowing all game code
to be bundled using Browserify.
```es6
situation('undularity_example', {
content: `
This is an example situation using Undularity's API. It supports Markdown
in text, and helper functions to add
${a().class('segue').content('links').toSituation('another_situation')}
more easily.
`});
```
## Planned Features
Or with CoffeeScript:
- An advanced game template that sets up a complete development environment
for authors: A build system (gulp), CSS preprocessing (Less), and dependency
management (Browserify + npm).
- A complete code refactoring of Undum and Raconteur itself with testability
in mind, allowing the use of testing frameworks with Undum stories.
## Code examples
Those examples all use CoffeeScript.
Defining a simple situation in Raconteur:
```coffeescript
situation 'undularity_example',
situation 'raconteur_example',
content: """
This is an example of a situation using Undularity's API. It supports Markdown
in text, and helper functions to add
#{a().class('segue').content('links').toSituation('another_situation')}
more easily.
This is an example of a situation using Raconteur's API. It supports
Markdown in text, so the content of a simple situation can just be
written out without explicit HTML.
"""
# The link will render as:
# <a class="segue" href="another_situation">links</a>
```
Using text snippets:
```coffeescript
situation 'variations',
content: (character, system) ->
# content can be either a function or a simple string, transparently
color = oneOf(['bright purple', 'sickly green', 'brilliant white'])
.randomly(system) # We pass the system object so that random results
# will always be the same across different runs of
# the same saved game.
"""
# Reflecting Pool
You find yourself in an underground, flooded cave. Light shimmers on
the walls, #{color}.
"""
```
## License
In short: You can use, modify, or redistribute Undularity and Undum, for any
In short: You can use, modify, or redistribute Raconteur and Undum, for any
purpose, as long as this license document is kept with copies of it. See
LICENSE for legalese.
Undum is copyright (c) 2009-2015 I D Millington, and released under the MIT
license.
Undularity itself is copyright (c) 2015 Bruno Dias, and released under the
Raconteur itself is copyright (c) 2015 Bruno Dias, and released under the
same MIT license.

View file

@ -1,7 +1,7 @@
var situation = require('undularity/situation.js'),
var situation = require('raconteur/situation.js'),
$ = require('jquery'),
undum = require('undum-commonjs'),
tools = require('undularity/tools.js');
tools = require('raconteur/tools.js');
var a = situation.a,
span = situation.span,
@ -12,7 +12,7 @@ undum.game.version = "1.0";
situation('start', {
content:
`This is a testing situation for Undularity, a better development system for Undum.
`This is a testing situation for Raconteur, a better development system for Undum.
Choose one of the options below to see the relevant content and test it.`,
choices: ['#testing-option']
@ -25,7 +25,7 @@ situation('functions-as-properties', {
us to incorporate variables such as the name of the situation we came
from; in this case, "${from}."
Undularity allows most properties that are text to be defined as
Raconteur allows most properties that are text to be defined as
functions; the notable exception is optionText. Those functions are
passed the character and system objects, in that order, and a third
object that is usually either the current situation, or the situation
@ -38,7 +38,7 @@ situation('markdown-features', {
content: `
# Markdown Support
Undularity uses Markdown for formatting the content of individual
Raconteur uses Markdown for formatting the content of individual
situations. Supported features include **strong** and *emphasis*,
headers (as above), [external links](http://github.com), and even
preformatted blocks of text:
@ -56,7 +56,7 @@ situation('special-links', {
content: `
# Special Links
Undularity supports various special types of links, starting with
Raconteur supports various special types of links, starting with
${a('writer').class('once').writer('writerlink')} links.
Also notable are ${a('replacer').id('replacer-link').replacer('replacer-link')}

29
init.js
View file

@ -1,29 +0,0 @@
var fs = require('fs'),
stream = require('stream');
var dirs = [
'./game',
'./game/game',
'./game/html',
'./game/less',
'./game/lib'
];
var files = {
'./template/html/index.html': './game/html/index.html',
'./template/less/undum.less': './game/less/undum.less',
'./template/less/undum-mobile.less': './game/less/undum-mobile.less',
'./undum/lib/undum.js': './game/lib/undum.js',
'./undum/lib/random.js': './game/lib/random.js',
'./undularity/undularity.js': './game/lib/undularity.js',
'./template/Gulpfile.js': './game/Gulpfile.js',
'./template/js/main.js': './game/game/main.js'
};
dirs.forEach(function (dir) {
fs.mkdirSync(dir);
});
Object.keys(files).forEach(function (key) {
fs.createReadStream(key).pipe(fs.createWriteStream(files[key]));
});

1
node_modules/undularity generated vendored
View file

@ -1 +0,0 @@
../lib

View file

@ -1,6 +1,6 @@
{
"name": "undularity",
"version": "0.1.0",
"name": "raconteur",
"version": "0.2.0",
"description": "A friendly API framework for building hypertext interactive fiction with Undum",
"license": "MIT",
"author": {

View file

@ -1,9 +0,0 @@
{
"folders":
[
{
"path": ".",
"folder_exclude_patterns": ["node_modules", "devel/build"]
}
]
}