From de954d432227c056ee3e3e67db63d91d3ca6ee69 Mon Sep 17 00:00:00 2001 From: Egor Dovnar Date: Wed, 26 Mar 2025 04:19:50 +0300 Subject: [PATCH 001/270] Update Docs::Rdoc::CleanHtmlFilter to properly set the source section link when generated from Ruby 3.4+ --- lib/docs/filters/rdoc/clean_html.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/docs/filters/rdoc/clean_html.rb b/lib/docs/filters/rdoc/clean_html.rb index ac836d1948..ff6d76604d 100644 --- a/lib/docs/filters/rdoc/clean_html.rb +++ b/lib/docs/filters/rdoc/clean_html.rb @@ -30,12 +30,24 @@ def other node.remove_attribute 'id' end - # Convert "click to toggle source" into a link + # (RDoc prior to Ruby 3.4) Convert "click to toggle source" into a link css('.method-click-advice').each do |node| node.name = 'a' node.content = 'Show source' end + # (RDoc for Ruby 3.4+) Add a "Show source" link + css('.method-source-toggle').each do |node| + link_node = Nokogiri::XML::Node.new('a', doc.document) + link_node.content = 'Show source' + link_node['class'] = 'method-click-advice' + + node.parent.parent.at_css('.method-heading').add_child(link_node) + end + + # (RDoc for Ruby 3.4+) Remove the additional "Source" toggle from the page + css('.method-controls').remove + # Add class to differentiate Ruby code from C code css('.method-source-code').each do |node| node.parent.prepend_child(node) From 8f033c3a255cb09734c13046d983e4895cc41710 Mon Sep 17 00:00:00 2001 From: spamguy Date: Sat, 27 Sep 2025 14:10:15 -0700 Subject: [PATCH 002/270] Update Qt to 6.9. Fix additional entry creation for QML things. Bump max image size.wq --- lib/docs/filters/qt/clean_html.rb | 13 +++++-------- lib/docs/filters/qt/entries.rb | 28 +++++----------------------- lib/docs/scrapers/qt.rb | 13 ++++++++++--- 3 files changed, 20 insertions(+), 34 deletions(-) diff --git a/lib/docs/filters/qt/clean_html.rb b/lib/docs/filters/qt/clean_html.rb index 1772a765bc..27204fca3b 100644 --- a/lib/docs/filters/qt/clean_html.rb +++ b/lib/docs/filters/qt/clean_html.rb @@ -2,22 +2,19 @@ module Docs class Qt class CleanHtmlFilter < Filter def call - # Remove unneeded elements - css('.copy-notice, .navigationbar, .headerNavi, .footerNavi, .sidebar, .toc, #ec_toggle', '.landingicons img', 'br').remove + # Narrow down container further. Breadcrumb is safe to remove. + @doc = at_css('article .mainContent .context') unless root_page? + + css('h1').remove_attribute('class') # QML property/method header css('.qmlproto').each do |node| - id = node.at_css('tr')['id'] - id = node.at_css('a')['name'] if id.blank? + id = node.at_css('span.name').content node.inner_html = node.at_css('td').inner_html node.name = 'h3' node['id'] = id end - css('.main-rounded', '.content', '.line', '.context', '.descr', '.types', '.func', '.table', 'div:not([class])', '.landing', '.col-1', '.heading', '.qmlitem', '.qmldoc', 'div.pre').each do |node| - node.before(node.children).remove - end - css('pre').each do |node| node.content = node.content node['data-language'] = 'cpp' if node['class'].include?('cpp') diff --git a/lib/docs/filters/qt/entries.rb b/lib/docs/filters/qt/entries.rb index 27cd0a31f2..2cc41616c4 100644 --- a/lib/docs/filters/qt/entries.rb +++ b/lib/docs/filters/qt/entries.rb @@ -19,25 +19,8 @@ def get_name end def get_type - breadcrumb = css('#main_title_bar + ul li') - category = if breadcrumb.length < 3 - then 'Qt'.dup - else breadcrumb.at(1).content - end - - if category == 'Qt' - return 'Qt Platforms' if name.include?(' for ') || name == 'Qt Platform Abstraction' - return 'Qt Quick' if name == 'Qt Quick Test' || name == 'Qt Quick Test Reference Documentation' - - alwaysInQt = ['Qt Configure Options', 'Qt Image Formats'] - category = name if name.start_with?('Qt ') && !alwaysInQt.include?(name) - end - - qtPlatformsTypes = ['Qt Platform Headers', 'Qt Android Extras', 'Qt Mac Extras', 'Qt Windows Extras', 'Qt X11 Extras'] - return 'Qt Platforms' if qtPlatformsTypes.include?(category) - - category.remove!(' Manual') - category + breadcrumb = css('ul.c-breadcrump li') # Yes, really: breadcrump. + breadcrumb[1].content end def include_default_entry? @@ -107,11 +90,9 @@ def additional_entries end # QML properties/functions - qmlTypeName = at_css('h1.title').content.remove(' QML Type', '') css('.qmlproto').each do |node| title = node.content.strip - id = node.at_css('tr')['id'] - id = node.at_css('a')['name'] if id.blank? + id = node.at_css('span.name').content # Remove options title.remove!(%r{^\[.*\] }) @@ -128,7 +109,8 @@ def additional_entries # Remove return type title.remove!(%r{.* }) - title = "#{qmlTypeName}.#{title.strip}" + title = title.strip + unless titles.include?(title) # Remove duplicates (function overloading) entries << [title, id] titles.push(title) diff --git a/lib/docs/scrapers/qt.rb b/lib/docs/scrapers/qt.rb index 3371120be3..31a21a62ee 100644 --- a/lib/docs/scrapers/qt.rb +++ b/lib/docs/scrapers/qt.rb @@ -11,8 +11,8 @@ class Qt < UrlScraper html_filters.push 'qt/entries', 'qt/clean_html' - options[:container] = 'article, .main' - options[:max_image_size] = 156_000 + options[:container] = '.b-sidebar__content' + options[:max_image_size] = 256_000 options[:skip_patterns] = [ # License, copyright attributions /3rdparty/, @@ -56,6 +56,8 @@ class Qt < UrlScraper "compatmap.html", # Indexes + "qdoc-index.html", + "qmake-manual.html", "classes.html", "qtmodules.html", "modules-qml.html", @@ -103,7 +105,12 @@ class Qt < UrlScraper Licensed under the GNU Free Documentation License, Version 1.3. HTML - version do + version '6.9' do + self.release = '6.9' + self.base_url = "https://doc.qt.io/qt-#{self.release}/" + end + + version '6.8' do self.release = '6.8' self.base_url = "https://doc.qt.io/qt-#{self.release}/" end From fbb5e617202f3970fae01ed3b2df88e6816b25f2 Mon Sep 17 00:00:00 2001 From: Calum Smith Date: Thu, 9 Oct 2025 13:11:43 -0400 Subject: [PATCH 003/270] =?UTF-8?q?Improve=20names=20and=20types=20in=20Ru?= =?UTF-8?q?st=20stdlib=20scraper=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two main fixes: 1. Names: all pages except for modules' index pages ignored what module they were from, and were just prepended with `std::`. This meant there were 13 pages named `std::Iter`, about structs named `Iter` from different modules. It also meant that things outside modules, e.g. primitive types, were prefixed with `std::`, naming the page on `bool` as `std::bool`, although it can't be referenced that way in code. This also means that there are two pages named `std::char` - one for the module, and one for the primitive type `char`. This prefixes everything in a module with that module's path, and does not prefix primitives. It also includes submodules in the path. For example: std::fn → fn std::Iter → std::option::Iter std::MetadataExt → std::os::linux::fs::MetadataExt 2. Types: almost everything was filed in `std`, with the exception of modules' index pages and primitive types. This meant there were over 30,000 pages in the `std` type, and many types for modules with only one page in them. This creates types for each module which include all submodules, and files anything not in a module, e.g. primitive types, in `std`. For example: std::bool / std::bool → std / bool std / std::Iter → std::option / std::option::Iter std / std::MetadataExt → std::os / std::os::linux::fs::MetadataExt --- lib/docs/filters/rust/entries.rb | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/docs/filters/rust/entries.rb b/lib/docs/filters/rust/entries.rb index 5a60aae785..4effefd668 100644 --- a/lib/docs/filters/rust/entries.rb +++ b/lib/docs/filters/rust/entries.rb @@ -22,7 +22,15 @@ def get_name else at_css('main h1').at_css('button')&.remove name = at_css('main h1').content.remove(/\A.+\s/).remove('⎘') - mod = slug.split('/').first + path = slug.split('/') + if path.length == 2 + # Anything in the standard library but not in a `std::*` module is + # globally available, not `use`d from the `std` crate, so we don't + # prepend `std::` to their name. + return name + end + path.pop if path.last == 'index' + mod = path[0..-2].join('::') name.prepend("#{mod}::") unless name.start_with?(mod) name end @@ -38,13 +46,12 @@ def get_type elsif slug.start_with?('error_codes') 'Compiler Errors' else - path = name.split('::') - heading = at_css('main h1').content.strip - if path.length > 2 || (path.length == 2 && (heading.start_with?('Module') || heading.start_with?('Primitive'))) - path[0..1].join('::') - else - path[0] - end + path = slug.split('/') + # Discard the filename, and use the first two path components as the + # type, or one if there is only one. This means anything in a module + # `std::foo` or submodule `std::foo::bar` gets type `std::foo`, and + # things not in modules, e.g. primitive types, get type `std`. + path[0..-2][0..1].join('::') end end From 96fd4009b38becaaf6fa85627cc6257695626a60 Mon Sep 17 00:00:00 2001 From: Osman <1126756+breadtk@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:55:48 -0700 Subject: [PATCH 004/270] Include Help keyboard shortcut on splash Include keyboard shortcut hint to enable 100% no mouse usage even from the beginning. :smile: --- assets/javascripts/templates/pages/root_tmpl.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/templates/pages/root_tmpl.js.erb b/assets/javascripts/templates/pages/root_tmpl.js.erb index 20ee43e90f..905de1a61c 100644 --- a/assets/javascripts/templates/pages/root_tmpl.js.erb +++ b/assets/javascripts/templates/pages/root_tmpl.js.erb @@ -32,7 +32,7 @@ app.templates.intro = `\ Here's what you should know before you start:
  1. Open the Preferences to enable more docs and customize the UI. -
  2. You don't have to use your mouse — see the list of keyboard shortcuts. +
  3. You don't have to use your mouse — see the list of keyboard shortcuts (or press '?' at anytime).
  4. The search supports fuzzy matching (e.g. "bgcp" brings up "background-clip").
  5. To search a specific documentation, type its name (or an abbr.), then Tab.
  6. You can search using your browser's address bar — learn how. From a3eaf25bdb4502ec76a544127e07728676f809e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20B=C3=B6rjesson?= Date: Wed, 15 Oct 2025 08:31:02 +0200 Subject: [PATCH 005/270] Crystal 1.18.0 --- lib/docs/scrapers/crystal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/crystal.rb b/lib/docs/scrapers/crystal.rb index fe58b165f1..09e62a4558 100644 --- a/lib/docs/scrapers/crystal.rb +++ b/lib/docs/scrapers/crystal.rb @@ -2,7 +2,7 @@ module Docs class Crystal < UrlScraper include MultipleBaseUrls self.type = 'crystal' - self.release = '1.17.0' + self.release = '1.18.0' self.base_urls = [ "https://crystal-lang.org/api/#{release}/", "https://crystal-lang.org/reference/#{release[0..2]}/", From d342a44754a27a5fa10ca05fc972cce3432300f2 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 15 Oct 2025 17:22:10 +0200 Subject: [PATCH 006/270] docs:upload --rclone --- lib/tasks/docs.thor | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/tasks/docs.thor b/lib/tasks/docs.thor index 6e953e4f50..ebab1acbf8 100644 --- a/lib/tasks/docs.thor +++ b/lib/tasks/docs.thor @@ -161,6 +161,7 @@ class DocsCLI < Thor desc 'upload', '[private]' option :dryrun, type: :boolean option :packaged, type: :boolean + option :rclone, type: :boolean def upload(*names) if options[:packaged] slugs = Dir[File.join(Docs.store_path, '*.tar.gz')].map { |f| File.basename(f, '.tar.gz') } @@ -190,6 +191,11 @@ class DocsCLI < Thor puts "[S3] Syncing #{doc.path}..." cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://devdocs-documents/#{doc.path} --delete --profile devdocs" cmd << ' --dryrun' if options[:dryrun] + if options[:packaged] + puts "[S3] Syncing #{doc.path} using rclone..." + cmd = "rclone sync #{File.join(Docs.store_path, doc.path)} devdocs:devdocs-documents/#{doc.path} --delete-after --progress" + cmd << ' --dry-run' if options[:dryrun] + end system(cmd) end puts '[S3] Done syncing.' @@ -202,6 +208,11 @@ class DocsCLI < Thor puts "[S3 bundle] Uploading #{filename}..." cmd = "aws s3 cp #{File.join(Docs.store_path, filename)} s3://devdocs-downloads/#{filename} --profile devdocs" cmd << ' --dryrun' if options[:dryrun] + if options[:packaged] + puts "[S3 bundle] Uploading #{filename} using rclone..." + cmd = "rclone copy #{File.join(Docs.store_path, filename)} devdocs:devdocs-downloads/" + cmd << ' --dry-run' if options[:dryrun] + end system(cmd) end puts '[S3 bundle] Done uploading.' From 88666fa2baf74dcd5edfecb0e3bf5aa9f5b44dcf Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 15 Oct 2025 17:22:30 +0200 Subject: [PATCH 007/270] Update React documentation (19.2) --- lib/docs/scrapers/react.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/docs/scrapers/react.rb b/lib/docs/scrapers/react.rb index 9bc1249cd5..52bdd7e108 100644 --- a/lib/docs/scrapers/react.rb +++ b/lib/docs/scrapers/react.rb @@ -15,6 +15,7 @@ class React < UrlScraper version do self.release = '19' + self.release = '19.2' self.base_url = 'https://react.dev' self.initial_paths = %w(/reference/react /learn) html_filters.push 'react/entries_react_dev', 'react/clean_html_react_dev' From 4a23f5e3d6200354806e8f7b8b8cb9a2502e1fa9 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Wed, 15 Oct 2025 17:24:26 +0200 Subject: [PATCH 008/270] Update Zig documentation (0.15.2) --- lib/docs/scrapers/zig.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/scrapers/zig.rb b/lib/docs/scrapers/zig.rb index dab1a59d6d..2f31658e4e 100644 --- a/lib/docs/scrapers/zig.rb +++ b/lib/docs/scrapers/zig.rb @@ -2,7 +2,7 @@ module Docs class Zig < UrlScraper self.name = 'Zig' self.type = 'simple' - self.release = '0.14.0' + self.release = '0.15.2' self.base_url = "https://ziglang.org/documentation/#{self.release}/" self.links = { home: 'https://ziglang.org/', From 3bf27f78fb459260afd5150815343e12b4ca25ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denilson=20S=C3=A1=20Maia?= Date: Fri, 17 Oct 2025 10:38:18 +0200 Subject: [PATCH 009/270] `#contributors` chat room in Discord According to ILM, "less used channels were merged". Thus, there is no longer a `devdocs` channel. Instead, we should join `#contributors`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4f45f2480..8bbea4327e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Please reach out to the community on [Discord](https://discord.gg/PRyKn3Vbay) if Keep track of development news: -* Join the devdocs chat room on [Discord](https://discord.gg/PRyKn3Vbay) +* Join the `#contributors` chat room on [Discord](https://discord.gg/PRyKn3Vbay) * Watch the repository on [GitHub](https://github.com/freeCodeCamp/devdocs/subscription) * Follow [@DevDocs](https://twitter.com/DevDocs) on Twitter @@ -205,4 +205,4 @@ We also wish that any documentation file generated using this software be attrib ## Questions? -If you have any questions, please feel free to ask them on the contributor chat room on [Discord](https://discord.gg/PRyKn3Vbay). +If you have any questions, please feel free to ask them on the `#contributors` chat room on [Discord](https://discord.gg/PRyKn3Vbay). From 315ceac5889e253a7ff8be6242119d657a8042ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denilson=20S=C3=A1=20Maia?= Date: Fri, 17 Oct 2025 10:43:29 +0200 Subject: [PATCH 010/270] Removed executable permission from many files These files don't need the Unix +x permission. This commit simply has `chmod -x` applied to these files. --- lib/docs/filters/cakephp/clean_html_39_plus.rb | 0 lib/docs/filters/cakephp/entries_39_plus.rb | 0 lib/docs/filters/fish/clean_html_sphinx.rb | 0 lib/docs/filters/fish/entries_sphinx.rb | 0 lib/docs/filters/flask/entries.rb | 0 lib/docs/filters/groovy/clean_html.rb | 0 lib/docs/filters/groovy/entries.rb | 0 lib/docs/filters/haproxy/clean_html.rb | 0 lib/docs/filters/haproxy/entries.rb | 0 lib/docs/filters/jinja/entries.rb | 0 lib/docs/filters/perl/pre_clean_html.rb | 0 lib/docs/filters/requests/entries.rb | 0 lib/docs/filters/varnish/entries.rb | 0 lib/docs/filters/werkzeug/entries.rb | 0 lib/docs/scrapers/axios.rb | 0 lib/docs/scrapers/date_fns.rb | 0 lib/docs/scrapers/flask.rb | 0 lib/docs/scrapers/groovy.rb | 0 lib/docs/scrapers/haskell.rb | 0 lib/docs/scrapers/jinja.rb | 0 lib/docs/scrapers/requests.rb | 0 lib/docs/scrapers/twig.rb | 0 lib/docs/scrapers/werkzeug.rb | 0 lib/docs/scrapers/yii.rb | 0 public/icons/docs/laravel/16@2x.png | Bin public/icons/docs/markdown/16.png | Bin public/icons/docs/markdown/16@2x.png | Bin 27 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/docs/filters/cakephp/clean_html_39_plus.rb mode change 100755 => 100644 lib/docs/filters/cakephp/entries_39_plus.rb mode change 100755 => 100644 lib/docs/filters/fish/clean_html_sphinx.rb mode change 100755 => 100644 lib/docs/filters/fish/entries_sphinx.rb mode change 100755 => 100644 lib/docs/filters/flask/entries.rb mode change 100755 => 100644 lib/docs/filters/groovy/clean_html.rb mode change 100755 => 100644 lib/docs/filters/groovy/entries.rb mode change 100755 => 100644 lib/docs/filters/haproxy/clean_html.rb mode change 100755 => 100644 lib/docs/filters/haproxy/entries.rb mode change 100755 => 100644 lib/docs/filters/jinja/entries.rb mode change 100755 => 100644 lib/docs/filters/perl/pre_clean_html.rb mode change 100755 => 100644 lib/docs/filters/requests/entries.rb mode change 100755 => 100644 lib/docs/filters/varnish/entries.rb mode change 100755 => 100644 lib/docs/filters/werkzeug/entries.rb mode change 100755 => 100644 lib/docs/scrapers/axios.rb mode change 100755 => 100644 lib/docs/scrapers/date_fns.rb mode change 100755 => 100644 lib/docs/scrapers/flask.rb mode change 100755 => 100644 lib/docs/scrapers/groovy.rb mode change 100755 => 100644 lib/docs/scrapers/haskell.rb mode change 100755 => 100644 lib/docs/scrapers/jinja.rb mode change 100755 => 100644 lib/docs/scrapers/requests.rb mode change 100755 => 100644 lib/docs/scrapers/twig.rb mode change 100755 => 100644 lib/docs/scrapers/werkzeug.rb mode change 100755 => 100644 lib/docs/scrapers/yii.rb mode change 100755 => 100644 public/icons/docs/laravel/16@2x.png mode change 100755 => 100644 public/icons/docs/markdown/16.png mode change 100755 => 100644 public/icons/docs/markdown/16@2x.png diff --git a/lib/docs/filters/cakephp/clean_html_39_plus.rb b/lib/docs/filters/cakephp/clean_html_39_plus.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/cakephp/entries_39_plus.rb b/lib/docs/filters/cakephp/entries_39_plus.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/fish/clean_html_sphinx.rb b/lib/docs/filters/fish/clean_html_sphinx.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/fish/entries_sphinx.rb b/lib/docs/filters/fish/entries_sphinx.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/flask/entries.rb b/lib/docs/filters/flask/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/groovy/clean_html.rb b/lib/docs/filters/groovy/clean_html.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/groovy/entries.rb b/lib/docs/filters/groovy/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/haproxy/clean_html.rb b/lib/docs/filters/haproxy/clean_html.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/haproxy/entries.rb b/lib/docs/filters/haproxy/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/jinja/entries.rb b/lib/docs/filters/jinja/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/perl/pre_clean_html.rb b/lib/docs/filters/perl/pre_clean_html.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/requests/entries.rb b/lib/docs/filters/requests/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/varnish/entries.rb b/lib/docs/filters/varnish/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/filters/werkzeug/entries.rb b/lib/docs/filters/werkzeug/entries.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/axios.rb b/lib/docs/scrapers/axios.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/date_fns.rb b/lib/docs/scrapers/date_fns.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/flask.rb b/lib/docs/scrapers/flask.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/groovy.rb b/lib/docs/scrapers/groovy.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/haskell.rb b/lib/docs/scrapers/haskell.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/jinja.rb b/lib/docs/scrapers/jinja.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/requests.rb b/lib/docs/scrapers/requests.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/twig.rb b/lib/docs/scrapers/twig.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/werkzeug.rb b/lib/docs/scrapers/werkzeug.rb old mode 100755 new mode 100644 diff --git a/lib/docs/scrapers/yii.rb b/lib/docs/scrapers/yii.rb old mode 100755 new mode 100644 diff --git a/public/icons/docs/laravel/16@2x.png b/public/icons/docs/laravel/16@2x.png old mode 100755 new mode 100644 diff --git a/public/icons/docs/markdown/16.png b/public/icons/docs/markdown/16.png old mode 100755 new mode 100644 diff --git a/public/icons/docs/markdown/16@2x.png b/public/icons/docs/markdown/16@2x.png old mode 100755 new mode 100644 From 8d27cd6c2931aa14ff10154b6d517df797368504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denilson=20S=C3=A1=20Maia?= Date: Fri, 17 Oct 2025 21:42:09 +0200 Subject: [PATCH 011/270] New docs: Lit As requested in: * https://trello.com/c/PVnfdeaN#comment-665fffaa2798a59513617915 * https://trello.com/c/PVnfdeaN#comment-60a7c84181482c8dce7d0f55 In a period of one year, it went from 17k to 20k stars on GitHub. This is my first time contributing to devdocs, it took me an entire day to learn how to write a new scraper and new filters for this documentation, including the time spent fine-tuning the result. --- assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_lit.scss | 52 +++++++++++++++++ lib/docs/filters/lit/clean_html.rb | 71 +++++++++++++++++++++++ lib/docs/filters/lit/entries.rb | 72 ++++++++++++++++++++++++ lib/docs/scrapers/lit.rb | 55 ++++++++++++++++++ public/icons/docs/lit/16.png | Bin 0 -> 399 bytes public/icons/docs/lit/16@2x.png | Bin 0 -> 538 bytes public/icons/docs/lit/SOURCE | 3 + 8 files changed, 254 insertions(+) create mode 100644 assets/stylesheets/pages/_lit.scss create mode 100644 lib/docs/filters/lit/clean_html.rb create mode 100644 lib/docs/filters/lit/entries.rb create mode 100644 lib/docs/scrapers/lit.rb create mode 100644 public/icons/docs/lit/16.png create mode 100644 public/icons/docs/lit/16@2x.png create mode 100644 public/icons/docs/lit/SOURCE diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index b45e7b602e..12247d4405 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -82,6 +82,7 @@ 'pages/kubernetes', 'pages/laravel', 'pages/liquid', + 'pages/lit', 'pages/love', 'pages/lua', 'pages/gnu_make', diff --git a/assets/stylesheets/pages/_lit.scss b/assets/stylesheets/pages/_lit.scss new file mode 100644 index 0000000000..c12f99c073 --- /dev/null +++ b/assets/stylesheets/pages/_lit.scss @@ -0,0 +1,52 @@ +._lit { + @extend %simple; + + h4 { @extend %block-label, %label-blue; } + + .propertyDetails { + padding-left:1.5em + } + .heading.property { + margin-top:2em + } + .heading.property > h4 { + font-weight:400 + } + .newKeyword, + .readonlyKeyword, + .staticKeyword { + font-style:italic + } + .functionName, + .propertyName { + font-weight:700 + } + aside.litdev-aside { + display: flex; + border-style: solid; + border-width: 1px; + padding: 1em 1em 1em 0em; + margin: 1em 0; + svg { + width: 1.5em; + margin-inline: 1em; + } + } + litdev-switchable-sample { + pre[data-language] { + position: relative; + } + pre[data-language]::before { + position: absolute; + top: 0; + right: 16px; + opacity: 0.5; + } + pre[data-language="js"]::before { + content: "JavaScript"; + } + pre[data-language="ts"]::before { + content: "TypeScript"; + } + } +} diff --git a/lib/docs/filters/lit/clean_html.rb b/lib/docs/filters/lit/clean_html.rb new file mode 100644 index 0000000000..da7eb03c2c --- /dev/null +++ b/lib/docs/filters/lit/clean_html.rb @@ -0,0 +1,71 @@ +module Docs + class Lit + class CleanHtmlFilter < Filter + def call + + css('.offscreen, #inlineToc, a.anchor, [aria-hidden="true"], #prevAndNextLinks').remove + + css('[tabindex]').remove_attribute('tabindex') + + # Removing the side navigation. + css('#docsNavWrapper, #rhsTocWrapper').remove + + # Removing this extra div. + div = at_css('#articleWrapper') + article = div.at_css('article') + article.remove_attribute('id') + div.replace(article) + + # Expanding and replacing the