Unified · Split
| @@ -44,6 +44,7 @@ · 43 unmodified lines | |||
| 44 | 'pages/coffeescript', | 44 | 'pages/coffeescript', |
| 45 | 'pages/cordova', | 45 | 'pages/cordova', |
| 46 | 'pages/crystal', | 46 | 'pages/crystal', |
| 47 | 'pages/d', | ||
| 47 | 'pages/d3', | 48 | 'pages/d3', |
| 48 | 'pages/dojo', | 49 | 'pages/dojo', |
| 49 | 'pages/drupal', | 50 | 'pages/drupal', |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | |||
| 44 | 'pages/coffeescript', | 44 | 'pages/coffeescript', |
| 45 | 'pages/cordova', | 45 | 'pages/cordova', |
| 46 | 'pages/crystal', | 46 | 'pages/crystal', |
| 47 | 'pages/d', | ||
| 47 | 'pages/d3', | 48 | 'pages/d3', |
| 48 | 'pages/dojo', | 49 | 'pages/dojo', |
| 49 | 'pages/drupal', | 50 | 'pages/drupal', |
| @@ -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 | } | ||
| @@ -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 | ||
| @@ -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 | ||
| @@ -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 © 1999-2017 by the D Language Foundation | ||
| 16 | HTML | ||
| 17 | end | ||
| 18 | end | ||
Binary file not shown.
Binary file not shown.