Kaynağa Gözat

Finish Terraform scraper

Thibaut Courouble 7 yıl önce
ebeveyn
işleme
b4cd5f1802

BIN
assets/images/docs-2.png


BIN
assets/images/docs-2@2x.png


+ 1 - 1
assets/javascripts/news.json

@@ -1,7 +1,7 @@
 [
   [
     "2018-07-08",
-    "New documentation: <a href=\"/leaflet/\">Leaflet</a>"
+    "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a>"
   ], [
     "2018-03-26",
     "DevDocs is joining the freeCodeCamp community. Read the announcement <a href=\"https://medium.freecodecamp.org/devdocs-is-joining-the-freecodecamp-community-ae185a1c14a6\" target=\"_blank\">here</a>."

+ 5 - 0
assets/javascripts/templates/pages/about_tmpl.coffee

@@ -645,6 +645,11 @@ credits = [
     '2018 The TensorFlow Authors',
     'CC BY',
     'https://creativecommons.org/licenses/by/3.0/'
+  ], [
+    'Terraform',
+    '2018 HashiCorp',
+    'MPL',
+    'https://raw.githubusercontent.com/hashicorp/terraform-website/master/LICENSE.md'
   ], [
     'Twig',
     '2009-2017 The Twig Team',

+ 1 - 0
assets/stylesheets/application-dark.css.scss

@@ -96,6 +96,7 @@
         'pages/support_tables',
         'pages/tcl_tk',
         'pages/tensorflow',
+        'pages/terraform',
         'pages/underscore',
         'pages/vue',
         'pages/webpack',

+ 1 - 0
assets/stylesheets/global/_icons.scss

@@ -171,3 +171,4 @@
 ._icon-jekyll:before        { background-position: -1rem -3rem; @extend %doc-icon-2; }
 ._icon-babel:before         { background-position: -2rem -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; }

+ 5 - 0
lib/docs/filters/terraform/clean_html.rb

@@ -19,6 +19,11 @@ module Docs
             node['data-language'] = 'ruby'
           end
           node.content = node.content
+          node.remove_attribute('class')
+        end
+
+        css('.highlight').each do |node|
+          node.before(node.children).remove
         end
 
         doc

+ 1 - 2
lib/docs/scrapers/terraform.rb

@@ -4,7 +4,6 @@ module Docs
     self.type = 'terraform'
     self.release = '0.11.7'
     self.base_url = 'https://www.terraform.io/docs/'
-    # self.dir = '/mnt/c/Users/Doug/Code/terraform-docs/www.terraform.io/docs'
     self.root_path = 'index.html'
     self.links = {
       home: 'https://www.terraform.io/',
@@ -16,7 +15,7 @@ module Docs
     options[:skip_patterns] = [/enterprise/, /enterprise-legacy/]
 
     options[:attribution] = <<-HTML
-      Copyright &copy; 2018 HashiCorp</br>
+      &copy; 2018 HashiCorp</br>
       Licensed under the MPL 2.0 License.
     HTML
   end

BIN
public/icons/docs-2.pxm


BIN
public/icons/docs-2@2x.pxm


BIN
public/icons/docs/terraform/16.png


BIN
public/icons/docs/terraform/16@2x.png