Merge branch 'freeCodeCamp:main' into opengl

pull/2136/head
Suraj Yadav 6 months ago committed by GitHub
commit 20840ba127
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -13,7 +13,7 @@ jobs:
steps: steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c # v1.187.0 uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # v1.188.0
with: with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests - name: Run tests

@ -11,7 +11,7 @@ jobs:
steps: steps:
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c # v1.187.0 uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # v1.188.0
with: with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Generate report - name: Generate report

@ -11,7 +11,7 @@ jobs:
steps: steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Set up Ruby - name: Set up Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c # v1.187.0 uses: ruby/setup-ruby@50ba3386b050ad5b97a41fcb81240cbee1d1821f # v1.188.0
with: with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests - name: Run tests

@ -39,7 +39,6 @@ group :development do
end end
group :docs do group :docs do
gem 'net-sftp', require: false
gem 'progress_bar', require: false gem 'progress_bar', require: false
gem 'redcarpet' gem 'redcarpet'
gem 'tty-pager', require: false gem 'tty-pager', require: false

@ -57,9 +57,6 @@ GEM
mustermann (3.0.0) mustermann (3.0.0)
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
mutex_m (0.2.0) mutex_m (0.2.0)
net-sftp (4.0.0)
net-ssh (>= 5.0.0, < 8.0.0)
net-ssh (7.0.1)
newrelic_rpm (8.16.0) newrelic_rpm (8.16.0)
nokogiri (1.16.6) nokogiri (1.16.6)
mini_portile2 (~> 2.8.2) mini_portile2 (~> 2.8.2)
@ -159,7 +156,6 @@ DEPENDENCIES
image_optim image_optim
image_optim_pack image_optim_pack
minitest minitest
net-sftp
newrelic_rpm newrelic_rpm
nokogiri nokogiri
progress_bar progress_bar

@ -196,10 +196,13 @@ mv ./usr/share/doc/openjdk-16-jre-headless/api/ docs/openjdk~$VERSION
## Pandas ## Pandas
From the home directory; `devdocs`, execute below:
```sh ```sh
curl https://pandas.pydata.org/docs/pandas.zip | bsdtar --extract --file - --directory=docs/pandas~1 curl https://pandas.pydata.org/docs/pandas.zip -o tmp.zip && unzip tmp.zip -d docs/pandas~2 && rm tmp.zip
``` ```
## PHP ## PHP
Click the link under the "Many HTML files" column on https://www.php.net/download-docs.php, extract the tarball, change its name to `php` and put it in `docs/`. Click the link under the "Many HTML files" column on https://www.php.net/download-docs.php, extract the tarball, change its name to `php` and put it in `docs/`.

@ -2,32 +2,12 @@ module Docs
class Elixir class Elixir
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
if current_url.path.start_with?('/getting-started') api
guide
else
api
end
doc doc
end end
def guide
@doc = at_css('#content article')
css('pre > code').each do |node|
node.parent.content = node.content
end
css('div > pre.highlight').each do |node|
node.content = node.content
node['data-language'] = node.parent['class'][/language-(\w+)/, 1]
node.parent.before(node).remove
end
end
def api def api
css('.hover-link', 'footer', ':not(.detail-header) > .view-source').remove css('.top-search').remove
css('h1 .settings').remove
css('.summary').each do |node| css('.summary').each do |node|
node.name = 'dl' node.name = 'dl'
@ -65,6 +45,11 @@ module Docs
end end
end end
css('h1 a.icon-action[title="View Source"]').each do |node|
node['class'] = 'source'
node.content = "Source"
end
css('pre').each do |node| css('pre').each do |node|
node['data-language'] = 'elixir' node['data-language'] = 'elixir'
node.content = node.content node.content = node.content

@ -3,25 +3,21 @@ module Docs
class EntriesFilter < Docs::EntriesFilter class EntriesFilter < Docs::EntriesFilter
def get_name def get_name
css('h1 .app-vsn').remove css('h1 .app-vsn').remove
name = (at_css('h1 > span') or at_css('h1')).content.strip (at_css('h1 > span') or at_css('h1')).content.strip
if current_url.path.start_with?('/getting-started')
name.remove(/\.\z/)
else
name = name.split(' ').first unless name.start_with?('mix ') # ecto
name
end
end end
def get_type def get_type
if current_url.path.start_with?('/getting-started') section = at_css('h1 a.source').attr('href').match('elixir/pages/([^/]+)/')&.captures&.first
if subpath.start_with?('mix-otp') if section == "mix-and-otp"
'Guide: Mix & OTP' return "Mix & OTP"
elsif subpath.start_with?('meta') elsif section
'Guide: Metaprogramming' return section.gsub("-", " ").capitalize
else end
'Guide'
end name = at_css('h1 span').text
case name.split(' ').first
when 'mix' then 'Mix Tasks'
when 'Changelog' then 'References'
else else
case at_css('h1 small').try(:content) case at_css('h1 small').try(:content)
when 'exception' when 'exception'
@ -29,19 +25,13 @@ module Docs
when 'protocol' when 'protocol'
'Protocols' 'Protocols'
else else
if name.start_with?('Phoenix') name
name.split('.')[0..2].join('.')
elsif name.start_with?('mix ')
'Mix Tasks'
else
name.split('.').first
end
end end
end end
end end
def additional_entries def additional_entries
return [] if type == 'Exceptions' || type == 'Guide' || root_page? return [] if root_page?
css('.detail-header').map do |node| css('.detail-header').map do |node|
id = node['id'] id = node['id']

@ -4,7 +4,7 @@ module Docs
class Qunit class Qunit
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('.content[role="main"]') @doc = at_css('.content[role="main"] > article')
css('.sidebar').remove css('.sidebar').remove
css('pre').each do |node| css('pre').each do |node|
node['data-language'] = 'javascript' node['data-language'] = 'javascript'

@ -4,7 +4,7 @@ module Docs
self.name = 'Elixir' self.name = 'Elixir'
self.type = 'elixir' self.type = 'elixir'
self.root_path = 'api-reference.html' self.root_path = 'introduction.html'
self.links = { self.links = {
home: 'https://elixir-lang.org/', home: 'https://elixir-lang.org/',
code: 'https://github.com/elixir-lang/elixir' code: 'https://github.com/elixir-lang/elixir'
@ -12,27 +12,50 @@ module Docs
html_filters.push 'elixir/clean_html', 'elixir/entries', 'title' html_filters.push 'elixir/clean_html', 'elixir/entries', 'title'
options[:container] = ->(filter) { options[:container] = '#content'
filter.current_url.path.start_with?('/getting-started') ? '#main' : '#content'
}
options[:title] = false options[:title] = false
options[:root_title] = 'Elixir' options[:root_title] = 'Elixir'
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2012 Plataformatec<br> &copy; 2012-2024 The Elixir Team<br>
Licensed under the Apache License, Version 2.0. Licensed under the Apache License, Version 2.0.
HTML HTML
def initial_urls def initial_urls
[ "https://hexdocs.pm/elixir/#{self.class.release}/api-reference.html", [ "https://hexdocs.pm/elixir/#{self.class.release}/introduction.html",
"https://hexdocs.pm/eex/#{self.class.release}/EEx.html", "https://hexdocs.pm/eex/#{self.class.release}/EEx.html",
"https://hexdocs.pm/ex_unit/#{self.class.release}/ExUnit.html", "https://hexdocs.pm/ex_unit/#{self.class.release}/ExUnit.html",
"https://hexdocs.pm/iex/#{self.class.release}/IEx.html", "https://hexdocs.pm/iex/#{self.class.release}/IEx.html",
"https://hexdocs.pm/logger/#{self.class.release}/Logger.html", "https://hexdocs.pm/logger/#{self.class.release}/Logger.html",
"https://hexdocs.pm/mix/#{self.class.release}/Mix.html", "https://hexdocs.pm/mix/#{self.class.release}/Mix.html" ]
"https://elixir-lang.org/getting-started/introduction.html" ] end
version '1.17' do
self.release = '1.17.2'
self.base_urls = [
"https://hexdocs.pm/elixir/#{release}/",
"https://hexdocs.pm/eex/#{release}/",
"https://hexdocs.pm/ex_unit/#{release}/",
"https://hexdocs.pm/iex/#{release}/",
"https://hexdocs.pm/logger/#{release}/",
"https://hexdocs.pm/mix/#{release}/"
]
end end
version '1.16' do
self.release = '1.16.3'
self.base_urls = [
"https://hexdocs.pm/elixir/#{release}/",
"https://hexdocs.pm/eex/#{release}/",
"https://hexdocs.pm/ex_unit/#{release}/",
"https://hexdocs.pm/iex/#{release}/",
"https://hexdocs.pm/logger/#{release}/",
"https://hexdocs.pm/mix/#{release}/"
]
end
# scraping of older versions is no longer supported!
version '1.15' do version '1.15' do
self.release = '1.15.4' self.release = '1.15.4'
self.base_urls = [ self.base_urls = [

@ -2,7 +2,7 @@ module Docs
class Fastapi < UrlScraper class Fastapi < UrlScraper
self.name = 'FastAPI' self.name = 'FastAPI'
self.type = 'fastapi' self.type = 'fastapi'
self.release = '0.100.1' self.release = '0.111.1'
self.base_url = 'https://fastapi.tiangolo.com/' self.base_url = 'https://fastapi.tiangolo.com/'
self.root_path = '/' self.root_path = '/'
self.links = { self.links = {

@ -29,8 +29,22 @@ module Docs
Laravel is a trademark of Taylor Otwell. Laravel is a trademark of Taylor Otwell.
HTML HTML
version '11' do
self.release = '11.11.1'
self.root_path = '/api/11.x/index.html'
self.initial_paths = %w(/docs/11.x/installation /api/11.x/classes.html)
options[:only_patterns] = [%r{\A/api/11\.x/}, %r{\A/docs/11\.x/}]
options[:fix_urls] = ->(url) do
url.sub! %r{11.x/+}, "11.x/"
url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?![1-9]?\d)}, "#{Laravel.base_url}/docs/11.x/"
url
end
end
version '10' do version '10' do
self.release = '10.13.0' self.release = '10.48.14'
self.root_path = '/api/10.x/index.html' self.root_path = '/api/10.x/index.html'
self.initial_paths = %w(/docs/10.x/installation /api/10.x/classes.html) self.initial_paths = %w(/docs/10.x/installation /api/10.x/classes.html)
@ -44,7 +58,7 @@ module Docs
end end
version '9' do version '9' do
self.release = '9.52.8' self.release = '9.52.16'
self.root_path = '/api/9.x/index.html' self.root_path = '/api/9.x/index.html'
self.initial_paths = %w(/docs/9.x/installation /api/9.x/classes.html) self.initial_paths = %w(/docs/9.x/installation /api/9.x/classes.html)

@ -16,6 +16,29 @@ module Docs
Licensed under the 3-clause BSD License. Licensed under the 3-clause BSD License.
HTML HTML
version '2' do
self.release = '2.2.2'
self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/"
html_filters.push 'pandas/clean_html', 'pandas/entries'
options[:container] = 'main section'
options[:skip_patterns] = [
/development/,
/getting_started/,
/whatsnew/
]
options[:skip] = [
'panel.html',
'pandas.pdf',
'pandas.zip',
'ecosystem.html'
]
end
version '1' do version '1' do
self.release = '1.5.0' self.release = '1.5.0'
self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/" self.base_url = "https://pandas.pydata.org/pandas-docs/version/#{self.release}/"

@ -1,5 +1,5 @@
module Docs module Docs
class Python < FileScraper class Python < UrlScraper
self.type = 'python' self.type = 'python'
self.root_path = 'index.html' self.root_path = 'index.html'
self.links = { self.links = {
@ -23,12 +23,12 @@ module Docs
library/sunau.html) library/sunau.html)
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2001&ndash;2023 Python Software Foundation<br> &copy; 2001&ndash;2024 Python Software Foundation<br>
Licensed under the PSF License. Licensed under the PSF License.
HTML HTML
version '3.12' do version '3.12' do
self.release = '3.12.1' self.release = '3.12.4'
self.base_url = "https://docs.python.org/#{self.version}/" self.base_url = "https://docs.python.org/#{self.version}/"
html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html' html_filters.push 'python/entries_v3', 'sphinx/clean_html', 'python/clean_html'

@ -4,8 +4,8 @@ module Docs
class Qunit < UrlScraper class Qunit < UrlScraper
self.name = 'QUnit' self.name = 'QUnit'
self.type = 'qunit' self.type = 'qunit'
self.release = '2.19.3' self.release = '2.21.0'
self.base_url = 'https://api.qunitjs.com/' self.base_url = 'https://qunitjs.com/api/'
self.root_path = '/' self.root_path = '/'
self.links = { self.links = {
home: 'https://qunitjs.com/', home: 'https://qunitjs.com/',
@ -18,13 +18,14 @@ module Docs
options[:container] = '.main' options[:container] = '.main'
options[:skip_patterns] = [ options[:skip_patterns] = [
/deprecated/,
/^QUnit$/, /^QUnit$/,
/^assert$/, /^assert$/,
/^callbacks$/, /^callbacks$/,
/^async$/, /^async$/,
/^config$/, /^config$/,
/^extension$/, /^extension$/,
/^deprecated$/,
/^removed$/,
] ]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML

@ -3,7 +3,7 @@
module Docs module Docs
class Rust < UrlScraper class Rust < UrlScraper
self.type = 'rust' self.type = 'rust'
self.release = '1.75.0' self.release = '1.79.0'
self.base_url = 'https://doc.rust-lang.org/' self.base_url = 'https://doc.rust-lang.org/'
self.root_path = 'book/index.html' self.root_path = 'book/index.html'
self.initial_paths = %w( self.initial_paths = %w(

@ -7,7 +7,7 @@ module Docs
self.name = 'Support Tables' self.name = 'Support Tables'
self.slug = 'browser_support_tables' self.slug = 'browser_support_tables'
self.type = 'support_tables' self.type = 'support_tables'
self.release = '1.0.30001574' self.release = '1.0.30001642'
self.base_url = 'https://github.com/Fyrd/caniuse/raw/main/' self.base_url = 'https://github.com/Fyrd/caniuse/raw/main/'
# https://github.com/Fyrd/caniuse/blob/main/LICENSE # https://github.com/Fyrd/caniuse/blob/main/LICENSE

@ -17,7 +17,7 @@ module Docs
Licensed under the MIT License. Licensed under the MIT License.
HTML HTML
self.release = '1.2.2' self.release = '2.0.3'
self.base_url = 'https://vitest.dev/' self.base_url = 'https://vitest.dev/'
self.initial_paths = %w(guide/) self.initial_paths = %w(guide/)
html_filters.push 'vitest/entries', 'vite/clean_html' html_filters.push 'vitest/entries', 'vite/clean_html'

@ -162,8 +162,6 @@ class DocsCLI < Thor
option :dryrun, type: :boolean option :dryrun, type: :boolean
option :packaged, type: :boolean option :packaged, type: :boolean
def upload(*names) def upload(*names)
require 'net/sftp'
if options[:packaged] if options[:packaged]
slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') }
docs = find_docs_by_slugs(slugs) docs = find_docs_by_slugs(slugs)

@ -159,7 +159,6 @@ Full tech stack [here](/techstack.md)
|[image_optim](https://rubygems.org/image_optim)|v0.31.3|11/14/22|Paul Sernatinger |MIT|N/A| |[image_optim](https://rubygems.org/image_optim)|v0.31.3|11/14/22|Paul Sernatinger |MIT|N/A|
|[image_optim_pack](https://rubygems.org/image_optim_pack)|v0.10.1|11/14/22|Paul Sernatinger |MIT|N/A| |[image_optim_pack](https://rubygems.org/image_optim_pack)|v0.10.1|11/14/22|Paul Sernatinger |MIT|N/A|
|[minitest](https://rubygems.org/minitest)|v5.21.2|01/03/15|Thibaut |MIT|N/A| |[minitest](https://rubygems.org/minitest)|v5.21.2|01/03/15|Thibaut |MIT|N/A|
|[net-sftp](https://rubygems.org/net-sftp)|v4.0.0|11/14/22|Paul Sernatinger |MIT|N/A|
|[newrelic_rpm](https://rubygems.org/newrelic_rpm)|v8.16.0|03/24/18|Thibaut Courouble |Apache-2.0|N/A| |[newrelic_rpm](https://rubygems.org/newrelic_rpm)|v8.16.0|03/24/18|Thibaut Courouble |Apache-2.0|N/A|
|[nokogiri](https://rubygems.org/nokogiri)|v1.16.0|10/21/18|Thibaut Courouble |MIT|N/A| |[nokogiri](https://rubygems.org/nokogiri)|v1.16.0|10/21/18|Thibaut Courouble |MIT|N/A|
|[progress_bar](https://rubygems.org/progress_bar)|v1.3.3|01/26/14|Thibaut |WTFPL|N/A| |[progress_bar](https://rubygems.org/progress_bar)|v1.3.3|01/26/14|Thibaut |WTFPL|N/A|

@ -268,20 +268,6 @@ tools:
detection_source: Gemfile detection_source: Gemfile
last_updated_by: Thibaut last_updated_by: Thibaut
last_updated_on: 2015-01-03 15:38:22.000000000 Z last_updated_on: 2015-01-03 15:38:22.000000000 Z
- name: net-sftp
description: A pure Ruby implementation of the SFTP client protocol
package_url: https://rubygems.org/net-sftp
version: 4.0.0
license: MIT
open_source: true
hosted_saas: false
category: Libraries
sub_category: RubyGems Packages
image_url: https://img.stackshare.io/package/19106/default_92b412aaa5197ea1fc2d70a503018e4186714110.png
detection_source_url: https://github.com/freeCodeCamp/devdocs/blob/main/Gemfile.lock
detection_source: Gemfile
last_updated_by: Paul Sernatinger
last_updated_on: 2022-11-14 14:30:30.000000000 Z
- name: newrelic_rpm - name: newrelic_rpm
description: New Relic is a performance management system, developed by New Relic, description: New Relic is a performance management system, developed by New Relic,
Inc Inc

Loading…
Cancel
Save