https://github.com/verekia/initializr
HTML5 Boilerplate Build Tool
https://github.com/verekia/initializr
Last synced: 5 months ago
JSON representation
HTML5 Boilerplate Build Tool
- Host: GitHub
- URL: https://github.com/verekia/initializr
- Owner: verekia
- Created: 2011-04-18T22:35:42.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2022-11-01T03:51:24.000Z (almost 3 years ago)
- Last Synced: 2025-04-08T12:05:38.357Z (6 months ago)
- Language: Less
- Homepage: http://initializr.com
- Size: 18.8 MB
- Stars: 1,443
- Watchers: 80
- Forks: 239
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# 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 inindex.html
:
\\
and also adds
modernizr-2.0.min.js
in thejs/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) specifyfile
for this field if the current insertion is an entire file (like modernizr JS file).