Script lexer for Recital, which converts the Recital .stage
document format into JSON tokens, which can then be handed off to various other exporters or simply read as data.
Note that this core should only run on the scene / fragment level! Anything that interacts with the text of an individual scene or fragment should be handled in an extension.
import parser from '@a-morphous/recital`
const sceneList = parser(rawText)
...
Individual components and helpers can also be used:
import { createCommandObject } from '@a-morphous/recital/dist/lib/tools/command-shorthand'
createCommandObject(args)
Unfortunately, jest tests are broken, so instead there is a sandbox in the example
directory that can be run instead. To do so, run your favorite HTTP server (I like npm's http-server
) in this project directory:
$ http-server .
and then browse to http://localhost:8080/example/
.
NOTE: the server being pointed to the root directory is only necessary because the example has to point to the
dist
folder.