tomdoc'd
This commit is contained in:
+17
-9
@@ -279,15 +279,6 @@ module Gollum
|
||||
end
|
||||
end
|
||||
|
||||
def find_page_from_name(cname)
|
||||
if page = @wiki.page(cname)
|
||||
return page
|
||||
end
|
||||
if pos = cname.index('#')
|
||||
[@wiki.page(cname[0...pos]), cname[pos..-1]]
|
||||
end
|
||||
end
|
||||
|
||||
# Find the given file in the repo.
|
||||
#
|
||||
# name - The String absolute or relative path of the file.
|
||||
@@ -302,6 +293,23 @@ module Gollum
|
||||
end
|
||||
end
|
||||
|
||||
# Find a page from a given cname. If the page has an anchor (#) and has
|
||||
# no match, strip the anchor and try again.
|
||||
#
|
||||
# cname - The String canonical page name.
|
||||
#
|
||||
# Returns a Gollum::Page instance if a page is found, or an Array of
|
||||
# [Gollum::Page, String extra] if a page without the extra anchor data
|
||||
# is found.
|
||||
def find_page_from_name(cname)
|
||||
if page = @wiki.page(cname)
|
||||
return page
|
||||
end
|
||||
if pos = cname.index('#')
|
||||
[@wiki.page(cname[0...pos]), cname[pos..-1]]
|
||||
end
|
||||
end
|
||||
|
||||
#########################################################################
|
||||
#
|
||||
# Code
|
||||
|
||||
Reference in New Issue
Block a user