This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from toolkitchen/master
update to latest toolkitchen
- Loading branch information
Showing
127 changed files
with
3,224 additions
and
11,768 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
_site | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "toolkit"] | ||
path = toolkit | ||
url = [email protected]:toolkitchen/toolkit.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module.exports = function(grunt) { | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
|
||
pkg: grunt.file.readJSON('package.json'), | ||
jekyllConfig: grunt.file.readYAML('_config.yml'), | ||
|
||
jekyll: { | ||
server : { | ||
server: true, | ||
server_port: '<%= jekyllConfig.server_port %>', | ||
auto: true | ||
}, | ||
dev: { | ||
server: false, | ||
safe: false | ||
}, | ||
prod: { | ||
auto: false, | ||
server: false | ||
} | ||
}, | ||
|
||
watch: { // for development run 'grunt watch' | ||
jekyll: { | ||
files: ['./*.html'], | ||
tasks: ['jekyll:dev'] | ||
} | ||
}, | ||
|
||
copy: { | ||
main: { | ||
files: [{ | ||
expand: true, | ||
cwd: '_site/', // set base for src matches. | ||
src: ['**'], // includes files and subdirs of cwd. | ||
dest: '<%= jekyllConfig.destination %>' | ||
}] | ||
} | ||
} | ||
|
||
}); | ||
|
||
// Plugin and grunt tasks. | ||
grunt.loadNpmTasks('grunt-jekyll'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
|
||
// Default task. Run standard jekyll server. | ||
grunt.registerTask('default', ['jekyll:server']); | ||
|
||
// Task to build docs. | ||
grunt.registerTask('docs', ['jekyll:prod']); | ||
|
||
// Task to build and copy docs over to publishing repo. | ||
grunt.registerTask('publish', ['jekyll:prod', 'copy:main']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,47 @@ | ||
Toolkitchen docs are mostly in Markdown with some HTML. [Jekyll][1] generates the HTML site from the source, which is then pushed (manually, for now) to the "gh-pages" branch. To publish a change to the live site, you would follow this basic process: | ||
Toolkitchen docs are mostly in Markdown with some HTML. [Jekyll][jekyll] is used to generate the static HTML for the site. The output is copied to | ||
`/toolkitchen/toolkitchen.github.com` for serving. | ||
|
||
1. Checkout master and make desired changes. | ||
2. Build docs locally with Jekyll, and verify changes. The generated site is placed in a folder named "_site". | ||
3. Push the generated site (the contents of the _site folder) to the "gh-pages" branch. | ||
4. Push the source file changes to "master". | ||
Our documentation source files (located in this repo) and the rendered HTML (located in `/toolkitchen/toolkitchen.github.com`) | ||
are in separate repos in order to take advantage of Jekyll `_plugins`, special build scripts, and have full control | ||
over doc generation. | ||
|
||
I've checked in my _config.yml file, which causes Jekyll to serve the generated site from http://localhost:4000. It also watches for changes to the source files and rebuilds the site, so you can just hit reload a few seconds after saving your changes. | ||
## Install the requirements | ||
|
||
Eventually, the process will be much simpler: The doc source files will be in the gh-pages branch, you will push your changes there, and the site will be rebuilt immediately by Github. At the moment, the Jekyll process on GitHub is failing to build the site, presumably because it doesn't like something about the source files. For now, however, it's a bit of a manual process. | ||
We use [Grunt][grunt] to generate the documentation. You'll need to install the requirements before working on the docs: | ||
|
||
[1]: https://github.com/mojombo/jekyll | ||
npm install | ||
|
||
## Making edits and previewing changes | ||
|
||
This repo (`toolkitchen/docs`) is where the documentation source files live. To make a change, follow this basic process: | ||
|
||
1. Checkout this repo and make desired changes. | ||
- To build the docs locally, run `grunt` or ``. This starts a web server at | ||
[http://localhost:4000](http://localhost:4000) where you can preview your edits. This also watches and rebuilds on changes. | ||
|
||
The generated site is placed in a folder named `_site`. Alternatively, if you just want to | ||
build the docs and not run a webserver, run: | ||
|
||
grunt jekyll:server | ||
|
||
Once your changes look good, `git commit` them and push. | ||
|
||
## Building and pushing the docs | ||
|
||
First, checkout `toolkitchen/toolkitchen.github.com`. This repo is where the generated docs live | ||
and are served from using [Github Pages](https://help.github.com/categories/20/articles). | ||
|
||
Next, run the `publish` task: | ||
|
||
grunt publish | ||
|
||
This generates the docs in `_site/` and copies its contents into your checked out version | ||
of `toolkitchen/toolkitchen.github.com`. | ||
|
||
The last step is to commit and push those changes live. To do that, just make the commit: | ||
|
||
git commit -am 'Updating live docs' | ||
git push | ||
|
||
[jekyll]: https://github.com/mojombo/jekyll | ||
[grunt]: http://gruntjs.com/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
# Server defaults. | ||
server: false | ||
server_port: 4000 | ||
auto: true | ||
server: true | ||
pygments: true | ||
|
||
# Project defaults. | ||
markdown: redcarpet | ||
# # safe: true | ||
# # lsi: false | ||
# # destination: docs/ | ||
# # url: http://localhost:4000/docs | ||
pygments: false | ||
lsi: false | ||
safe: false | ||
|
||
exclude: "node_modules/, README.md" | ||
|
||
# Be sure to checkout the toolkitchen.github.com repo. | ||
# This is where the generated docs will be output. | ||
destination: ../toolkitchen.github.com | ||
|
||
# Site globals used throughout docs. | ||
load_platform: true | ||
project_title: Toolkitchen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script src="/js/prettify/prettify.js"></script> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/bootstrap/js/bootstrap.min.js"></script> | ||
<script src="/js/bootstrap-scrollspy.js"></script> | ||
<script> | ||
var _gaq = _gaq || []; | ||
_gaq.push(['_setAccount', 'UA-39334307-1']); | ||
_gaq.push(['_trackPageview']); | ||
|
||
(function() { | ||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | ||
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | ||
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | ||
})(); | ||
|
||
// Change "active" style on selected left-hand navigation menu item. | ||
$(document).ready(function () { | ||
var path = location.pathname; | ||
$('ul.nav > li > a[href="' + path + '"]').parent().addClass('active'); | ||
|
||
// TODO: Use kramdown {:.prettyprint .linenums .lang-ruby} to add the | ||
// <pre class="prettyprint"> instead of doing this client-side. | ||
$('pre').addClass('prettyprint'); | ||
window.prettyPrint && prettyPrint(); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="chrome=1" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title> | ||
{% if page.title %} | ||
{{page.title}} - | ||
{% else %} | ||
Welcome - | ||
{% endif %} {{site.project_title}} Project | ||
</title> | ||
<link rel="shortcut icon" href="images/logos/webcomponents.png"> | ||
<link href="//fonts.googleapis.com/css?family=Open+Sans:300,300italic,600,800|Source+Code+Pro" rel="stylesheet" type="text/css"> | ||
<link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"> | ||
<link href="/css/prettify/sunburst.css" rel="stylesheet" type="text/css"> | ||
<!-- <link href="/css/pygments/default.css" rel="stylesheet" type="text/css"> --> | ||
<link href="/css/site.css?{{'now' | date: "%Y%m%d"}}" rel="stylesheet" type="text/css"> | ||
|
||
{% if site.load_platform %} | ||
<!-- Toolkit platform code --> | ||
<script src="/toolkit/platform/platform.js?{{'now' | date: "%Y%m%d"}}"></script> | ||
<script src="/toolkit/toolkit.js?{{'now' | date: "%Y%m%d"}}"></script> | ||
<!--<script src="http://toolkitchen.github.io/toolkit/toolkit.min.js"></script>--> | ||
<!-- TODO toolkit.min.js throws <Symbol> has no method 'shimStyling' error--> | ||
|
||
{% for item in page.components %} | ||
<link rel="import" src="{{ item }}"> | ||
{% endfor %} | ||
|
||
{% for item in page.stylesheets %} | ||
<link rel="stylesheet" src="{{ item }}"> | ||
{% endfor %} | ||
{% endif %} |
Oops, something went wrong.