Skip to content

Commit

Permalink
Merge pull request #2034 from jceb/fluture
Browse files Browse the repository at this point in the history
Add fluture documentation (14.0.0)
  • Loading branch information
simon04 authored Aug 24, 2023
2 parents b42cc10 + e8f04b9 commit a588539
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
'pages/erlang',
'pages/express',
'pages/fastapi',
'pages/fluture',
'pages/git',
'pages/github',
'pages/gnuplot',
Expand Down
7 changes: 7 additions & 0 deletions assets/stylesheets/pages/_fluture.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
._fluture {
@extend %simple;

pre > code {
font-size: inherit;
}
}
22 changes: 22 additions & 0 deletions lib/docs/filters/fluture/clean_html.rb
Original file line number Diff line number Diff line change
@@ -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 changes: 24 additions & 0 deletions lib/docs/filters/fluture/entries.rb
Original file line number Diff line number Diff line change
@@ -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 changes: 29 additions & 0 deletions lib/docs/scrapers/fluture.rb
Original file line number Diff line number Diff line change
@@ -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
Binary file added public/icons/docs/fluture/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/docs/fluture/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/docs/fluture/SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/fluture-js/Fluture/

0 comments on commit a588539

Please sign in to comment.