projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15397: Move deprecated API links to old version of doc site.
[arvados.git]
/
doc
/
zenweb-liquid.rb
diff --git
a/doc/zenweb-liquid.rb
b/doc/zenweb-liquid.rb
index baa8fe42db39ddbcd320c9b0cae48ac06bb301f3..3e8672e0216e0290982556b82f83eac964a34534 100644
(file)
--- a/
doc/zenweb-liquid.rb
+++ b/
doc/zenweb-liquid.rb
@@
-50,7
+50,7
@@
module Zenweb
Liquid::Tag.instance_method(:initialize).bind(self).call(tag_name, markup, tokens)
if markup =~ Syntax
Liquid::Tag.instance_method(:initialize).bind(self).call(tag_name, markup, tokens)
if markup =~ Syntax
- @template_name = $1
+ @template_name
_expr
= $1
@language = $3
@attributes = {}
else
@language = $3
@attributes = {}
else
@@
-61,9
+61,14
@@
module Zenweb
def render(context)
require 'coderay'
def render(context)
require 'coderay'
- partial = load_cached_partial(context)
+ partial = load_cached_partial(
@template_name_expr,
context)
html = ''
html = ''
+ # be explicit about errors
+ context.exception_renderer = lambda do |exc|
+ exc.is_a?(Liquid::InternalError) ? "Liquid error: #{exc.cause.message}" : exc
+ end
+
context.stack do
html = CodeRay.scan(partial.root.nodelist.join, @language).div
end
context.stack do
html = CodeRay.scan(partial.root.nodelist.join, @language).div
end
@@
-98,6
+103,11
@@
module Zenweb
partial = partial[1..-1]
end
partial = partial[1..-1]
end
+ # be explicit about errors
+ context.exception_renderer = lambda do |exc|
+ exc.is_a?(Liquid::InternalError) ? "Liquid error: #{exc.cause.message}" : exc
+ end
+
context.stack do
html = CodeRay.scan(partial, @language).div
end
context.stack do
html = CodeRay.scan(partial, @language).div
end