Skip to content

Instantly share code, notes, and snippets.

View samleb's full-sized avatar
:octocat:
Freelance CTO

Samuel Lebeau samleb

:octocat:
Freelance CTO
View GitHub Profile
module Enumerable
module Ordonned
def [](arg)
case arg
when Numeric
detect.with_index { |_, index| index == arg }
when Range
result = []
each.with_index do |object, index|
result << object if arg.include?(index)
function remaining(args) {
return Array.prototype.slice.call(args, args.callee.length);
}
function example(first) {
alert("I was given : " + first);
alert("but also : " + remaining(arguments));
}
We couldn’t find that file to show.
#!/usr/bin/ruby
require 'rubygems'
require 'active_record'
require 'active_support'
require 'parseconfig'
config = ParseConfig.new( '/path/to/conf/file.conf' )
db_number = Integer(config.get_value( 'database_count' ))
Integrate SyntaxHighlighter with CodeRay and Pygments support
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch syntax_highlighter
# Changes to be committed:
# (use "git reset HEAD^1 <file>..." to unstage)
#
# modified: lib/pdoc/generators/html/helpers.rb
# modified: lib/pdoc/generators/html/syntax_highlighter.rb
diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb
index 625ab23..e92643d 100644
--- a/lib/pdoc/generators/html/helpers.rb
+++ b/lib/pdoc/generators/html/helpers.rb
@@ -21,6 +21,7 @@ module PDoc
end
def htmlize(markdown)
+ markdown = Website.syntax_highlighter.parse(markdown)
Maruku.new(markdown).to_html
diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb
index 625ab23..e92643d 100644
--- a/lib/pdoc/generators/html/helpers.rb
+++ b/lib/pdoc/generators/html/helpers.rb
@@ -21,6 +21,7 @@ module PDoc
end
def htmlize(markdown)
+ markdown = Website.syntax_highlighter.parse(markdown)
Maruku.new(markdown).to_html
diff --git a/lib/pdoc/generators/html/helpers.rb b/lib/pdoc/generators/html/helpers.rb
index 625ab23..e92643d 100644
--- a/lib/pdoc/generators/html/helpers.rb
+++ b/lib/pdoc/generators/html/helpers.rb
@@ -21,6 +21,7 @@ module PDoc
end
def htmlize(markdown)
+ markdown = Website.syntax_highlighter.parse(markdown)
Maruku.new(markdown).to_html
diff --git a/lib/pdoc/generators/html/website.rb b/lib/pdoc/generators/html/website.rb
index 8f24872..26e5dc3 100644
--- a/lib/pdoc/generators/html/website.rb
+++ b/lib/pdoc/generators/html/website.rb
@@ -12,8 +12,8 @@ module PDoc
def initialize(parser_output, options = {})
super
- @templates_directory = options[:templates] || TEMPLATES_DIRECTORY
- @index_page = options[:index_page]
/**
* Bouncer.tokenize(expression) -> [Array...]
* - expression (String): Valid stripped CSS selector expression.
*
* Splits the given expression in an array whose elements represents
* comma-separated grouped rules as specified in the
* [CSS Specification](http://www.w3.org/TR/CSS2/selector.html#grouping).
*
* Each rule is in turn split into tokens which are objects with `symbol`,
* `lexeme`, and `captures` properties :