erikccoder / RiTaJS

RiTaJS: A generative language toolkit for JavaScript

Home Page:http://rednoise.org/rita/js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

RiTaJS: a generative language toolkit for JavaScript

RiTaJS is designed to an easy-to-use toolkit for experiments in natural language and generative literature, based on the RiTa (http://rednoise.org/rita) library for Java. Like the original RiTa, RiTaJS works alone or in conjunction with Processing(JS) and/or as a NodeJS or Bower module. All RiTa and RiTaJS tools are free/libre/open-source according to the GPL (http://www.gnu.org/licenses/gpl.txt).

About the project


A Simple Sketch


Create a new file on your desktop called hello.html, add the following lines, save and drag it into a browser:

  <html>
  <canvas id="canvas" width=200 height=200></canvas>
  <script src="https://rednoise.org/rita/download/rita-latest.min.js"></script>
  <script>

    window.onload = function() {
    
      // create a RiText and draw it
      
      RiText("HelloWorld").draw();
      
	};

  </script>
  <html>

With ProcessingJS


If you want to use RiTa with ProcessingJS, you can simply open Processing and switch to 'JavaScript' mode. If you don't want to use the Processing IDE, you can cimply create an HTML file like this (assuming you've downloaded both libraries to the current directory):

  <html>
  <meta charset="utf-8"/>

  <script src="processing-min.js"></script>
  <script src="rita-latest.min.js"></script>
  <script type="text/processing" data-processing-target="mycanvas">

	size(200,200);
	background(255);
	
	RiText("SIMPLE").fill(200,100,0).draw();

  </script>
  <canvas id="mycanvas"></canvas>
  <html>

With NodeJS


 
 To install: $ npm install rita
 
 rita = require('rita');
 rs = rita.RiString("The white elephant smiled.");
 console.log(rs.features());

Can I contribute?


Please! We are looking for more coders to help out... Just press Fork at the top of this github page and get started, or follow the instructions below...

Development Setup


  1. Download and install npm. The easiest way to do this is to just install node.
  2. Fork and clone this library.

a. First, login to github and fork the project

b. Then, from a terminal/shell (substitute your github name for $YOUR_GITHUB_LOGIN):

$ git clone https://github.com/$YOUR_GITHUB_LOGIN/RiTaJS.git
  1. Now navigate into the project folder and install dependencies via npm.
    $ cd RiTaJS; npm install
  2. To create the library from src, use gulp.
    $ gulp build
  3. Run non-graphical tests in node, use gulp.
    $ gulp test.node
  4. Run all tests (in phantomJS), use gulp.
    $ gulp test
  5. Work on an existing issue, then submit a pull request...

About

RiTaJS: A generative language toolkit for JavaScript

http://rednoise.org/rita/js


Languages

Language:JavaScript 99.4%Language:Shell 0.2%Language:CSS 0.2%Language:Processing 0.1%