Add Zig documentation (0.9.0)

pull/1679/head
Simon Legner 3 years ago
parent b1963541e8
commit 4ed22db333

@ -1,7 +1,11 @@
[
[
"2021-12-27",
"New documentation: <a href=\"/zig/\">Zig</a>"
],
[
"2021-12-26",
"New documentation: <a href=\"/gnu_make/\">Gnu Make</a>"
"New documentation: <a href=\"/gnu_make/\">GNU Make</a>"
],
[
"2021-12-07",

@ -918,5 +918,9 @@ credits = [
'BSD',
'https://raw.githubusercontent.com/yiisoft/yii/master/LICENSE'
], [
'Zig',
'20152021, Zig contributors',
'MIT',
'https://raw.githubusercontent.com/ziglang/zig/master/LICENSE'
]
]

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

@ -0,0 +1,24 @@
module Docs
class Zig < UrlScraper
self.name = 'Zig'
self.type = 'simple'
self.release = '0.9.0'
self.base_url = 'https://ziglang.org/documentation/0.9.0/'
self.links = {
home: 'https://ziglang.org/',
code: 'https://github.com/ziglang/zig'
}
html_filters.push 'zig/entries', 'zig/clean_html'
options[:follow_links] = false
options[:attribution] = <<-HTML
&copy; 20152021, Zig contributors
HTML
def get_latest_version(opts)
tags = get_github_tags('ziglang', 'zig', opts)
tags[0]['name']
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

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…
Cancel
Save