Skip to main content

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

Project description

Ginpar PyPI

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. Initialize a new project ginpar-init
  3. Modify config.py to reflect the metadata of the website.
  4. Add your sketches to sketches/. Feel free to remove example.js.
  5. 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!
  6. Build your static site ginpar.
  7. Enjoy your site created at public/.

Dependencies

This project only uses Jinja2 as template engine, however, some code snippets were heavily inspired by Pelican source code.

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 Distribution

ginpar-0.1.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distributions

ginpar-0.1.2-py3.7.egg (14.9 kB view details)

Uploaded Egg

ginpar-0.1.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file ginpar-0.1.2.tar.gz.

File metadata

  • Download URL: ginpar-0.1.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • 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.2.tar.gz
Algorithm Hash digest
SHA256 b545d52b1571b1cf4be9e1410d36290060f654dbfc05410e466859041c521845
MD5 62c9af3f5939e7b917e1895e7563581b
BLAKE2b-256 739220a7c95b293c9d7e4e74aef75efd82bfdd4607461df136aa7839a06d88e0

See more details on using hashes here.

File details

Details for the file ginpar-0.1.2-py3.7.egg.

File metadata

  • Download URL: ginpar-0.1.2-py3.7.egg
  • Upload date:
  • Size: 14.9 kB
  • Tags: Egg
  • 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.2-py3.7.egg
Algorithm Hash digest
SHA256 873ee1fd284331b23315ade7298aa654f21d4be1c8516e9842c4d14a5e2b7bd4
MD5 b6762b094d2e29e78615a98180c4f71e
BLAKE2b-256 44ae8ffd6baffe62e6675f8f4ab03602d7cfd804615132821bf02fb117f63e32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ginpar-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b7c37d011bb5a264e9527524b1b11999ce808fdd05eb7d2d92505335fec9496b
MD5 a959bfcb3b92d56f1b24da5bfe65722a
BLAKE2b-256 6f3fcc5df5990ba8176cf820208183ac2db00fd63943c5907a528d4847f87411

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