Merge pull request #2101 from blahgeek/add-doc-bazel

Add bazel doc
pull/2073/head
Simon Legner 1 year ago committed by GitHub
commit 55fe9b2d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,8 @@
[
[
"2024-01-05",
"New documentation: <a href=\"/bazel/\">Bazel</a>"
],
[
"2023-10-09",
"New documentations: <a href=\"/hapi/\">hapi</a>, <a href=\"/joi/\">joi</a>, <a href=\"/nushell/\">Nushell</a>, <a href=\"/varnish/\">Varnish</a>"

@ -9,11 +9,13 @@
&._page-error { position: static; }
> h1,
> article > h1,
> header > h1,
> section > h1 {
@extend ._lined-heading;
}
> h1:first-child,
> article:first-of-type > h1,
> header:first-of-type > h1,
> section:first-of-type > h1 {
margin-top: 0;

@ -0,0 +1,17 @@
module Docs
class Bazel
class CleanHtmlFilter < Filter
def call
css('.devsite-article-meta').remove
css('devsite-feature-tooltip').remove
css('devsite-thumb-rating').remove
css('devsite-toc').remove
css('a.button-with-icon').remove
css('button.devsite-heading-link').remove
doc
end
end
end
end

@ -0,0 +1,37 @@
module Docs
class Bazel
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content.strip
end
def get_type
"Build encyclopedia"
end
def additional_entries
entries = []
special_page_types = {
'functions' => 'Function',
'make-variables' => 'Make Variable',
'common-definitions' => 'Common Definition',
}
page_type = special_page_types[subpath]
unless page_type.nil?
# only first ul
at_css('.devsite-article-body > ul').css('li > a').each do |node|
entries << [node.content.strip, node['href'].sub('#', ''), page_type]
end
end
css('h2#rules + ul > li > a').each do |node|
entries << [node.content.strip, node['href'].sub('#', ''), "Rule"]
end
entries
end
end
end
end

@ -0,0 +1,50 @@
module Docs
class Bazel < UrlScraper
self.name = 'Bazel'
self.type = 'bazel'
html_filters.push 'bazel/entries', 'bazel/clean_html'
options[:skip] = %w(platform)
options[:container] = "devsite-content"
options[:attribution] = <<-HTML
Licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License.
HTML
version '7.0' do
self.release = '7.0.0'
self.base_url = 'https://bazel.build/versions/7.0.0/reference/be/'
end
version '6.4' do
self.release = '6.4.0'
self.base_url = 'https://bazel.build/versions/6.4.0/reference/be/'
end
version '6.3' do
self.release = '6.3.0'
self.base_url = 'https://bazel.build/versions/6.3.0/reference/be/'
end
version '6.2' do
self.release = '6.2.0'
self.base_url = 'https://bazel.build/versions/6.2.0/reference/be/'
end
version '6.1' do
self.release = '6.1.0'
self.base_url = 'https://bazel.build/versions/6.1.0/reference/be/'
end
version '6.0' do
self.release = '6.0.0'
self.base_url = 'https://bazel.build/versions/6.0.0/reference/be/'
end
def get_latest_version(opts)
get_latest_github_release('bazelbuild', 'bazel', opts)
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

@ -0,0 +1 @@
https://upload.wikimedia.org/wikipedia/en/7/7d/Bazel_logo.svg
Loading…
Cancel
Save