Skip to content

Commit 4a9c9a1

Browse files
committed
Add sanctuary-type-classes documentation (13.0.0)
1 parent acfa06a commit 4a9c9a1

File tree

8 files changed

+87
-0
lines changed

8 files changed

+87
-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_type_classes',
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_type_classes {
2+
@extend %simple;
3+
4+
pre > code {
5+
font-size: inherit;
6+
}
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module Docs
2+
class SanctuaryTypeClasses
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|
8+
node.name = 'h3'
9+
}
10+
11+
# correct and unify link ids
12+
css('h3').each { |node|
13+
node.attributes["id"].value = node.text.split(' :: ')[0]
14+
}
15+
16+
doc
17+
end
18+
end
19+
end
20+
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module Docs
2+
class SanctuaryTypeClasses
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("h2, h4").each do |node|
10+
case node.name
11+
when "h2"
12+
type = node.text
13+
if node.attributes["id"].value == "type-class-hierarchy"
14+
name = node.text
15+
id = node.attributes["id"].value
16+
entries << [name, id, type]
17+
end
18+
when "h4"
19+
name = node.text.split(' :: ')[0]
20+
id = name
21+
entries << [name, id, type]
22+
end
23+
end
24+
25+
entries
26+
end
27+
end
28+
end
29+
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module Docs
2+
3+
class SanctuaryTypeClasses < Github
4+
self.name = "Sanctuary Type Classes"
5+
self.slug = "sanctuary_type_classes"
6+
self.type = "sanctuary_type_classes"
7+
self.release = "13.0.0"
8+
self.base_url = "https://github.com/sanctuary-js/sanctuary-type-classes/blob/v#{self.release}/README.md"
9+
self.links = {
10+
home: "https://github.com/sanctuary-js/sanctuary-type-classes",
11+
code: "https://github.com/sanctuary-js/sanctuary-type-classes",
12+
}
13+
14+
html_filters.push "sanctuary_type_classes/entries", "sanctuary_type_classes/clean_html"
15+
16+
options[:container] = '.markdown-body'
17+
options[:title] = "Sanctuary Type Classes"
18+
options[:trailing_slash] = false
19+
options[:attribution] = <<-HTML
20+
&copy; 2020 Sanctuary<br>
21+
&copy; 2016 Plaid Technologies, Inc.<br>
22+
Licensed under the MIT License.
23+
HTML
24+
25+
def get_latest_version(opts)
26+
get-npm-version("sanctuary-type-classes", opts)
27+
end
28+
end
29+
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)