History

D documentation was added.

antlord committed 9 years ago

Commit bc8d9431 parent 6335e1a8 files · +101 −-2Browse files

Unified · Split

8 files
  1. assets/stylesheets/application-dark.css.scss +1 −0
  2. assets/stylesheets/application.css.scss +1 −0
  3. assets/stylesheets/pages/_d.scss +44 −0
  4. lib/docs/filters/d/clean_html.rb +12 −0
  5. lib/docs/filters/d/entries.rb +27 −0
  6. lib/docs/scrapers/d.rb +18 −0
  7. public/icons/docs/d/16.png +0 −0
  8. public/icons/docs/d/16@2x.png +0 −0
assets/stylesheets/application-dark.css.scss+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 'pages/coffeescript',
4545 'pages/cordova',
4646 'pages/crystal',
47+ 'pages/d',
4748 'pages/d3',
4849 'pages/dojo',
4950 'pages/drupal',
assets/stylesheets/application.css.scss+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 'pages/coffeescript',
4545 'pages/cordova',
4646 'pages/crystal',
47+ 'pages/d',
4748 'pages/d3',
4849 'pages/dojo',
4950 'pages/drupal',
assets/stylesheets/pages/_d.scss+44−0
@@ -0,0 +1,44 @@
1+._d {
2+ > .description, > .documentation-section { padding-left: 1rem; }
3+ > .description > h2, header > h3, > h2 { @extend %block-heading; }
4+ .description > h1 { font-size: 1rem; }
5+ .method-description > h2, h3, h4, h5, h6 { font-size: 1em; }
6+
7+ .d_decl {
8+ font-weight: $boldFontWeight;
9+ @extend %block-label, %label-blue;
10+
11+ + .d_decl { margin-top: -.5em; }
12+ }
13+
14+ > .meta {
15+ @extend %note, %note-blue;
16+
17+ > dd { margin: 0; }
18+ > dd + dt { margin-top: .5em; }
19+ }
20+
21+ a.method-click-advice {
22+ float: right;
23+ font-size: .75rem;
24+ color: $linkColor;
25+ cursor: pointer;
26+ @extend %user-select-none;
27+
28+ &:hover { text-decoration: underline; }
29+ }
30+
31+ .method-description { position: relative; }
32+
33+ .method-source-code {
34+ display: none;
35+ position: absolute;
36+ z-index: 1;
37+ top: 0;
38+ right: 0;
39+ background: rgba($contentBackground, .95);
40+ box-shadow: 0 1em 1em 1em $contentBackground;
41+
42+ > pre { margin: 0; }
43+ }
44+}
lib/docs/filters/d/clean_html.rb+12−0
@@ -0,0 +1,12 @@
1+module Docs
2+ class D
3+ class CleanHtmlFilter < Filter
4+ def call
5+ css('.d_decl > div > span.def-anchor').each do |node|
6+ node.parent.parent['id'] = node['id']
7+ end
8+ doc
9+ end
10+ end
11+ end
12+end
lib/docs/filters/d/entries.rb+27−0
@@ -0,0 +1,27 @@
1+module Docs
2+ class D
3+ class EntriesFilter < Docs::EntriesFilter
4+ def get_name
5+ slug.to_s.gsub('_', '.').gsub('/', '.').squish!
6+ end
7+
8+ def get_type
9+ slug.to_s.sub(/_(.*)/, '')
10+ end
11+
12+ def additional_entries
13+ names = []
14+ css('.book > tr > td > a').each do |x|
15+ span_block = x.at_css('span')
16+ if span_block != nil
17+ elem_name = span_block.text
18+ name = "#{get_name}.#{elem_name}"
19+ type = name.sub(/\..*/,'')
20+ names << [name, "#{slug}#{x['href']}", type]
21+ end
22+ end
23+ names
24+ end
25+ end
26+ end
27+end
lib/docs/scrapers/d.rb+18−0
@@ -0,0 +1,18 @@
1+module Docs
2+ class D < UrlScraper
3+ self.release = '2.075.1'
4+ self.type = 'd'
5+ self.base_url = 'http://dlang.org/phobos/'
6+
7+ html_filters.push 'd/entries', 'd/clean_html'
8+
9+ options[:container] = '#content'
10+ options[:title] = false
11+ options[:root_title] = 'D Language'
12+ options[:skip_patterns] = [/#.*/]
13+
14+ options[:attribution] = <<-HTML
15+ Copyright &copy; 1999-2017 by the D Language Foundation
16+ HTML
17+ end
18+end
public/icons/docs/d/16.png+0−0

Binary file not shown.

public/icons/docs/d/16@2x.png+0−0

Binary file not shown.