From 7f33327fc57cdc0988fdffef7c327615822763b4 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 8 Dec 2024 12:38:51 +0100 Subject: [PATCH] Update Sass documentation (1.82.9) --- assets/stylesheets/pages/_yard.scss | 17 ++++++++++++++++- lib/docs/filters/sass/clean_html.rb | 18 +++++++++++------- lib/docs/scrapers/sass.rb | 12 ++++++++---- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/assets/stylesheets/pages/_yard.scss b/assets/stylesheets/pages/_yard.scss index bb2fbc47..195059f7 100644 --- a/assets/stylesheets/pages/_yard.scss +++ b/assets/stylesheets/pages/_yard.scss @@ -1,5 +1,20 @@ ._yard { @extend %simple; - .tag_title { font-weight: var(--boldFontWeight); } + .tag_title { + font-weight: var(--boldFontWeight); + } + + .sl-c-description-list--horizontal * { + display: inline-block; + padding: 0; + margin: 0; + dt { + margin-left: 1rem; + } + } + + .sl-c-callout--warning { + @extend %note, %note-orange; + } } diff --git a/lib/docs/filters/sass/clean_html.rb b/lib/docs/filters/sass/clean_html.rb index 5b17d4a9..d1b7bcb2 100644 --- a/lib/docs/filters/sass/clean_html.rb +++ b/lib/docs/filters/sass/clean_html.rb @@ -5,14 +5,13 @@ module Docs @doc = at_css('#main-content .typedoc', '#main-content') css('.sl-c-alert').remove - css('.sl-l-medium-holy-grail__navigation').remove - css('.sl-r-banner').remove - css('.site-footer').remove - css('.tsd-breadcrumb').remove + css('.sl-c-callout--warning > h3').remove + css('.ui-tabs-nav').remove + css('.sl-c-to-playground').remove # Add id to code blocks css('pre.signature').each do |node| @@ -42,14 +41,19 @@ module Docs css('.visuallyhidden').remove ### Syntax Highlight ### - css('.highlight.scss', '.highlight.sass').each do |node| + css('.language-scss').each do |node| node['data-language'] = 'scss' node.content = node.content.strip end - css('.highlight.css').each do |node| + css('.language-sass').each do |node| + node['data-language'] = 'sass' + node.content = "// SASS\n#{node.content.strip}" + end + + css('.language-css').each do |node| node['data-language'] = 'css' - node.content = node.content.strip + node.content = "/* CSS */\n#{node.content.strip}" end doc diff --git a/lib/docs/scrapers/sass.rb b/lib/docs/scrapers/sass.rb index 90be9e05..d7b5954a 100644 --- a/lib/docs/scrapers/sass.rb +++ b/lib/docs/scrapers/sass.rb @@ -1,7 +1,7 @@ module Docs class Sass < UrlScraper self.type = 'yard' - self.release = '1.56.1' + self.release = '1.82.9' self.base_url = 'https://sass-lang.com/documentation' self.root_path = 'index.html' self.links = { @@ -14,17 +14,21 @@ module Docs options[:root_title] = false options[:skip_patterns] = [/breaking-changes/] - - # options[:container] = '#main-content' + options[:trailing_slash] = false options[:attribution] = <<-HTML - © 2006–2022 the Sass team, and numerous contributors
+ © 2006–2024 the Sass team, and numerous contributors
Licensed under the MIT License. HTML + + private def get_latest_version(opts) get_npm_version('sass', opts) end + def parse(response) + response.body.gsub! ' ', ' ' + end end end