History

Finish Bash scraper

Thibaut Courouble committed 8 years ago

Commit a71f48e1 parent 1d5614410 files · +11 −9Browse files

Unified · Split

10 files
  1. assets/images/docs-2.png +0 −0
  2. assets/images/docs-2@2x.png +0 −0
  3. assets/javascripts/news.json +1 −1
  4. assets/stylesheets/global/_icons.scss +1 −0
  5. assets/stylesheets/pages/_bash.scss +4 −14
  6. lib/docs/filters/bash/clean_html.rb +11 −0
  7. public/icons/docs-2.pxm +0 −0
  8. public/icons/docs-2@2x.pxm +0 −0
  9. public/icons/docs/bash/16.png +0 −0
  10. public/icons/docs/bash/16@2x.png +0 −0
assets/images/docs-2.png+0−0

Binary file not shown.

assets/images/docs-2@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+1−1
@@ -1,7 +1,7 @@
1[1[
2 [2 [
3 "2018-07-29",3 "2018-07-29",
4 "New documentation: <a href=\"/pygame/\">Pygame</a>"4 "New documentations: <a href=\"/bash/\">Bash</a> and <a href=\"/pygame/\">Pygame</a>"
5 ], [5 ], [
6 "2018-07-08",6 "2018-07-08",
7 "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>"7 "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>"
assets/stylesheets/global/_icons.scss+1−0
@@ -174,3 +174,4 @@ · 173 unmodified lines
174._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }174._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
175._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }175._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }
176._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; }176._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; }
177._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }
assets/stylesheets/pages/_bash.scss+4−14
@@ -1,22 +1,12 @@
1._bash {1._bash {
2 // The page title is always the first element on the page, but not always the same type of element
3 // The exception is the homepage, where the links element comes first
4 > *:first-child:not(._links) {
5 @extend h1;
6 @extend %lined-heading;
7 }
8
9 dl > dt > code,2 dl > dt > code,
10 dl > dt > kbd {3 dl > dt > kbd {
11 @extend %note, %note-blue;4 @extend %block-label, %label-blue;
12 display: block;
13 padding: 1px 7px 2px 7px;
14 margin: 28px 0 14px 0;
15 font-weight: bold;
16 font-family: $baseFont;
17 }5 }
18 6
19 th[align=left] {7 th[align=left] {
20 border-left: 1px solid #d8d8d8;8 border-left: 1px solid $boxBorder;
21 }9 }
10
11 code { @extend %label; }
22}12}
lib/docs/filters/bash/clean_html.rb+11−0
@@ -11,6 +11,7 @@ module Docs · 10 unmodified lines
11 # Remove chapter and section numbers from title11 # Remove chapter and section numbers from title
12 title_node = at_css('h1, h2, h3, h4, h5, h6')12 title_node = at_css('h1, h2, h3, h4, h5, h6')
13 title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip13 title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip
14 title_node.name = 'h1'
14 15
15 # Remove the "D. " from names like "D. Concept Index" and "D. Function Index"16 # Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
16 title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ")17 title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ")
@@ -56,6 +57,16 @@ module Docs · 39 unmodified lines
56 node.children = link unless link.nil?57 node.children = link unless link.nil?
57 end58 end
58 59
60 css('tt', 'code', 'table').remove_attr('class')
61
62 css('tt').each do |node|
63 node.name = 'code'
64 end
65
66 css('pre').each do |node|
67 node.content = node.content
68 end
69
59 doc70 doc
60 end71 end
61 end72 end
public/icons/docs-2.pxm+0−0

Binary file not shown.

public/icons/docs-2@2x.pxm+0−0

Binary file not shown.

public/icons/docs/bash/16.png+0−0

Binary file not shown.

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

Binary file not shown.