Finish Bash scraper

pull/832/merge
Thibaut Courouble 7 years ago
parent 1d56144a4b
commit a71f48ea10

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 45 KiB

@ -1,7 +1,7 @@
[ [
[ [
"2018-07-29", "2018-07-29",
"New documentation: <a href=\"/pygame/\">Pygame</a>" "New documentations: <a href=\"/bash/\">Bash</a> and <a href=\"/pygame/\">Pygame</a>"
], [ ], [
"2018-07-08", "2018-07-08",
"New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>" "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>"

@ -174,3 +174,4 @@
._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; } ._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; } ._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }
._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; } ._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; }
._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }

@ -1,22 +1,12 @@
._bash { ._bash {
// The page title is always the first element on the page, but not always the same type of element
// The exception is the homepage, where the links element comes first
> *:first-child:not(._links) {
@extend h1;
@extend %lined-heading;
}
dl > dt > code, dl > dt > code,
dl > dt > kbd { dl > dt > kbd {
@extend %note, %note-blue; @extend %block-label, %label-blue;
display: block;
padding: 1px 7px 2px 7px;
margin: 28px 0 14px 0;
font-weight: bold;
font-family: $baseFont;
} }
th[align=left] { th[align=left] {
border-left: 1px solid #d8d8d8; border-left: 1px solid $boxBorder;
} }
code { @extend %label; }
} }

@ -11,6 +11,7 @@ module Docs
# Remove chapter and section numbers from title # Remove chapter and section numbers from title
title_node = at_css('h1, h2, h3, h4, h5, h6') title_node = at_css('h1, h2, h3, h4, h5, h6')
title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip
title_node.name = 'h1'
# Remove the "D. " from names like "D. Concept Index" and "D. Function Index" # Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ") title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ")
@ -56,6 +57,16 @@ module Docs
node.children = link unless link.nil? node.children = link unless link.nil?
end end
css('tt', 'code', 'table').remove_attr('class')
css('tt').each do |node|
node.name = 'code'
end
css('pre').each do |node|
node.content = node.content
end
doc doc
end end
end end

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save