1
0
Fork 0
mirror of https://github.com/Oreolek/raconteur.git synced 2024-06-26 03:30:47 +03:00
raconteur/README.md

96 lines
3.5 KiB
Markdown
Raw Normal View History

2015-04-11 04:54:03 +03:00
# Raconteur
2015-04-08 03:52:38 +03:00
2015-04-11 08:35:40 +03:00
Raconteur makes writing interactive hypertext fiction with Undum straightforward and perhaps even fun. It's a wrapper library that bundles oft-needed functionality and a new, cleaner, CoffeeScript-friendly, DSL-inspired API for defining Undum stories.
```coffeescript
situation 'west_of_house',
content: (character, system, from) ->
"""
# West of House
You are standing in an open field west of a white house, with a boarded
up front door.
#{roomContents(character, system)}
"""
```
2015-04-08 03:52:38 +03:00
2015-04-11 04:54:03 +03:00
Raconteur is still in active development towards its 1.0 release.
2015-04-08 03:52:38 +03:00
2015-04-11 04:54:03 +03:00
## Implemented Features
2015-04-08 03:52:38 +03:00
2015-04-11 04:54:03 +03:00
- 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.
2015-04-13 09:19:08 +03:00
- An advanced game [template](http://github.com/sequitur/raconteur-scaffold/) that sets up a complete development environment for authors: A build system (gulp), CSS preprocessing (Less), and dependency management (Browserify + npm).
2015-04-08 03:52:38 +03:00
2015-04-13 09:19:08 +03:00
## Planned features
2015-04-11 04:54:03 +03:00
- A complete code refactoring of Undum and Raconteur itself with testability
in mind, allowing the use of testing frameworks with Undum stories.
2015-04-11 08:35:40 +03:00
## Installation
2015-04-13 09:19:08 +03:00
Raconteur can be added as a dependency to a package.json file and installed from git. Or, you can use the [scaffold](http://github.com/sequitur/raconteur-scaffold).
2015-04-11 08:35:40 +03:00
2015-04-15 00:31:06 +03:00
Raconteur itself doesn't contain any command-line tools or anything that needs to be installed globally. You just need `npm` to be working on your system. Raconteur is a set of CommonJS modules designed to work with Browserify and a build system like Grunt or Gulp.
2015-04-11 08:35:40 +03:00
2015-04-11 04:54:03 +03:00
## Code examples
2015-04-08 03:52:38 +03:00
2015-04-11 04:54:03 +03:00
Those examples all use CoffeeScript.
Defining a simple situation in Raconteur:
2015-04-08 03:52:38 +03:00
```coffeescript
2015-04-11 04:54:03 +03:00
situation 'raconteur_example',
2015-04-08 03:52:38 +03:00
content: """
2015-04-11 04:54:03 +03:00
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.
2015-04-08 03:52:38 +03:00
"""
2015-04-11 04:54:03 +03:00
```
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}.
"""
2015-04-08 03:52:38 +03:00
```
2015-04-08 03:55:53 +03:00
## License
2015-04-11 04:54:03 +03:00
In short: You can use, modify, or redistribute Raconteur and Undum, for any
2015-04-08 03:55:53 +03:00
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.
2015-04-11 04:54:03 +03:00
Raconteur itself is copyright (c) 2015 Bruno Dias, and released under the
2015-04-08 03:55:53 +03:00
same MIT license.