File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,25 @@ def format_examples!(data, version)
6565 blob = @repo . lookup ( ientry [ :oid ] )
6666 blob . content
6767 end
68- rocco_layout = Rocco ::Layout . new ( rocco , @tf )
69- rocco_layout . version = version
70- rf = rocco_layout . render
7168
7269 extlen = -( File . extname ( file ) . length + 1 )
7370 rf_path = file [ 0 ..extlen ] + '.html'
7471 rel_path = "ex/#{ version } /#{ rf_path } "
7572
73+ rocco_layout = Rocco ::Layout . new ( rocco , @tf )
74+ # find out how deep our file is so we can use the right
75+ # number of ../ in the path
76+ depth = rel_path . count ( '/' ) - 1
77+ if depth == 0
78+ rocco_layout [ :dirsup ] = "./"
79+ else
80+ rocco_layout [ :dirsup ] = "../" *depth
81+ end
82+
83+ rocco_layout . version = version
84+ rf = rocco_layout . render
85+
86+
7687 # look for function names in the examples and link
7788 id_num = 0
7889 data [ :functions ] . each do |f , fdata |
Original file line number Diff line number Diff line change 33<head >
44 <meta http-equiv =" content-type" content =" text/html;charset=utf-8" >
55 <title >{ { title } }</title >
6- <link rel =" stylesheet" href =" https://libgit2.github.com/libgit2/ex/ css.css" >
6+ <link rel =" stylesheet" href =" { { dirsup } } css.css" >
77 <style type =" text/css" >
88 a .fnlink { text-decoration: none}
99 a .fnlink :hover { text-decoration: underline}
You can’t perform that action at this time.
0 commit comments