{"id":18387827,"url":"https://github.com/dhowe/riscript","last_synced_at":"2025-04-12T03:19:15.137Z","repository":{"id":206462154,"uuid":"715921389","full_name":"dhowe/riscript","owner":"dhowe","description":"RiScript: a minor language","archived":false,"fork":false,"pushed_at":"2024-02-14T10:44:23.000Z","size":2117,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T03:19:10.894Z","etag":null,"topics":["creative-coding","creative-writing","generative-text","natural-language-generation"],"latest_commit_sha":null,"homepage":"https://rednoise.org/rita/reference/riscript.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhowe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-08T05:16:03.000Z","updated_at":"2024-08-30T02:39:12.000Z","dependencies_parsed_at":"2024-02-25T03:34:15.492Z","dependency_job_id":"1a7b5338-6383-4204-bac9-67b46a2984bf","html_url":"https://github.com/dhowe/riscript","commit_stats":null,"previous_names":["dhowe/riscript"],"tags_count":53,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Friscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Friscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Friscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhowe%2Friscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhowe","download_url":"https://codeload.github.com/dhowe/riscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248509998,"owners_count":21116130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["creative-coding","creative-writing","generative-text","natural-language-generation"],"created_at":"2024-11-06T01:28:09.469Z","updated_at":"2025-04-12T03:19:15.117Z","avatar_url":"https://github.com/dhowe.png","language":"JavaScript","readme":"\u003ca href=\"https://github.com/dhowe/riscript/actions\"\u003e\u003cimg src=\"https://github.com/dhowe/riscript/actions/workflows/node.js.yml/badge.svg\" alt=\"ci tests\"\u003e\u003c/a\u003e  \u003ca href=\"https://www.npmjs.com/package/riscript\"\u003e \u003cimg src=\"https://img.shields.io/npm/v/riscript.svg\" alt=\"npm version\"\u003e\u003c/a\u003e \u003ca href=\"https://www.gnu.org/licenses/gpl-3.0.en.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-GPL-orange.svg\" alt=\"license\"\u003e\u003c/a\u003e ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dhowe/riscript?label=code\u0026color=yellow)\n\n## RiScript: a scripting language for writers\n\nRiScript is a minor language designed for writers working in computational media. It runs in a variety of environments, including the browser, Node, Observable, P5.js, Android and others. RiScript primitives (choices, symbols, gates, transforms, etc) can be used as part of any RiScript [grammar](https://rednoise.org/rita/reference/RiScript/grammar/) or executed directly using [evaluate()](https://rednoise.org/rita/reference/RiScript/grammar/). RiScript is free/libre/open-source and integrates with [RiTa](https://rednoise.org/rita).\n\nFor more documentation and examples see this interactive [notebook](https://observablehq.com/@dhowe/riscript) on observable. \n\n### Installation\n\n* For [esm](#an-esm-browser-sketch): ```import { RiScript } from \"https://esm.sh/riscript\";```\n* For [browsers](#a-simple-browser-sketch): ```\u003cscript src=\"https://unpkg.com/riscript\"\u003e\u003c/script\u003e```\n* For [node](#with-nodejs-and-npm): `$ npm install riscript`  \n ```let { RiScript }  = require('riscript');```\n* For [developers](#developing)\n\n\n### Example\n\n```javascript\n\nimport { RiScript } from \"https://esm.sh/riscript\";\n\nlet script = \"[#name=[Jane | Bill]] was from [#place=[New York | Berlin]].\"\n  + \" $name finds $place cold and wet in winter.\";\n\nlet result = RiScript.evaluate(script);\n\nconsole.log(result);\n```\n\n\u003cbr\u003e\n\n## Developing\nTo install/build the library and run tests:\n```sh\n\n$ git clone https://github.com/dhowe/riscript.git\n$ cd riscript \n$ npm install\n$ npm run build \n$ npm test\n\n```\nIf all goes well, you should see a list of successful tests and find the library built in 'dist'\n\n\u003cbr\u003e\n\nPlease make contributions via [fork-and-pull](https://reflectoring.io/github-fork-and-pull/) - thanks!\n\n\u003cbr\u003e\n\n## About\n\n* Author:   [Daniel C. Howe](http://rednoise.org/daniel)\n* Tutorial: [https://observablehq.com/@dhowe/riscript](https://observablehq.com/@dhowe/riscript)\n* Github Repo:       [https://github.com/dhowe/riscript](https://github.com/dhowe/riscript)\n* Issues:       [https://github.com/dhowe/riscript/issues](https://github.com/dhowe/riscript/issues)\n* Reference:    [https://rednoise.org/rita/reference](http://rednoise.org/rita/reference)\n* RiTa Web:          [https://rednoise.org/rita](http://rednoise.org/rita)\n\n\u0026nbsp;\n\n## Quick Start \n\n#### A simple browser sketch\n \nCreate a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:\n\n```html\n\u003chtml\u003e\n\u003cscript src=\"https://unpkg.com/riscript\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  window.onload = function () {\n    let script = \"[#name=[Jane | Bill]] was from [#place=[New York | Berlin | Shanghai]].\"\n      + \" $name finds $place cold and wet in winter.\";\n    let html = RiScript.evaluate(script);\n    document.getElementById(\"content\").innerHTML = html;\n  };\n\u003c/script\u003e\n\u003cdiv id=\"content\" width=200 height=200\u003e\u003c/div\u003e\n\u003c/html\u003e\n```\n\n#### An ESM browser sketch\n \nCreate a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:\n\n```html\n\u003chtml\u003e\n\u003cbody\u003e\n  \u003cdiv id=\"content\" width=200 height=200\u003e\u003c/div\u003e\n  \u003cscript type=\"module\"\u003e\n\n    import { RiScript } from \"https://esm.sh/riscript\";\n\n    let script = \"[#name=[Jane | Bill]] was from [#place=[New York | Berlin | Shanghai]].\"\n      + \" $name finds $place cold and wet in winter.\";\n    let html = RiScript.evaluate(script);\n\n    document.getElementById(\"content\").innerHTML = html; \n  \u003c/script\u003e\n\u003c/body\u003e\n\u003chtml\u003e\n```\n\n#### With [p5.js](http://p5js.org/)\n \nCreate a new file on your desktop called 'test.html' with the following lines,, save and drag it into a browser:\n\n```html\n\u003chtml\u003e\n  \u003cscript src=\"https://unpkg.com/p5\"\u003e\u003c/script\u003e\n  \u003cscript src=\"https://unpkg.com/riscript\"\u003e\u003c/script\u003e\n  \u003cscript\u003e\n  function setup() {\n\n    createCanvas(600,200);\n    background(245);\n    textAlign(CENTER)\n    textSize(18);\n\n    let script = \"[#name=[Jane | Bill]] was from [#place=[New York | Berlin | Shanghai]].\"\n      + \" $name finds $place cold and wet in winter.\";\n    let result = RiScript.evaluate(script);\n    text(result, 300, 100);\n\n    createButton(\"refresh\").mousePressed(() =\u003e location.reload());\n  }\n  \u003c/script\u003e\n\u003c/html\u003e\n```\n\n#### With [node.js](http://nodejs.org/) and [npm](https://www.npmjs.com/)\n \nTo install: `$ npm install riscript`\n\n```javascript\nlet { RiScript }  = require('riscript');\n\nlet script = \"[#name=[Jane | Bill]] was from [#place=[New York | Berlin | Shanghai]].\"\n  + \" $name finds $place cold and wet in winter.\";\n\nlet result = RiScript.evaluate(script);\n\nconsole.log(result);\n```\n\n\u0026nbsp;\n\n## Contributors\n\n### Code Contributors\n\nThis project exists only because of the people who contribute. Thank you!\n\u003ca href=\"https://github.com/dhowe/riscript/graphs/contributors\"\u003e\u003cimg src=\"https://opencollective.com/RiTa/contributors.svg?width=890\u0026button=false\" /\u003e\u003c/a\u003e\n\n### Financial Contributors\n\u003ca href=\"https://opencollective.com/rita/donate\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://opencollective.com/rita/contribute/button@2x.png?color=blue\" width=300 /\u003e\n\u003c/a\u003e\n\n","funding_links":["https://opencollective.com/rita/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhowe%2Friscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhowe%2Friscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhowe%2Friscript/lists"}