aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/_plugins/include_example.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/_plugins/include_example.rb b/docs/_plugins/include_example.rb
index 6ee63a5ac6..549f81fe1b 100644
--- a/docs/_plugins/include_example.rb
+++ b/docs/_plugins/include_example.rb
@@ -28,7 +28,7 @@ module Jekyll
def render(context)
site = context.registers[:site]
- config_dir = (site.config['code_dir'] || '../examples/src/main').sub(/^\//,'')
+ config_dir = '../examples/src/main'
@code_dir = File.join(site.source, config_dir)
clean_markup = @markup.strip
@@ -38,7 +38,12 @@ module Jekyll
code = File.open(@file).read.encode("UTF-8")
code = select_lines(code)
- Pygments.highlight(code, :lexer => @lang)
+ rendered_code = Pygments.highlight(code, :lexer => @lang)
+
+ hint = "<div><small>Find full example code at " \
+ "\"examples/src/main/#{clean_markup}\" in the Spark repo.</small></div>"
+
+ rendered_code + hint
end
# Trim the code block so as to have the same indention, regardless of their positions in the