Quellcode durchsuchen

Add fluture documentation (14.0.0)

Jan Christoph Ebersbach vor 2 Jahren
Ursprung
Commit
e8f04b90e6

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

@@ -59,6 +59,7 @@
         'pages/erlang',
         'pages/express',
         'pages/fastapi',
+        'pages/fluture',
         'pages/git',
         'pages/github',
         'pages/gnuplot',

+ 7 - 0
assets/stylesheets/pages/_fluture.scss

@@ -0,0 +1,7 @@
+._fluture {
+  @extend %simple;
+
+  pre > code {
+    font-size: inherit;
+  }
+}

+ 22 - 0
lib/docs/filters/fluture/clean_html.rb

@@ -0,0 +1,22 @@
+module Docs
+  class Fluture
+    class CleanHtmlFilter < Filter
+      def call
+        # Replace header image with text
+        at_css('h1').content = 'Fluture'
+
+        # Remove the build line
+        css('h1 ~ p:first-of-type').remove
+
+        # Remove the fantasy land image link
+        css('p a').remove
+
+        # Make headers bigger by transforming them into a bigger variant
+        css('h3').each { |node| node.name = 'h2' }
+        css('h4').each { |node| node.name = 'h3' }
+
+        doc
+      end
+    end
+  end
+end

+ 24 - 0
lib/docs/filters/fluture/entries.rb

@@ -0,0 +1,24 @@
+module Docs
+  class Fluture
+    class EntriesFilter < Docs::EntriesFilter
+      # The entire reference is one big page, so get_name and get_type are not necessary
+      def additional_entries
+        entries = []
+        type = ""
+
+        css("h3, h4").each do |node|
+          case node.name
+          when "h3"
+            type = node.text
+          when "h4"
+            name = node.text
+            id = node.text.downcase
+            entries << [name, id, type]
+          end
+        end
+
+        entries
+      end
+    end
+  end
+end

+ 29 - 0
lib/docs/scrapers/fluture.rb

@@ -0,0 +1,29 @@
+module Docs
+
+  class Fluture < Github
+    self.name = "Fluture"
+    self.slug = "fluture"
+    self.type = "fluture"
+    self.release = "14.0.0"
+    self.base_url = "https://github.com/fluture-js/Fluture/blob/#{self.release}/README.md"
+    self.links = {
+      home: "https://github.com/fluture-js/Fluture",
+      code: "https://github.com/fluture-js/Fluture",
+    }
+
+    html_filters.push "fluture/entries", "fluture/clean_html"
+
+    options[:skip] = %w[middleware.gif]
+    options[:container] = '.markdown-body'
+    options[:title] = "Fluture"
+    options[:trailing_slash] = false
+    options[:attribution] = <<-HTML
+      &copy; 2020 Aldwin Vlasblom<br>
+      Licensed under the MIT License.
+    HTML
+
+    def get_latest_version(opts)
+      get_npm_version("fluture", opts)
+    end
+  end
+end

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


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


+ 1 - 0
public/icons/docs/fluture/SOURCE

@@ -0,0 +1 @@
+https://github.com/fluture-js/Fluture/