mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Details at the [ZEPPELIN-279](https://issues.apache.org/jira/browse/ZEPPELIN-279) Author: Alexander Bezzubov <bzz@apache.org> Closes #282 from bzz/ZEPPELIN-279-move-docs-to-master and squashes the following commits:16d2cd0[Alexander Bezzubov] ZEPPELIN-279: updating refs to new /docs locationa051a35[Alexander Bezzubov] ZEPPELIN-279: moving website gh-pages -> master:/docs
38 lines
No EOL
890 B
Ruby
38 lines
No EOL
890 B
Ruby
# A simple way to inspect liquid template variables.
|
|
# Usage:
|
|
# Can be used anywhere liquid syntax is parsed (templates, includes, posts/pages)
|
|
# {{ site | debug }}
|
|
# {{ site.posts | debug }}
|
|
#
|
|
require 'pp'
|
|
module Jekyll
|
|
# Need to overwrite the inspect method here because the original
|
|
# uses < > to encapsulate the psuedo post/page objects in which case
|
|
# the output is taken for HTML tags and hidden from view.
|
|
#
|
|
class Post
|
|
def inspect
|
|
"#Jekyll:Post @id=#{self.id.inspect}"
|
|
end
|
|
end
|
|
|
|
class Page
|
|
def inspect
|
|
"#Jekyll:Page @name=#{self.name.inspect}"
|
|
end
|
|
end
|
|
|
|
end # Jekyll
|
|
|
|
module Jekyll
|
|
module DebugFilter
|
|
|
|
def debug(obj, stdout=false)
|
|
puts obj.pretty_inspect if stdout
|
|
"<pre>#{obj.class}\n#{obj.pretty_inspect}</pre>"
|
|
end
|
|
|
|
end # DebugFilter
|
|
end # Jekyll
|
|
|
|
Liquid::Template.register_filter(Jekyll::DebugFilter) |