diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index a191f2896b..d54beb649b 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -59,6 +59,7 @@ 'pages/erlang', 'pages/express', 'pages/fastapi', + 'pages/fluture', 'pages/git', 'pages/github', 'pages/gnuplot', diff --git a/assets/stylesheets/pages/_fluture.scss b/assets/stylesheets/pages/_fluture.scss new file mode 100644 index 0000000000..e3072c6d23 --- /dev/null +++ b/assets/stylesheets/pages/_fluture.scss @@ -0,0 +1,7 @@ +._fluture { + @extend %simple; + + pre > code { + font-size: inherit; + } +} diff --git a/lib/docs/filters/fluture/clean_html.rb b/lib/docs/filters/fluture/clean_html.rb new file mode 100644 index 0000000000..dee87e3082 --- /dev/null +++ b/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 diff --git a/lib/docs/filters/fluture/entries.rb b/lib/docs/filters/fluture/entries.rb new file mode 100644 index 0000000000..03556373b9 --- /dev/null +++ b/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 diff --git a/lib/docs/scrapers/fluture.rb b/lib/docs/scrapers/fluture.rb new file mode 100644 index 0000000000..3576e423a7 --- /dev/null +++ b/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 + © 2020 Aldwin Vlasblom
+ Licensed under the MIT License. + HTML + + def get_latest_version(opts) + get_npm_version("fluture", opts) + end + end +end diff --git a/public/icons/docs/fluture/16.png b/public/icons/docs/fluture/16.png new file mode 100644 index 0000000000..75fca6cd70 Binary files /dev/null and b/public/icons/docs/fluture/16.png differ diff --git a/public/icons/docs/fluture/16@2x.png b/public/icons/docs/fluture/16@2x.png new file mode 100644 index 0000000000..e02f26ab49 Binary files /dev/null and b/public/icons/docs/fluture/16@2x.png differ diff --git a/public/icons/docs/fluture/SOURCE b/public/icons/docs/fluture/SOURCE new file mode 100644 index 0000000000..7f186cb023 --- /dev/null +++ b/public/icons/docs/fluture/SOURCE @@ -0,0 +1 @@ +https://github.com/fluture-js/Fluture/