mirror of https://github.com/freeCodeCamp/devdocs
parent
b1963541e8
commit
4ed22db333
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Zig
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
at_css('main').prepend_child at_css('h1')
|
||||
@doc = at_css('main')
|
||||
css('a.hdr').remove
|
||||
css('h1, h2, h3').each do |node|
|
||||
node.content = node.content
|
||||
end
|
||||
css('pre > code').each do |node|
|
||||
node.parent['data-language'] = 'zig'
|
||||
node.parent.content = node.parent.content
|
||||
end
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,25 @@
|
||||
module Docs
|
||||
class Zig
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
entries = []
|
||||
type = nil
|
||||
subtype = nil
|
||||
|
||||
css('h2, h3').each do |node|
|
||||
if node.name == 'h2' && node['id']
|
||||
type = node.content.gsub(/ §/, '')
|
||||
subtype = nil
|
||||
entries << [type, node['id'], type]
|
||||
elsif node.name == 'h3' && node['id']
|
||||
subtype = node.content.gsub(/ §/, '')
|
||||
name = "#{type}: #{subtype}"
|
||||
entries << [name, node['id'], type]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 552 B |
After Width: | Height: | Size: 1001 B |
@ -0,0 +1,2 @@
|
||||
https://github.com/ziglang/logo/blob/master/zig-favicon.png
|
||||
https://github.com/ziglang/logo/blob/master/zig-mark.svg
|
Loading…
Reference in new issue