-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Local assets, code highlighting, better color management.
All assets are now loaded locally (jQuery, font-awesome). They are kept in the `public` folder in each file's respective subdirectory. Code highlighting is handled by Rouge (a Pygments compatible markdown codeblock renderer). Definitions for the highlights are defined in `_pygments.scss`. All colors are now managed in `_variables.scss`. This includes shading and special definitions. For example, the colors for the navigation bar are defined at the end of `_variables.scss` with the prefix `$nav-`. This should help keep colors consistent across the entire site.
- Loading branch information
1 parent
d610b32
commit c828c99
Showing
20 changed files
with
459 additions
and
95 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 |
---|---|---|
@@ -1,12 +1,26 @@ | ||
source 'https://rubygems.org' | ||
|
||
# Use HAML for markup | ||
gem 'haml' | ||
# Use the redcarpet and coderay for better Markdown and code prettifying. | ||
gem 'redcarpet' | ||
gem 'rouge' | ||
|
||
# Use SASS for styles | ||
gem 'sass' | ||
|
||
# Use guard to compile static assets | ||
gem 'guard' | ||
gem 'guard-haml' | ||
gem 'guard-sass' | ||
|
||
gem 'pandoc-ruby' | ||
# Guard sometimes has issues with readline. | ||
gem 'rb-readline' | ||
|
||
# Use Sinatra as a thin Rack wrapper | ||
gem 'sinatra' | ||
|
||
# Thin is a more eventful webserver than WEBrick | ||
gem 'thin' | ||
|
||
# Out-of-process auto-reloading when files change | ||
gem 'rerun' |
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,10 +1,3 @@ | ||
directories %w(src data) \ | ||
.select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} | ||
|
||
guard :haml, input: 'src/views', output: 'docs', run_at_start: true do | ||
watch(/^.+(\.html\.haml)$/) | ||
end | ||
|
||
guard 'sass', input: 'src', output: 'public', smart_partials: true do | ||
watch(%r{^styles/(.+\.s[ac]ss)$}) | ||
end |
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 @@ | ||
require 'haml' | ||
require 'redcarpet' | ||
require './ext/rouge.rb' | ||
|
||
|
||
module Haml::Filters | ||
remove_filter("Markdown") #remove the existing Markdown filter | ||
|
||
module Markdown # the contents of this are as before, but without the lazy_require call | ||
include Haml::Filters::Base | ||
|
||
|
||
def render(text) | ||
markdown.render(text) | ||
end | ||
|
||
|
||
private | ||
|
||
def markdown | ||
@markdown ||= Redcarpet::Markdown.new(renderer, extensions) | ||
end | ||
|
||
def renderer | ||
@renderer ||= Ext::RougeRenderer.new(render_options) | ||
end | ||
|
||
def render_options | ||
{ | ||
filter_html: true, | ||
hard_wrap: true, | ||
no_styles: true, | ||
prettify: true, | ||
safe_links_only: true, | ||
with_toc_data: false | ||
} | ||
end | ||
|
||
def extensions | ||
{ | ||
autolink: true, | ||
fenced_code_blocks: true, | ||
disable_indented_code_blocks: true, | ||
footnotes: false, | ||
highlight: true, | ||
no_images: true, | ||
no_intra_emphasis: true, | ||
quote: true, | ||
space_after_headers: false, | ||
strikethrough: true, | ||
superscript: true, | ||
tables: true, | ||
underline: true | ||
} | ||
end | ||
end | ||
end |
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,9 @@ | ||
require 'redcarpet' | ||
require 'rouge' | ||
require 'rouge/plugins/redcarpet' | ||
|
||
module Ext | ||
class RougeRenderer < Redcarpet::Render::HTML | ||
include Rouge::Plugins::Redcarpet # yep, that's it. | ||
end | ||
end |
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,4 +1,8 @@ | ||
require 'sinatra' | ||
require 'yaml' | ||
|
||
# Core extensions | ||
Dir['./ext/**/*.rb'].each{ |f| require f } | ||
|
||
# Controllers | ||
Dir['./controllers/**/*.rb'].each{ |f| require f } |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.