History

Merge pull request #1545 from breunigs/add-elixir-1-12

add elixir 1.12 documentation

Bryan Hernández committed 5 years ago

Commit e486e422 parents f489154 24ac9964 files · +25 −2Browse files

Unified · Split

4 files
  1. assets/stylesheets/pages/_elixir.scss +5 −0
  2. lib/docs/filters/elixir/clean_html.rb +5 −1
  3. lib/docs/filters/elixir/entries.rb +2 −1
  4. lib/docs/scrapers/elixir.rb +13 −0
assets/stylesheets/pages/_elixir.scss+5−0
@@ -4,4 +4,9 @@ · 3 unmodified lines
4 .type-detail { margin-bottom: 2em; }4 .type-detail { margin-bottom: 2em; }
5 .type-detail pre { margin-left: -1rem; }5 .type-detail pre { margin-left: -1rem; }
6 ._mobile & .type-detail pre { margin-left: 0; }6 ._mobile & .type-detail pre { margin-left: 0; }
7
8 a.source {
9 float: right;
10 font-size: .9em;
11 }
7}12}
lib/docs/filters/elixir/clean_html.rb+5−1
@@ -25,7 +25,7 @@ module Docs · 24 unmodified lines
25 end25 end
26 26
27 def api27 def api
28 css('.hover-link', '.view-source', 'footer').remove28 css('.hover-link', 'footer', ':not(.detail-header) > .view-source').remove
29 29
30 css('.summary').each do |node|30 css('.summary').each do |node|
31 node.name = 'dl'31 node.name = 'dl'
@@ -51,7 +51,11 @@ module Docs · 19 unmodified lines
51 detail.css('.detail-header').each do |node|51 detail.css('.detail-header').each do |node|
52 node.name = 'h3'52 node.name = 'h3'
53 node['id'] = id53 node['id'] = id
54
55 source_href = node.at_css('.view-source').attr('href')
56
54 node.content = node.at_css('.signature').inner_text57 node.content = node.at_css('.signature').inner_text
58 node << %(<a href="#{source_href}" class="source">Source</a>)
55 end59 end
56 60
57 detail.css('.docstring h2').each do |node|61 detail.css('.docstring h2').each do |node|
lib/docs/filters/elixir/entries.rb+2−1
@@ -45,7 +45,8 @@ module Docs · 44 unmodified lines
45 45
46 css('.detail-header').map do |node|46 css('.detail-header').map do |node|
47 id = node['id']47 id = node['id']
48 name = node.content.strip48 # ignore text of children, i.e. source link
49 name = node.children.select(&:text?).map(&:content).join.strip
49 50
50 name.remove! %r{\(.*\)}51 name.remove! %r{\(.*\)}
51 name.remove! 'left '52 name.remove! 'left '
lib/docs/scrapers/elixir.rb+13−0
@@ -33,6 +33,19 @@ module Docs · 32 unmodified lines
33 "https://elixir-lang.org/getting-started/introduction.html" ]33 "https://elixir-lang.org/getting-started/introduction.html" ]
34 end34 end
35 35
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
36 version '1.11' do49 version '1.11' do
37 self.release = '1.11.2'50 self.release = '1.11.2'
38 self.base_urls = [51 self.base_urls = [