File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -321,7 +321,7 @@ def generate_index
321321 # suppress 1.9.3 warning
322322 here . local_variable_set ( :asset_rel_prefix , asset_rel_prefix )
323323 # some partials rely on the presence of current variable to render
324- here . local_variable_set ( :current , @main_page ) if @main_page
324+ here . local_variable_set ( :current , @main_page )
325325 here
326326 end
327327 rescue => e
@@ -738,6 +738,17 @@ def excerpt(comment)
738738 extracted_text [ 0 ...150 ] . gsub ( /\n / , " " ) . squeeze ( " " )
739739 end
740740
741+ def generate_table_from_the_current_object ( current )
742+ return '' if current . nil?
743+ comment =
744+ if current . respond_to? :comment_location then
745+ current . comment_location
746+ else
747+ current . comment
748+ end
749+ current . parse ( comment ) . table_of_contents . dup
750+ end
751+
741752 def generate_ancestor_list ( ancestors , klass )
742753 return '' if ancestors . empty?
743754
Original file line number Diff line number Diff line change 1- <%- comment = if current.respond_to? :comment_location then
2- current.comment_location
3- else
4- current.comment
5- end
6- table = current.parse(comment).table_of_contents.dup
7-
8- if table.length > 1 then %>
1+ <%- table = generate_table_from_the_current_object(current) -%>
2+ <%- if table.length > 1 %>
93 <div class ="nav-section ">
104 < h3 > Table of Contents</ h3 >
115
You can’t perform that action at this time.
0 commit comments