Coder Social home page Coder Social logo

kino_code_input's Introduction

KinoSmartcellTemplate

Twitter Follow

This is a template project for making an Elixir Kino Smart Cell module for use in Livebook. Uses the following stack:

  • Vite as the build system
    • You can elect to use any front-end framework you desire by adding its requisite Vite Plugin.
  • TailwindCSS for CSS / Styling
    • Uses the color palette provided by the official Livebook team from the kino_bundler package

For an example of a project built using this template, you can refer to Merquery, which uses the Vite Vue Plugin

Directory Structure

.
├── README.md
├── assets -------------------------> Includes JS development files (can be excluded in release)
│   ├── package.json
│   ├── postcss.config.js
│   ├── src
│   │   ├── main.css
│   │   └── main.js
│   ├── tailwind.config.js ---------> Tailwind Config including the Livebook color palette
│   └── vite.config.js -------------> Vite config specific to building for a Kino.SmartCell
├── lib ----------------------------> Contains Elixir files (/build folder will be generated in this dir)
│   ├── application.ex -------------> Registers smart cell(s) to be exposed
│   └── kino_smartcell_template.ex -> Contains smart cell implementation
└── mix.exs

Usage

  1. Create a new repo from this template as shown here
  2. Clone a local copy
  3. Change all references to kino_smartcell_template and KinoSmartCellTemplate to your application's name
  4. From within the lib/assets directory run npm i to install dependencies.
    1. Optionally add any plugins or other dependencies you need
  5. From within lib/assets run npm run dev to start a watchful Vite build. Now when you make changes they will automatically be rebuilt by Vite. Note that you will still need to reload the smart cell from Livebook to register the changes to the build

Building for Release

From within the assets folder run npm build and the minified/bundled releases will be put into /lib/build/ and be built for production.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.