Permalink
Browse files

Migrate to Jekyll 1.0.0.rc1

  • Loading branch information...
1 parent 98593c6 commit 807e1a77e871c5737aaebe6babb44f1c14f733f2 Michael Klishin committed May 1, 2013
Showing with 29 additions and 114 deletions.
  1. +2 −5 Gemfile
  2. +22 −16 Gemfile.lock
  3. +3 −7 README-tools.md
  4. +2 −3 _config.yml
  5. +0 −35 _plugins/gist.rb
  6. +0 −48 _plugins/redcarpet2markdown.rb
View
@@ -1,7 +1,4 @@
-source :rubygems
+source "https://rubygems.org"
-gem "jekyll"
-# gem "rdiscount"
+gem "jekyll", ">= 1.0.0.rc1"
gem "redcarpet"
-gem "haml"
-gem "RedCloth"
View
@@ -1,34 +1,40 @@
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- RedCloth (4.2.9)
- albino (1.3.3)
- posix-spawn (>= 0.3.6)
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
+ colorator (0.1)
+ commander (4.1.3)
+ highline (~> 1.6.11)
directory_watcher (1.4.1)
- fast-stemmer (1.0.0)
- haml (3.1.4)
- jekyll (0.11.2)
- albino (~> 1.3)
+ fast-stemmer (1.0.2)
+ highline (1.6.18)
+ jekyll (1.0.0.rc1)
classifier (~> 1.3)
- directory_watcher (~> 1.1)
- kramdown (~> 0.13)
+ colorator (~> 0.1)
+ commander (~> 4.1.3)
+ directory_watcher (~> 1.4.1)
+ kramdown (~> 0.14)
liquid (~> 2.3)
maruku (~> 0.5)
- kramdown (0.13.5)
- liquid (2.3.0)
- maruku (0.6.0)
+ pygments.rb (~> 0.4.2)
+ safe_yaml (~> 0.7.0)
+ kramdown (0.14.2)
+ liquid (2.5.0)
+ maruku (0.6.1)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
+ pygments.rb (0.4.2)
+ posix-spawn (~> 0.3.6)
+ yajl-ruby (~> 1.1.0)
redcarpet (2.2.1)
+ safe_yaml (0.7.1)
syntax (1.0.0)
+ yajl-ruby (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
- RedCloth
- haml
- jekyll
+ jekyll (>= 1.0.0.rc1)
redcarpet
View
@@ -24,21 +24,17 @@ by running the following in the CDS repository root:
> run the gem-installed `jekyll` to view your local version of
> the site.
-Then install Pygments via your OS-specific package installer, or else using `pip` (assuming you've installed pip):
-
- pip install pygments
-
## How To Run A Development Server
- ./bin/jekyll --server --auto
+ ./bin/jekyll serve --watch
-The server will be started at `localhost:4000`.
+The server will be started at [localhost:4000](http://localhost:4000).
## How To Regenerate The Site
To regenerate the entire site, use
- ./bin/jekyll
+ ./bin/jekyll build
View
@@ -5,7 +5,6 @@ auto: true
exclude: [bin, CNAME, Gemfile, Gemfile.lock, README.md]
permalink: /:title
pygments: true
-# markdown: rdiscount
-markdown: redcarpet2
+markdown: redcarpet
redcarpet:
- extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
+ extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
View
@@ -1,35 +0,0 @@
-module Jekyll
-
- #
- # Render gist
- #
- # Usage:
- #
- # {% gist gist_id %} =>
- #
- # Raises: Liquid::SyntaxError
- class Gist < ::Liquid::Tag
-
- Syntax = /(#{::Liquid::Expression}+)?/
-
- def initialize(tag_name, markup, tokens)
- if markup =~ Syntax
- @gist_id = $1
- @options = {}
- markup.scan(::Liquid::TagAttributes) { |key, value| @options[key.to_sym] = value.gsub(/"|'/, '') }
- else
- raise ::Liquid::SyntaxError.new("Syntax Error in 'link' - Valid syntax: gist <id> <options>")
- end
-
- super
- end
-
- def render(context)
- %{<script src="http://gist.github.com/#{@gist_id}.js"></script>}
- end
- end
-
-end
-
-
-Liquid::Template.register_tag('gist', Jekyll::Gist)
@@ -1,48 +0,0 @@
-require 'fileutils'
-require 'digest/md5'
-require 'redcarpet'
-require 'albino'
-
-PYGMENTS_CACHE_DIR = File.expand_path('../../_cache', __FILE__)
-FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
-
-class Redcarpet2Markdown < Redcarpet::Render::HTML
- def block_code(code, lang)
- lang = lang || "text"
- path = File.join(PYGMENTS_CACHE_DIR, "#{lang}-#{Digest::MD5.hexdigest code}.html")
- cache(path) do
- colorized = Albino.colorize(code, lang)
- add_code_tags(colorized, lang)
- end
- end
-
- def add_code_tags(code, lang)
- code.sub(/<pre>/, "<pre><code class=\"#{lang}\">").
- sub(/<\/pre>/, "</code></pre>")
- end
-
- def cache(path)
- if File.exist?(path)
- File.read(path)
- else
- content = yield
- File.open(path, 'w') {|f| f.print(content) }
- content
- end
- end
-end
-
-class Jekyll::MarkdownConverter
- def extensions
- Hash[ *@config['redcarpet']['extensions'].map {|e| [e.to_sym, true] }.flatten ]
- end
-
- def markdown
- @markdown ||= Redcarpet::Markdown.new(Redcarpet2Markdown.new(extensions), extensions)
- end
-
- def convert(content)
- return super unless @config['markdown'] == 'redcarpet2'
- markdown.render(content)
- end
-end

0 comments on commit 807e1a7

Please sign in to comment.