mirror of https://github.com/freeCodeCamp/devdocs
parent
674dc1e35c
commit
be80d182e5
@ -1,6 +1,6 @@
|
||||
module Docs
|
||||
class Fish
|
||||
class CleanHtmlFilter < Filter
|
||||
class CleanHtmlCustomFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.fish_right_bar')
|
||||
|
@ -0,0 +1,10 @@
|
||||
module Docs
|
||||
class Fish
|
||||
class CleanHtmlSphinxFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.body')
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,6 +1,6 @@
|
||||
module Docs
|
||||
class Fish
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
class EntriesCustomFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
if slug == 'faq'
|
||||
'FAQ'
|
@ -0,0 +1,39 @@
|
||||
module Docs
|
||||
class Fish
|
||||
class EntriesSphinxFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
if slug == 'faq'
|
||||
'FAQ'
|
||||
elsif slug.starts_with?('cmds/')
|
||||
slug.split('/').last
|
||||
else
|
||||
slug.capitalize
|
||||
end
|
||||
end
|
||||
|
||||
def get_type
|
||||
if root_page? || slug == 'faq'
|
||||
'Manual'
|
||||
elsif slug.starts_with?('cmds')
|
||||
'Commands'
|
||||
elsif slug == 'tutorial'
|
||||
'Tutorial'
|
||||
else
|
||||
nil # Remaining pages are indexes we don't need
|
||||
end
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
if root_page? || slug == 'tutorial'
|
||||
css('h2').map.with_index do |node, i|
|
||||
name = node.content.split(' - ').first.strip
|
||||
name.prepend "#{i + 1}. "
|
||||
[name, node['id'], get_type]
|
||||
end
|
||||
else
|
||||
[]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 134 B After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1 @@
|
||||
https://fishshell.com/favicon.ico
|
Loading…
Reference in new issue