robbestad / rantjs Goto Github PK
View Code? Open in Web Editor NEWProcedurally generate text with JavaScript
Procedurally generate text with JavaScript
this would be awesome for those of us who want to use this on web w/o using something like browserify
Hi @svenanders ,
We are cdnjs team, we want to host this project in cdnjs.
But I'm not sure which files in this repo need to be added, could you please help up find out the main files?
Thank you.
When I attempt to use any of the repeat syntax ([rep:3]
), I receive this error:
Error: Cannot find module 'en_US'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at braceParser (/Users/brekk/Servers/test/node_modules/rantjs/braceParser.js:43:17)
My example code:
var rant = require('rantjs');
var x = rant('[rep:8]{<adj nsfw>}');
I started playing around with your online demo and wanted to point out a few important block features that I noticed were missing.
First, I tried creating a block with some normal text in it.
It doesn't appear to print anything. According to the original specification, it should print the same text as if it weren't in the block:
Example text
Calling rep
followed by a block containing a raw string prints nothing, no matter how many repetitions are specified. It seems to only work with a single query. If rep
is not called, a block is ignored.
If a block has no repetitions specified, it should always be assumed that the block will be read one time.
Since blocks currently only support lone queries, I decided to test multiple item selection. This doesn't appear to be supported yet, either.
Each repetition should randomly select a noun, adjective, or verb.
I understand that Rantjs is still in early development, and perhaps you were already planning to fix these things, but I thought I'd write this up just in case you missed any of them by mistake.
A friend of mine recently rewrote all of the Rant documentation. You can find it here. If your aim is to go with the original language spec, you might find it useful as a reference.
How difficult would it be to implement seed based generation or using a custom random number generator?
Please remove window.rant=rant;
in line 82 of index.js so we can use it in node again.
This project looks great!
Any plans for node support? Using modules (ES6 / CommonJS) would probably clean up your build step quite a lot as well.
Hi @svenanders ,
We are cdnjs team.
Because we prefer to use dist
folder and the name with meaning, we decide to grab files from GitHub instead of npm.
But the git auto-updater in cdnjs relied on git tags so that it can recognize the correct version and automatically update the repo.
Could you please add git tags for the repo? Thank you.
The dictionary parser is currently not working, so building Rantjs with the latest version of Rantionary won't work. I'm currently working on a fix.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.