-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2101 from blahgeek/add-doc-bazel
Add bazel doc
- Loading branch information
Showing
8 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
https://upload.wikimedia.org/wikipedia/en/7/7d/Bazel_logo.svg |