Skip to content

Commit e486e42

Browse files
authored
Merge pull request #1545 from breunigs/add-elixir-1-12
add elixir 1.12 documentation
2 parents f489154 + 24ac996 commit e486e42

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

assets/stylesheets/pages/_elixir.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
.type-detail { margin-bottom: 2em; }
55
.type-detail pre { margin-left: -1rem; }
66
._mobile & .type-detail pre { margin-left: 0; }
7+
8+
a.source {
9+
float: right;
10+
font-size: .9em;
11+
}
712
}

lib/docs/filters/elixir/clean_html.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def guide
2525
end
2626

2727
def api
28-
css('.hover-link', '.view-source', 'footer').remove
28+
css('.hover-link', 'footer', ':not(.detail-header) > .view-source').remove
2929

3030
css('.summary').each do |node|
3131
node.name = 'dl'
@@ -51,7 +51,11 @@ def api
5151
detail.css('.detail-header').each do |node|
5252
node.name = 'h3'
5353
node['id'] = id
54+
55+
source_href = node.at_css('.view-source').attr('href')
56+
5457
node.content = node.at_css('.signature').inner_text
58+
node << %(<a href="#{source_href}" class="source">Source</a>)
5559
end
5660

5761
detail.css('.docstring h2').each do |node|

lib/docs/filters/elixir/entries.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def additional_entries
4545

4646
css('.detail-header').map do |node|
4747
id = node['id']
48-
name = node.content.strip
48+
# ignore text of children, i.e. source link
49+
name = node.children.select(&:text?).map(&:content).join.strip
4950

5051
name.remove! %r{\(.*\)}
5152
name.remove! 'left '

lib/docs/scrapers/elixir.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ def initial_urls
3333
"https://elixir-lang.org/getting-started/introduction.html" ]
3434
end
3535

36+
version '1.12' do
37+
self.release = '1.12.0'
38+
self.base_urls = [
39+
"https://hexdocs.pm/elixir/#{release}/",
40+
"https://hexdocs.pm/eex/#{release}/",
41+
"https://hexdocs.pm/ex_unit/#{release}/",
42+
"https://hexdocs.pm/iex/#{release}/",
43+
"https://hexdocs.pm/logger/#{release}/",
44+
"https://hexdocs.pm/mix/#{release}/",
45+
'https://elixir-lang.org/getting-started/'
46+
]
47+
end
48+
3649
version '1.11' do
3750
self.release = '1.11.2'
3851
self.base_urls = [

0 commit comments

Comments
 (0)