-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Switch to Octopress code highlighter #1590
base: master
Are you sure you want to change the base?
Changes from 2 commits
7c137e7
e0dc448
39d042f
525fd37
9854ee1
ddf78cc
50b0a5d
fb1c06a
feb2e28
f6417da
83e77f2
bca82cc
cbe43d1
c28541d
919bcc4
4caa277
18d7e6b
d739835
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
.sass-cache | ||
.gist-cache | ||
.pygments-cache | ||
.code-highlighter-cache | ||
_deploy | ||
public | ||
sass.old | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,12 @@ | ||
#custom filters for Octopress | ||
require './plugins/backtick_code_block' | ||
require 'jekyll-page-hooks' | ||
#require './plugins/backtick_code_block' | ||
require 'octopress-codefence' | ||
require 'octopress-gist' | ||
require 'jekyll-sitemap' | ||
require 'jekyll-date-format' | ||
require './plugins/raw' | ||
require 'rubypants' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can get rid of RubyPants in this file, too, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think people should be using the features of Rdiscount or whatever if they want fancy quotes now. This isn't how it should be done. |
||
|
||
module OctopressFilters | ||
include BacktickCodeBlock | ||
include TemplateWrapper | ||
def pre_filter(input) | ||
input = render_code_block(input) | ||
input.gsub /(<figure.+?>.+?<\/figure>)/m do | ||
safe_wrap($1) | ||
end | ||
end | ||
def post_filter(input) | ||
input = unwrap(input) | ||
RubyPants.new(input).to_html | ||
end | ||
end | ||
|
||
module Jekyll | ||
class ContentFilters < PageHooks | ||
include OctopressFilters | ||
def pre_render(post) | ||
if post.ext.match('html|textile|markdown|md|haml|slim|xml') | ||
post.content = pre_filter(post.content) | ||
end | ||
end | ||
def post_render(post) | ||
if post.ext.match('html|textile|markdown|md|haml|slim|xml') | ||
post.content = post_filter(post.content) | ||
end | ||
end | ||
end | ||
end | ||
|
||
|
||
module OctopressLiquidFilters | ||
|
||
# Used on the blog index to split posts on the <!--more--> marker | ||
|
@@ -131,5 +100,6 @@ def titlecase(input) | |
end | ||
|
||
end | ||
|
||
Liquid::Template.register_filter OctopressLiquidFilters | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing soon. Thanks for jumping on this so fast! You're the 💣.