Skip to main content

A static content generator for interactive and parametrisable p5.js canvases.

Project description

Ginpar

Awkwardly named after Generative Interactive Parametrisable Canvases.

Generate a static site that indexes a list of P5.js sketches and turns each of those into an interactive sketch.

  • Sketches are inside a folder sketches/
  • Will use the filename as the sketch name.
  • Index of the site will contain a list of a tags for each sketch.
  • Will read each sketch and create a page for each one:
    • A form will be created using a params object that specifies the type, range, step, and default values of the variables.
    • A fixed section will contain the canvas and will allow for easy saving, auto-naming using the seed, and scaling.

Current version may work for other libraries, but it's only meant for P5.js.

Following versions my guarantee support for different libraries.

How to use

  1. Install Ginpar. pip install ginpar

  2. Create config.toml to indicate the metadata of the website. You can copy this config.toml example.

  3. Create sketches/ and add all your P5.js sketches.

  4. For each script, you must define the ginpar.params object (preferably at the beginning). Read the ginpar.params API

    /* ## */
    const ginpar.params = {
    height: {
        value: 500,
        type: "number",
        range: [0, 4096]
    },
    my-variable: {
        value: .8,
        type: "slide",
        range: [0, 1],
        step: .05
        // ...
    },
    //   ...
    };
    /* ## */
    

    Note that the /* ## */ are the important thing to add!

  5. Run python build.py.

  6. Enjoy your website created at public/.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ginpar-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file ginpar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ginpar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for ginpar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f7163abb3507b3871800e505509d1849738166ebeba53f85d01928193949b98
MD5 e501206cd280544d81409ce01e277d05
BLAKE2b-256 09e6d9980d92eccf9321f01619422dc26b7ad67231fb072c3e7cdca7f312ca26

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page