D documentation was added.

pull/669/head
antlord 8 years ago committed by Thibaut Courouble
parent 6335e1ac8b
commit bc8d9432c3

@ -44,6 +44,7 @@
'pages/coffeescript',
'pages/cordova',
'pages/crystal',
'pages/d',
'pages/d3',
'pages/dojo',
'pages/drupal',

@ -44,6 +44,7 @@
'pages/coffeescript',
'pages/cordova',
'pages/crystal',
'pages/d',
'pages/d3',
'pages/dojo',
'pages/drupal',

@ -0,0 +1,44 @@
._d {
> .description, > .documentation-section { padding-left: 1rem; }
> .description > h2, header > h3, > h2 { @extend %block-heading; }
.description > h1 { font-size: 1rem; }
.method-description > h2, h3, h4, h5, h6 { font-size: 1em; }
.d_decl {
font-weight: $boldFontWeight;
@extend %block-label, %label-blue;
+ .d_decl { margin-top: -.5em; }
}
> .meta {
@extend %note, %note-blue;
> dd { margin: 0; }
> dd + dt { margin-top: .5em; }
}
a.method-click-advice {
float: right;
font-size: .75rem;
color: $linkColor;
cursor: pointer;
@extend %user-select-none;
&:hover { text-decoration: underline; }
}
.method-description { position: relative; }
.method-source-code {
display: none;
position: absolute;
z-index: 1;
top: 0;
right: 0;
background: rgba($contentBackground, .95);
box-shadow: 0 1em 1em 1em $contentBackground;
> pre { margin: 0; }
}
}

@ -0,0 +1,12 @@
module Docs
class D
class CleanHtmlFilter < Filter
def call
css('.d_decl > div > span.def-anchor').each do |node|
node.parent.parent['id'] = node['id']
end
doc
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class D
class EntriesFilter < Docs::EntriesFilter
def get_name
slug.to_s.gsub('_', '.').gsub('/', '.').squish!
end
def get_type
slug.to_s.sub(/_(.*)/, '')
end
def additional_entries
names = []
css('.book > tr > td > a').each do |x|
span_block = x.at_css('span')
if span_block != nil
elem_name = span_block.text
name = "#{get_name}.#{elem_name}"
type = name.sub(/\..*/,'')
names << [name, "#{slug}#{x['href']}", type]
end
end
names
end
end
end
end

@ -0,0 +1,18 @@
module Docs
class D < UrlScraper
self.release = '2.075.1'
self.type = 'd'
self.base_url = 'http://dlang.org/phobos/'
html_filters.push 'd/entries', 'd/clean_html'
options[:container] = '#content'
options[:title] = false
options[:root_title] = 'D Language'
options[:skip_patterns] = [/#.*/]
options[:attribution] = <<-HTML
Copyright &copy; 1999-2017 by the D Language Foundation
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Loading…
Cancel
Save