Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Update Jekyll + more #2035

Merged
merged 8 commits into from
Aug 13, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ build/
docs/code
docs/_site
docs/.sass-cache
docs/css/react.css
docs/js/*
docs/downloads
examples/shared/*.js
Expand Down
14 changes: 6 additions & 8 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ source 'https://rubygems.org'
gem 'rake'

# jekyll, which builds it all
gem 'jekyll', '~>1.3.0'
# 2.0 includes sass processing
gem 'jekyll', '~>2.0'

# Auto redirect pages
gem 'jekyll-redirect-from'

# JSON
gem 'json'

# SASS for CSS
gem 'sass'

# For `rake watch`
gem 'rb-fsevent'

# Redcarpet for Markdown
gem 'redcarpet'

# For markdown header cleanup
gem 'sanitize'
gem 'sanitize', '~>2.0'
91 changes: 56 additions & 35 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,61 +1,82 @@
GEM
remote: https://rubygems.org/
specs:
classifier (1.3.3)
blankslate (2.1.2.4)
celluloid (0.15.2)
timers (~> 1.1.0)
classifier (1.3.4)
fast-stemmer (>= 1.0.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.7.1)
colorator (0.1)
commander (4.1.5)
highline (~> 1.6.11)
execjs (2.2.1)
fast-stemmer (1.0.2)
ffi (1.9.3)
highline (1.6.20)
jekyll (1.3.0)
jekyll (2.2.0)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
liquid (~> 2.5.2)
listen (~> 1.3)
maruku (~> 0.6.0)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.3.0)
safe_yaml (~> 0.9.7)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.0)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.5.0)
jekyll (~> 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-watch (1.1.0)
listen (~> 2.7)
json (1.8.1)
liquid (2.5.4)
listen (1.3.1)
kramdown (1.4.1)
liquid (2.6.1)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
maruku (0.6.1)
syntax (>= 1.0.0)
mini_portile (0.5.2)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
posix-spawn (0.3.6)
pygments.rb (0.5.4)
mercenary (0.3.4)
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.9)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rake (10.1.0)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
rake (10.3.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.0)
ffi (>= 0.5.0)
redcarpet (2.3.0)
safe_yaml (0.9.7)
redcarpet (3.1.2)
safe_yaml (1.0.3)
sanitize (2.0.6)
nokogiri (>= 1.4.4)
sass (3.2.12)
syntax (1.0.0)
sass (3.3.14)
timers (1.1.0)
toml (0.1.1)
parslet (~> 1.5.0)
yajl-ruby (1.1.0)

PLATFORMS
ruby

DEPENDENCIES
jekyll (~> 1.3.0)
jekyll (~> 2.0)
jekyll-redirect-from
json
rake
rb-fsevent
redcarpet
sanitize
sass
sanitize (~> 2.0)
17 changes: 11 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Use Jekyll to serve the website locally (by default, at `http://localhost:4000`)

```sh
$ cd react/docs
$ rake
$ jekyll serve -w
$ bundle exec rake
$ bundle exec jekyll serve -w
$ open http://localhost:4000/react/
```

Expand All @@ -43,10 +43,9 @@ If you want to modify the CSS or JS, use [Rake](http://rake.rubyforge.org/) to c

```sh
$ cd react/docs
$ rake watch # Automatically compiles as needed.
# rake Manually compile CSS and JS.
# rake css Manually compile CSS, only.
# rake js Manually compile JS, only.
$ bundle exec rake watch # Automatically compiles as needed.
# bundle exec rake Manually compile CSS and JS.
# bundle exec rake js Manually compile JS, only.
```

## Afterthoughts
Expand All @@ -57,6 +56,12 @@ The easiest way to do this is to have a separate clone of this repository, check

**Note:** This should only be done for new releases. You should create a tag corresponding to the release tag in the main repository.

We also have a rake task that does the same thing (without creating commits). It expects the directory structure mentioned above.

```sh
$ bundle exec rake release
```

### Removing the Jekyll / Ruby Dependency

In an ideal world, we would not be adding a Ruby dependency on part of our project. We would like to move towards a point where we are using React to render the website.
20 changes: 12 additions & 8 deletions docs/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@ require('rubygems')
require('json')
require('yaml')

desc "generate css from sass"
task :css do
system "sass --style=compressed _css/react.scss css/react.css"
end

desc "generate js from jsx"
task :js do
system "../bin/jsx _js js"
end

desc "watch css & js"
desc "watch js"
task :watch do
Process.spawn "sass --style=compressed --watch _css/react.scss:css/react.css"
Process.spawn "../bin/jsx --watch _js js"
Process.waitall
end
Expand All @@ -29,9 +23,19 @@ task :update_version do
end
end

desc "update acknowledgements list"
task :update_acknowledgements do
authors = File.readlines('../AUTHORS').map {|author| author.gsub(/ <.*\n/,'')}
# split into cols here because nobody knows how to use liquid
# need to to_f because ruby will keep slice_size as int and round on its own
slice_size = (authors.size / 3.to_f).ceil
cols = authors.each_slice(slice_size).to_a
File.open('_data/acknowledgements.yml', 'w+') { |f| f.write(cols.to_yaml) }
end

desc "build into ../../react-gh-pages"
task :release => [:update_version, :default] do
system "jekyll build -d ../../react-gh-pages"
end

task :default => [:css, :js]
task :default => [:js]
34 changes: 25 additions & 9 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
---
baseurl: "/react"
name: React
description: A JavaScript library for building user interfaces
url: http://facebook.github.io
baseurl: "/react"
permalink: "/blog/:year/:month/:day/:title.html"
paginate_path: "/blog/page:num/"
relative_permalinks: true
paginate: 5
timezone: America/Los_Angeles
highlighter: pygments
defaults:
- scope:
path: ''
type: post
values:
layout: post
- scope:
path: docs
type: page
values:
layout: docs
exclude:
- Gemfile
- Gemfile.lock
- README.md
- Rakefile
markdown: redcarpet
redcarpet:
extensions:
- fenced_code_blocks
pygments: true
name: React
markdown: redcarpet
sass:
style: :compressed
sass_dir: _css
gems:
- jekyll-redirect-from
react_version: 0.11.1
description: A JavaScript library for building user interfaces
relative_permalinks: true
paginate: 5
paginate_path: "/blog/page:num/"
timezone: America/Los_Angeles
11 changes: 3 additions & 8 deletions docs/_css/bourbon/_bourbon-deprecated-upcoming.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
// These mixins/functions are deprecated
// They will be removed in the next MAJOR version release
//************************************************************************//
@mixin box-shadow ($shadows...) {
@include prefixer(box-shadow, $shadows, spec);
@warn "box-shadow is deprecated and will be removed in the next major version release";
}

@mixin background-size ($lengths...) {
@include prefixer(background-size, $lengths, spec);
@warn "background-size is deprecated and will be removed in the next major version release";
@mixin inline-block {
display: inline-block;
@warn "inline-block mixin is deprecated and will be removed in the next major version release";
}
30 changes: 25 additions & 5 deletions docs/_css/bourbon/_bourbon.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
// Settings
@import "settings/prefixer";
@import "settings/px-to-em";
@import "settings/asset-pipeline";

// Custom Helpers
@import "helpers/deprecated-webkit-gradient";
@import "helpers/convert-units";
@import "helpers/gradient-positions-parser";
@import "helpers/is-num";
@import "helpers/linear-angle-parser";
@import "helpers/linear-gradient-parser";
@import "helpers/linear-positions-parser";
@import "helpers/linear-side-corner-parser";
@import "helpers/radial-arg-parser";
@import "helpers/radial-positions-parser";
@import "helpers/radial-gradient-parser";
@import "helpers/render-gradients";
@import "helpers/shape-size-stripper";
@import "helpers/str-to-num";

// Custom Functions
@import "functions/compact";
@import "functions/assign";
@import "functions/color-lightness";
@import "functions/flex-grid";
@import "functions/golden-ratio";
@import "functions/grid-width";
@import "functions/linear-gradient";
@import "functions/modular-scale";
@import "functions/px-to-em";
@import "functions/radial-gradient";
@import "functions/px-to-rem";
@import "functions/strip-units";
@import "functions/tint-shade";
@import "functions/transition-property-name";
@import "functions/unpack";

// CSS3 Mixins
@import "css3/animation";
Expand All @@ -27,12 +41,15 @@
@import "css3/border-image";
@import "css3/border-radius";
@import "css3/box-sizing";
@import "css3/calc";
@import "css3/columns";
@import "css3/filter";
@import "css3/flex-box";
@import "css3/font-face";
@import "css3/font-feature-settings";
@import "css3/hyphens";
@import "css3/hidpi-media-query";
@import "css3/image-rendering";
@import "css3/inline-block";
@import "css3/keyframes";
@import "css3/linear-gradient";
@import "css3/perspective";
Expand All @@ -45,6 +62,8 @@
// Addons & other mixins
@import "addons/button";
@import "addons/clearfix";
@import "addons/directional-values";
@import "addons/ellipsis";
@import "addons/font-family";
@import "addons/hide-text";
@import "addons/html5-input-types";
Expand All @@ -54,6 +73,7 @@
@import "addons/size";
@import "addons/timing-functions";
@import "addons/triangle";
@import "addons/word-wrap";

// Soon to be deprecated Mixins
@import "bourbon-deprecated-upcoming";