Giter Club home page Giter Club logo

widget-builder's Introduction

Widget Builder

npm version

Develop, install, and distribute HTML widgets for your Windows desktop with a simple CLI


Table of Contents

  1. Installation
  2. Quickstart Guide
  3. Samples
  4. Publishing and installing
    1. Publishing
    2. Installing
  5. The Config File
  6. Using the CLI
  7. Contributing Widgets

Installation

Download, unzip, navigate to the folder, and install with npm:

$ npm install -g
$ npm start

or download directly from npm:

$ npm install -g widget-builder

Quickstart Guide

  1. Create a new folder
  2. cd to the folder, enter widgets init, and fill in your project's name
  3. Mess around with the generated HTML file to customize your widget's appearance
  4. Add and link JavaScript or CSS files to your master HTML file
  5. Modify the config file
  6. Navigate to the folder and enter widgets build to locally build and install your widget

Samples

Check out Spotify listener, a widget for listening to your favorite tunes: Spotify listener

Publishing and installing widgets

Publishing

So you want to share your widget for distribution? Here's what to do:

  1. cd to your project folder
  2. Run widgets publish
  3. A new dist folder will be generated in the same directory as your project folder. You can now distribute this folder, and others can install it with widgets install

Installing

Here's how to install a widget that was shared with you:

  1. Navigate to the folder
  2. Run widgets install

The Config File

Every widgets project contains a config.json file. This file tells the program what settings you would like to use for your widget.
Here's a standard config file:

{
  "name": "widget",
  "version": "1.0.0",
  "description": "Custom desktop widget",
  "index": "./index.html",
  "properties": {
    "x": 100,
    "y": 100,
    "width": 100,
    "height": 100,
    "transparent": false,
    "interact": true,
    "draggable": true
  }
}
Property Definition
name (string) Project name
version (string) Project version
index (string) The reference to your master HTML file. Other references (like JS or CSS) should be linked in this file.
x, y, width, and height (integers) The position and dimensions of your widget when it is first start up
transparent (boolean) Make the widget's background transparent
interact (boolean) Make the widget interactable
draggable (boolean) Make the widget draggable
top (boolean) Make the widget stay on top of all windows
requirements (array) npm packages required for the widget to function; these packages are locally installed when the widget is installed
install (string or array) Script(s) to run during widget installation

Using the CLI

Once widget builder is installed, the CLI can be accessed with the keyword widgets

Commands

Command Definition
widgets build [folder] Builds HTML files to desktop widget and installs
widgets publish [folder] Generates a dist file that can be installed by the widgets cli
widgets install [folder] Installs widget at folder
widgets init [folder] Initializes widgets project
widgets list Lists all installed widgets
widgets uninstall <widget> Uninstall widget by name
widgets config <widget> Configure widget by name
widgets start [folder] Starts the widget at folder

Options

Command Definition
widgets --help Show help
widgets --version Displays the current version

Contributing Widgets

Here you can find instructions for sharing widgets you have created

widget-builder's People

Contributors

underpig1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.