Git Product home page Git Product logo

custom-builder's Introduction

A custom module builder for any programming language, using GitHub

Download

What Does It Do?

Basically it concates files together from Github, allowing users to select which modules they want to include. Check out an example

Why Would I Use It?

It just gives you one less thing to worry about. Using Github, you can keep your files up to date, rather than worrying about continuously updating them on your server. If your code is not updated often, this plugin probably isnt for you.

Limitations

You need to set up a GitHub application in order to increase the API rate limit from 60 requests to 5000 requests per hour.

If you have 5 files, the script will make 10 requests. This is because the code first uses the name of the file to retrieve the most recent version number, then uses that version number to grab that file.

I'm not sure how secure the JSON request for the PHP token is, thoughts?

How to Use

First, you should only use this if your code can be broken into modules. See an example of my code. I'm using JavaScript (jQuery), but theoretically you can use whatever language you want.

Next, you change the files for each module name in your markup:

<div class="cb-options">
  <!-- The Checkboxes -->
    <input type='checkbox' data-cbuilder='{"setting:false":"setting:true"}' value='path/to/module1' id='module1'>
      <label for='module1'>module1</label>
    <!-- The Button -->
    <button class="compile">Compile</button>
    <div class="progress-bar-outer">
        <div class="progress-bar" style="width: 0%"></div>
    </div>
  </div>

I recommend you set the default settings to false in your code, then use the data-cbuilder to set it true on condition that it's included. You can change these as needed.

Notice that you may include a progress bar as well.

Then, edit the following JavaScript settings:

    userName:               "username",       // GitHub user name
    repoName:               "repository",     // GitHub repo name
    sha:                    false,            // Use SHA instead of file name
    headerFile:             null,             
    footerFile:             null,             
    buttonProcessingText:   "Building...",
    buttonFinishedText:     "Download Now",
    progressBarText:        null,             // Optionally add text on complete
    actionFile:             "build.php",
    authenticate:           false,            // Enable to increase API rate limit
    loginInfoFile:          "build.php",
    adjustSettings:         true              // In case you need to adjust settings

Some important things to pay attention to. You have to include a header and footer file, two files which would be included in each file regardless.

Finally, depending on your plugin options, you might have to write some additional javascript to set certain values from true to false so that your plugin will work. An automated method might be included in future updates.

custom-builder's People

Watchers

 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.