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 @@
11 [
22 [
33 "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>"
55 ], [
66 "2018-07-08",
77 "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
174174 ._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
175175 ._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }
176176 ._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 @@
11 ._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−
92 dl > dt > code,
103 dl > dt > kbd {
11− @extend %note, %note-blue;
12− display: block;
13− padding: 1px 7px 2px 7px;
14− margin: 28px 0 14px 0;
15− font-weight: bold;
16− font-family: $baseFont;
4+ @extend %block-label, %label-blue;
175 }
186
197 th[align=left] {
20− border-left: 1px solid #d8d8d8;
8+ border-left: 1px solid $boxBorder;
219 }
10+
11+ code { @extend %label; }
2212 }
lib/docs/filters/bash/clean_html.rb+11−0
@@ -11,6 +11,7 @@ module Docs · 10 unmodified lines
1111 # Remove chapter and section numbers from title
1212 title_node = at_css('h1, h2, h3, h4, h5, h6')
1313 title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip
14+ title_node.name = 'h1'
1415
1516 # Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
1617 title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ")
@@ -56,6 +57,16 @@ module Docs · 39 unmodified lines
5657 node.children = link unless link.nil?
5758 end
5859
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+
5970 doc
6071 end
6172 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.