Skip to content

Commit 27b491b

Browse files
committed
Add sanctuary-def documentation (0.22.0)
1 parent acfa06a commit 27b491b

File tree

8 files changed

+76
-0
lines changed

8 files changed

+76
-0
lines changed

assets/stylesheets/application.css.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
'pages/rust',
116116
'pages/rxjs',
117117
'pages/sanctuary',
118+
'pages/sanctuary_def',
118119
'pages/scala',
119120
'pages/sinon',
120121
'pages/sphinx',
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
._sanctuary_def {
2+
@extend %simple;
3+
4+
pre > code {
5+
font-size: inherit;
6+
}
7+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Docs
2+
class SanctuaryDef
3+
class CleanHtmlFilter < Filter
4+
def call
5+
# Make headers bigger by transforming them into a bigger variant
6+
css('h3').each { |node| node.name = 'h2' }
7+
css('h4').each { |node| node.name = 'h3' }
8+
9+
doc
10+
end
11+
end
12+
end
13+
end
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module Docs
2+
class SanctuaryDef
3+
class EntriesFilter < Docs::EntriesFilter
4+
# The entire reference is one big page, so get_name and get_type are not necessary
5+
def additional_entries
6+
entries = []
7+
type = ""
8+
9+
css("h3, h4").each do |node|
10+
case node.name
11+
when "h3"
12+
type = node.text
13+
when "h4"
14+
name = node.text.split(' :: ')[0]
15+
id = node.attributes["id"].value
16+
entries << [name, id, type]
17+
end
18+
end
19+
20+
entries
21+
end
22+
end
23+
end
24+
end

lib/docs/scrapers/sanctuary_def.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module Docs
2+
3+
class SanctuaryDef < Github
4+
self.name = "Sanctuary Def"
5+
self.slug = "sanctuary_def"
6+
self.type = "sanctuary_def"
7+
self.release = "0.22.0"
8+
self.base_url = "https://github.com/sanctuary-js/sanctuary-def/blob/v#{self.release}/README.md"
9+
self.links = {
10+
home: "https://github.com/sanctuary-js/sanctuary-def",
11+
code: "https://github.com/sanctuary-js/sanctuary-def",
12+
}
13+
14+
# html_filters.push "sanctuary_def/entries"
15+
html_filters.push "sanctuary_def/entries", "sanctuary_def/clean_html"
16+
17+
options[:container] = '.markdown-body'
18+
options[:title] = "Sanctuary Def"
19+
options[:trailing_slash] = false
20+
options[:attribution] = <<-HTML
21+
&copy; 2020 Sanctuary<br>
22+
&copy; 2016 Plaid Technologies, Inc.<br>
23+
Licensed under the MIT License.
24+
HTML
25+
26+
def get_latest_version(opts)
27+
get_npm_version("sanctuary-def", opts)
28+
end
29+
end
30+
end
564 Bytes
Loading
1.18 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/sanctuary-js/sanctuary-logo/tree/v1.1.0

0 commit comments

Comments
 (0)