Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions assets/javascripts/news.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[
[
"2026-05-26",
"New documentations: <a href=\"/opentofu/\">OpenTofu</a>, <a href=\"/cyclejs/\">Cycle.js</a>"
],
[
"2026-02-14",
"New documentation: <a href=\"/couchdb/\">CouchDB</a>"
Expand Down
1 change: 1 addition & 0 deletions assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
@use 'pages/octave';
@use 'pages/openjdk';
@use 'pages/openlayers';
@use 'pages/opentofu';
@use 'pages/perl';
@use 'pages/phalcon';
@use 'pages/phaser';
Expand Down
22 changes: 22 additions & 0 deletions assets/stylesheets/pages/_opentofu.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@use 'pages/simple';

._opentofu {
.theme-code-block figure {
margin-inline-start: 0;
}

// "sr" means screen reader
.sr-only {
clip: rect(0,0,0,0);
border-width: 0;
height: 1px;
margin: -1px;
padding: 0;
position: absolute;
width: 1px
}

.font-bold {
font-weight: var(--boldFontWeight);
}
}
2 changes: 1 addition & 1 deletion lib/docs/filters/ansible/entries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def get_name

if version >= "2.10" || version == ""
if slug =~ /\Acollections\// and slug !~ /index$/
name = name.split('.')[2]
name = name.split(' – ').first
end
end

Expand Down
23 changes: 23 additions & 0 deletions lib/docs/filters/cyclejs/clean_html.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module Docs
class Cyclejs
class CleanHtmlFilter < Filter
def call
return "<h1>Cycle.js</h1><p>A functional and reactive JavaScript framework for predictable code</p>" if root_page?
css('br').remove

css('pre > code').each do |node|
parent = node.parent
parent['data-language'] = 'javascript'
parent.content = node.content.strip
end

css('table[style]', 'tr[style]', 'td[style]', 'th[style]').remove_attr('style')
css('img').each do |node|
node['alt'] = node['alt'].presence || ''
end

doc
end
end
end
end
27 changes: 27 additions & 0 deletions lib/docs/filters/cyclejs/entries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Docs
class Cyclejs
class EntriesFilter < Docs::EntriesFilter
def get_name
title = at_css('h1')
name = title ? title.content.strip : subpath.sub(/\.html\z/, '').titleize
name = 'Cycle.js' if root_page?
name = 'API Reference' if slug == 'api/index'
name.delete_suffix! ' - source'
name
end

def get_type
slug.start_with?('api/') ? 'API' : 'Guide'
end

def additional_entries
css('h2[id], h3[id]').map do |node|
name = node.content.strip
name.sub!(/\A#\s*/, '')
name.sub!(/\s+#\z/, '')
[get_name + ': ' + name, node['id']]
end
end
end
end
end
6 changes: 4 additions & 2 deletions lib/docs/filters/eslint/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ def call
end

css('code', 'p').remove_attr('class')

css('.resource__image', '.resource__domain').remove
css('.copy-btn').remove

css('svg').remove
css('.resource__icon', '.resource__img').remove

doc
end
Expand Down
30 changes: 30 additions & 0 deletions lib/docs/filters/opentofu/clean_html.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module Docs
class Opentofu
class CleanHtmlFilter < Filter
def fix_syntax_highlight
css('pre').each do |node|
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
node.content = node.css('.token-line').map(&:content).join("\n")
node.remove_attribute('class')
node.remove_attribute('style')
end

css('[class*="buttonGroup_"]').remove
end

# Some SVG icons are just too big and not needed.
def remove_svg_icons
css('[role="alert"] svg').remove
end

def call
@doc = at_css("main article > .prose")

remove_svg_icons
fix_syntax_highlight

doc
end
end
end
end
21 changes: 21 additions & 0 deletions lib/docs/filters/opentofu/entries.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Docs
class Opentofu
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('main article h1').content
end

def get_type
segments = slug.split('/')
if segments[0..1] == ['language', 'functions']
# We have too many functions (120+ out of ~300 pages)
"Function"
elsif segments.first == 'cli'
"CLI"
else
segments.first.titlecase
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/filters/rust/clean_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Rust
class CleanHtmlFilter < Filter
def call
if slug.start_with?('book') || slug.start_with?('reference') || slug.start_with?('error_codes')
@doc = at_css('#content main')
@doc = at_css('#mdbook-content main')
elsif slug.start_with?('error_codes')
css('.error-undescribed').remove

Expand Down
4 changes: 2 additions & 2 deletions lib/docs/scrapers/ansible.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Ansible < UrlScraper
]

version do
# 2025-08-14
self.base_url = "https://docs.ansible.com/ansible/latest/"
# 2026-05-26
self.base_url = "https://docs.ansible.com/projects/ansible/latest/"
end

version '2.11' do
Expand Down
85 changes: 85 additions & 0 deletions lib/docs/scrapers/cyclejs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
require 'redcarpet'

module Docs
class Cyclejs < UrlScraper
self.name = 'Cycle.js'
self.slug = 'cyclejs'
self.type = 'cyclejs'
self.release = '23.1.0'
self.base_url = 'https://cycle.js.org/'
self.root_path = 'index.html'
self.initial_paths = %w(
getting-started.html
model-view-intent.html
streams.html
drivers.html
components.html
basic-examples.html
dialogue.html
releases.html
api/index.html
api/run.html
api/rxjs-run.html
api/most-run.html
api/dom.html
api/html.html
api/http.html
api/history.html
api/isolate.html
api/state.html
)

self.links = {
home: 'https://cycle.js.org/',
code: 'https://github.com/cyclejs/cyclejs'
}

html_filters.push 'cyclejs/clean_html', 'cyclejs/entries'

options[:only_patterns] = [
/\Aindex\.html\z/,
/\Agetting-started\.html\z/,
/\Amodel-view-intent\.html\z/,
/\Astreams\.html\z/,
/\Adrivers\.html\z/,
/\Acomponents\.html\z/,
/\Abasic-examples\.html\z/,
/\Adialogue\.html\z/,
/\Areleases\.html\z/,
/\Aapi\//
]

options[:download_images] = false
options[:attribution] = <<-HTML
&copy; 2014&ndash;present Cycle.js contributors.<br>
Licensed under the MIT License.
HTML

def get_latest_version(opts)
get_npm_version('@cycle/dom', opts)
end

private

def parse(response)
document = Parser.new(response.body).html
markdown = document.at_css('script#markdown')

return super unless markdown

html = markdown_renderer.render(markdown.content.strip)
title = document.at_css('title').try(:content).try(:strip)
[Parser.new("<html><head><title>#{title}</title></head><body>#{html}</body></html>").html, title]
end

def markdown_renderer
@markdown_renderer ||= Redcarpet::Markdown.new(
Redcarpet::Render::HTML.new(with_toc_data: true),
autolink: true,
fenced_code_blocks: true,
no_intra_emphasis: true,
tables: true
)
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/eslint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Docs
class Eslint < UrlScraper
self.name = 'ESLint'
self.type = 'simple'
self.release = '10.2.0'
self.release = '10.4.0'
self.base_url = 'https://eslint.org/docs/latest/'
self.root_path = '/'
self.links = {
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/fastapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Docs
class Fastapi < UrlScraper
self.name = 'FastAPI'
self.type = 'fastapi'
self.release = '0.115.6'
self.release = '0.136.3'
self.base_url = 'https://fastapi.tiangolo.com/'
self.root_path = '/'
self.links = {
Expand Down
8 changes: 8 additions & 0 deletions lib/docs/scrapers/fish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ class Fish < UrlScraper
Licensed under the GNU General Public License, version 2.
HTML

version '4.7' do
self.release = '4.7.1'
self.base_url = "https://fishshell.com/docs/#{version}/"

options[:skip].concat %w(genindex.html relnotes.html)
html_filters.push 'sphinx/clean_html', 'fish/clean_html_sphinx', 'fish/entries_sphinx'
end

version '4.6' do
self.release = '4.6.0'
self.base_url = "https://fishshell.com/docs/#{version}/"
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/mdn/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Docs
class Html < Mdn
prepend FixInternalUrlsBehavior

# release = '2025-09-15'
# release = '2026-05-26'
self.name = 'HTML'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
self.links = {
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/scrapers/mdn/javascript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Javascript < Mdn
prepend FixInternalUrlsBehavior
prepend FixRedirectionsBehavior

# release = '2026-04-14'
# release = '2026-05-26'
self.name = 'JavaScript'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference'
self.links = {
Expand Down
47 changes: 47 additions & 0 deletions lib/docs/scrapers/opentofu.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module Docs
class Opentofu < UrlScraper
self.name = 'OpenTofu'
self.type = 'opentofu'
self.links = {
home: 'https://opentofu.org/',
}

html_filters.push 'opentofu/entries', 'opentofu/clean_html'

# Empty spans are used by Prism for code highlighting.
# Don't clean them
options[:clean_text] = false
options[:trailing_slash] = true
# https://github.com/opentofu/opentofu/blob/main/LICENSE
options[:attribution] = <<-HTML
Copyright (c) The OpenTofu Authors<br>
Copyright (c) 2014 HashiCorp, Inc.<br>
Mozilla Public License, version 2.0
HTML

def get_latest_version(opts)
contents = get_latest_github_release('opentofu', 'opentofu', opts)
contents.sub("v", "")
end

version '1.12' do
self.release = '1.12.0'
self.base_url = "https://opentofu.org/docs/v#{self.version}/"
end

version '1.11' do
self.release = '1.11.5'
self.base_url = "https://opentofu.org/docs/v#{self.version}/"
end

version '1.10' do
self.release = '1.10.9'
self.base_url = "https://opentofu.org/docs/v#{self.version}/"
end

version '1.9' do
self.release = '1.9.4'
self.base_url = "https://opentofu.org/docs/v#{self.version}/"
end
end
end
2 changes: 1 addition & 1 deletion lib/docs/scrapers/rust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Docs
class Rust < UrlScraper
self.type = 'rust'
self.release = '1.93.1'
self.release = '1.95.0'
self.base_url = 'https://doc.rust-lang.org/'
self.root_path = 'book/index.html'
self.initial_paths = %w(
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/docs.thor
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class DocsCLI < Thor
option :amend, type: :boolean
def commit(name)
doc = Docs.find(name, false)
message = options[:message] || "Update #{doc.name} documentation (#{doc.versions.first.release})"
message = options[:message] || "Update #{doc.name} documentation (#{doc.versions.first.release})".delete_suffix(" ()")
amend = " --amend" if options[:amend]
system("git add assets/ *#{name}*") && system("git commit -m '#{message}'#{amend}")
rescue Docs::DocNotFound => error
Expand Down
Binary file added public/icons/docs/cyclejs/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/cyclejs/16@2x.png
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/cyclejs/SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://cycle.js.org/img/cyclejs_logo.svg
Binary file added public/icons/docs/opentofu/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/opentofu/16@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions public/icons/docs/opentofu/SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/opentofu/opentofu.org/blob/main/static/favicons/favicon-16x16.png
https://github.com/opentofu/opentofu.org/blob/main/static/favicons/favicon-32x32.png
Loading