Git Product home page Git Product logo

initializr's Introduction

Initializr - Documentation

Download or Print

The idea of Initializr API is pretty simple. You can either download an archive or display its content. Just ping this URL to get an archive of Initializr:

http://www.initializr.com/builder

Please note that the content of this particular archive is not relevant because no "module" have been added to it, but you'll understand that in a minute.

If you add a ?print parameter, it will display the content of the archive without downloading it:

http://www.initializr.com/builder?print

Modules

Initializr uses "modules", which are code snippets or files (or both) that will be included in the archive.

The modernizr module, for instance, adds the following line in index.html:

<script src="js/libs/modernizr-2.0.min.js"></script>

and also adds modernizr-2.0.min.js in the js/libs directory.

If you want to add a module to your archive, just add the name of that module as a GET parameter:

http://www.initializr.com/builder?print&jquery&modernizr

All the current available modules can be found on this Github.

How a module is defined

Let's take a look at what contains modules/modernizr on the Git repo:

  • modernizr-2.0.min.js - It's the actual Modernizr JS file,
  • modernizr.html - It's the file containing the HTML JavaScript code inclusion,
  • modernizr.json - Here is the interesting stuff! Let's take a closer look at this file:
{
	"author" : "Paul Irish",
	"name" : "Modernizr",
	"id" : "modernizr",
	"inserts" :
	[
		{
			"what" : "modernizr.html",
			"where" : "index.html/head/html5polyfill"
		}
	,
		{
			"what" : "modernizr-2.0.min.js",
			"where" : "js/libs/modernizr-2.0.min.js",
			"type" : "file"
		}
	],
	"incompatibilities" : ["html5shiv"]
}

We can see that a module configuration file is actually a simple JSON containing the following members:

  • author: The name of the author of the module,
  • name: The "Fancy name" of the module,
  • id: The unique id of the module (prefixed with h5bp- or izr- if it's from HTML5 Boilerplate or Initializr),
  • incompatibilities: An array of modules ids that can't be used with this one.
  • inserts: An array of insertions of code snippets or files with the following fields:
    • what: What code snippet or file is going to be included in the archive (refers to an other file of the same module folder),
    • where: In which file and place the code snippet will be injected (in these files), or the name of the file if it's an entire file,
    • type: (optional) specify file for this field if the current insertion is an entire file (like modernizr JS file).

initializr's People

Contributors

codef0rmerz avatar frio avatar roblarsen avatar verekia avatar webveloper 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

initializr's Issues

An idea - a cdnjs module

Hi Jonathan,

Here is the idea. I often do the same things every time I need to add other libraries, probably and hopefully hosted on cdnjs, I will always do the same few steps:

  • check cdnjs.com for needed lib
  • copy the cdnjs url for this lib
  • get a local copy to fall back if offline
  • append the new <script /> tags, both for cdnjs and the local version.

example using backbone

<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/0.5.1/backbone-min.js"></script>
<script>window.Backbone || document.write('<script src="js/libs/backbone-min.js"><\/script>')</script>

The idea would be to automate this, maybe it can find its way in initializr.

Using the github api, it may be possible to get a list of cdnjs hosted scripts (+version) to provide users a way to customize the build even further. We may grab a local copy to ideally add the correct snippet to the build output.

I don't know about the complexity involved, or if it's something that makes sense to you both technically and functionally but I really like the idea.

What do you think?

navs.less missing something

At line 52, you also need to add ".nav-list .active > a:hover".

Not sure if it's just me or not, but I found this when compared the style to the style directly from bootstrap 2 on twitter.

Initializr update for TB

Hi! TB has been featuring some new css and js files on the upcoming version. It would be great if initializr got updated with these.

thanks!

Build doesn't support ant 1.8.3?

When I had problems with Winant, I installed Ant myself manually. I installed Ant 1.8.3 (the latest version) from ant.apache.org and had problems with the build script. Specifically the problem was this error message:
"All features of the build script require Ant version 1.8.2. Please upgrade to 1.8.2 or remove all instances of 'overwrite=no' (and this fail task) from the build script to continue"

Which I believe is caused by this snippet in build.xml:

<fail message="All features of the build script require Ant version 1.8.2. Please upgrade to 1.8.2 or remove all        instances of 'overwrite=no' (and this fail task) from the build script to continue">
<condition>
<not>
<contains string="${ant.version}" substring="1.8.2"/>
</not>
</condition>
</fail>

I suggest updating the build to support 1.8.3 also.

[reopened with more info] build.xml can support Ant 1.8.3

As requested, I duplicated my issue to Ant build:
h5bp/ant-build-script#67 (comment)

The code is indeed old code, and the current version of the check should be:

    <!-- Test for Ant Version Delete this task and all instances of overwrite='no' if you can't upgrade to latest-->
    <fail message="All features of the build script require Ant version 1.8.2 or greater. Please upgrade to the latest version or remove all instances of 'overwrite=no' (and this fail task) from the build script to continue">
    <condition>
    <not>
    <antversion atleast="1.8.2"/>
    </not>
    </condition>
    </fail>

(to replace code described in):
#47

@import should be removed in responsive.less with bootstrap

Using the bootstrap version I saw many properties duplicated in the compile CSS file, like this:

table .span21{
    float:none;
    width:1644px;
    margin-left:0;
    float:none;
    width:1644px;
    margin-left:0;
}

After googling a bit I found that:
http://stackoverflow.com/questions/9840474/less-compiler-doubles-everything

And it solves the problem! Basically the import: @import "bootstrap/responsive.less"; is including the files "variables.less" and "mixins.less" again - they are already included in the first import of "bootstrap.less". So, removing these imports in responsive.less fix the problem.

Duplicate Grid CSS Generation

Hey Jonathan, what's up!? I just wanted to report a quick issue. It's quite benign, but I thought I'd give you a heads up. If you download a copy of a Initializr Twitter's Bootstrap, compile the less and then check out the resulting CSS, you should see that the CSS rules for the grid are duplicated. For some strange reason, this does not happen with Twitter's own copy of Bootstrap.

It's from the grid.less file, here's the code: #grid > .core(@gridColumnWidth, @gridGutterWidth);. It pulls the mixin from mixins.less at line 548. The duplicates are directly after the first rule set. Example:

    /* Starting at line 150 */
    .row {
        margin-left: -20px;
        *zoom: 1;
    }
    .row:before,
    .row:after {
        display: table;
        content: "";
    }
    .row:after {
        clear: both;
    }
    [class*="span"] {
        float: left;
        margin-left: 20px;
    }
    .container,
    .navbar-fixed-top .container,
    .navbar-fixed-bottom .container {
        width: 940px;
    }
    .span12 {
        width: 940px;
    }
    /* … */
    .span1 {
        width: 60px;
    }

    /* And then it just repeats it again */

    .row {
        margin-left: -20px;
        *zoom: 1;
    }
    .row:before,
    .row:after {
        display: table;
        content: "";
    }
    /* And so on … */

The duplicates are a part of the base code and not within media-queries. I've tried to fix it, but can't seem to figure out why it's duplicating the rules. BTW, I'm using CodeKit as the compiler, but I wouldn't think that would cause the issue as the grid output is the only thing that duplicates (from I can see).

Anyway, it's not critical issue, but I thought I would just report the strange behavior. It's been making me crazy as hell just trying to figure out why it's doing it, but I'm no LESS expert. Thanks for all your hard work and great contribution to our community. Cheers!

`@media print` should not be in `mediaqueries`

While it uses the same rule, it is quite different to what gets associated as a 'media query' rule. I would recommend this be left on by default or use a separate tag to include it.

mixed line endings

lots of reports of mixed line endings coming from intitalizr builds..

that's about all the deets i got for ya. :)

Bootstrap responsive template has no gutter

I found when I chose Bootstrap with the standard options, for some reason the resulting index page has no gutter. The left-hand span is exactly at the edge, unlike the Bootstrap homepage.

I did some comparisons, but couldn't see where the CSS differs unfortunately.

About community plugins

Hi everyone,

One of my first goals when I started Initializr was to create a community of people who write their own plugins (or "modules") for Initializr, to make it richer. In my mind it would have included tons of various JS libraries, CSS frameworks, tools, grid systems, toolkit UI, themes, mobile versions, etc. on top of HTML5 Boilerplate.

There are a couple of serious issues about that:

  • Initializr's other major goal is to be kept simple, so everyone can enjoy it. More options to please specific users would make it too complex and less usable.
  • Some modules are incompatible with each others or require others modules. So if you write a perfectly functional module right now, and someone creates another one incompatible with yours later, it's going to mess things up and you would have to manually update yours.
  • Even if the backend was ready to support this kind of stuff (incompatibilities work already), the frontend would still need to be updated manually, including JS behavior like "if I select this, it should deselect that", popups explaining why they can't get both, etc.

The site could of course be improved to support that kind of community plugins (with a separate page, automatic frontend generation, some dependencies / incompatibilities graph), but this would really be overkill and requires a huge amount of work (and I don't have that much time to spend on it).

So here is the "announcement":

I will only provide support for major components such as H5BP, jQuery, Modernizr, Bootstrap, etc. and won't consider smaller ones. Also, for most cases, I will update modules myself to make sure nothing gets broken.

Being able to mix so many things on Initializr is already pretty complex and unfortunately (I guess it's my fault), I haven't seen any pull request that wouldn't have broken the site if pulled and deployed as is. However, I appreciate a lot when you notice me about an update for one of the components. Feel free to open an issue saying something like "Hey there is a new version of Bootstrap you noob, update Initializr... and fast!"

Sorry about that, I hope you will understand this choice.

Minor update of H5BP

Few commits have been made on H5BP since the last version.
Initializr should get updated.

Problem displaying header-container on mobile devices (iOS)

Hello,

There is a problem displaying the header-container in safari for mobile device (iPhone and iPad). In fact the width of the header stops at the size of the screen of the mobile device.

Same problem for the footer. Is there a way to fix this?

Thanks for concern

Simon

Outdated Respond.js, crashes IE8 on WinXP

The Respond.js script being used in 3 different modules is outdated:

  • html5shivrespond
  • modernizrrespond
  • respond

A bug which caused browser crashes for IE8 in Windows XP was fixed over a month ago: scottjehl/Respond@ed8479c.

I'd pull in the changes myself, but I'm not sure if there's anything beyond concatenation going on in html5shivrespond and modernizrrespond, so I'll leave it to the experts.

Blank page in IE 7

When I use Initializr it renders blank pages in IE 7, even the Initializr sample page doesn't load. I selected Modernizr.

Is this a known issue, or am I screwing something up?

Analytics snippet update

The new Analytics snippet uses Modernizr to load, so Initializr should include it and the options should be changed.

No more 'ddbelatedpng'

We recommend people against this. Plus we have better options for almost all platforms to choose from to create transparent pngs that work in IE6.

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.