Safe Haskell | None |
---|
Once created, processing scripts can be included in HTML canvas.
To be able to reproduce the animation, you must import the processing.js
library, downloadable from http://processingjs.org/download (do not import
it from the original link, download it and use your own copy).
To import processing.js, use a script
tag.
<script src="processing.js"></script>
See importScript
.
Note from the author: I didn't manage to run a processing animation locally, so you may have the same issue. Once I uploaded them to my server, they worked just fine.
- procCanvas :: FilePath -> Html
- importScript :: FilePath -> Html
- defaultHtml :: FilePath -> FilePath -> Text -> Html
- writeHtml :: FilePath -> FilePath -> Text -> FilePath -> ProcScript -> IO ()
Documentation
Create a canvas element which contain a Processing animation. The output is of the following form:
<canvas data-processing-sources="specified path"></canvas>
Create the following HTML element:
<script src="specified path"></script>
Use it to import the processing.js script,
inside the head
tag.
:: FilePath | Where to find the processing.js module. |
-> FilePath | File name for the Processing script (with |
-> Text | Html title. |
-> Html | Html output. |
Default template for visualizing Processing scripts in HTML.
:: FilePath | Where to find the processing.js module. |
-> FilePath | Where to write the Processing script (with |
-> Text | Html title. |
-> FilePath | Where to write the HTML file (with |
-> ProcScript | Processing script. |
-> IO () |
Write a Processing script and the HTML default template for it
to files, using renderFile
and defaultHtml
.
All the FilePath
s must be relative to where the HTML file is written.