diff --git a/Gemfile b/Gemfile index 0a5981ce..ca5435fc 100644 --- a/Gemfile +++ b/Gemfile @@ -4,9 +4,9 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" } ruby '3.1.1' -gem 'middleman', '~> 4.0' +gem 'middleman', '~> 4.4' -gem 'middleman-gh-pages', git: 'https://github.com/orta/middleman-gh-pages.git' +gem 'middleman-gh-pages', git: 'https://github.com/CocoaPods/middleman-gh-pages.git' gem 'middleman-livereload' gem 'middleman-sprockets' gem 'middleman-syntax' @@ -20,7 +20,6 @@ gem 'yard' gem 'tilt' -gem 'activesupport', '~> 5.0' gem 'github-markup' gem 'nokogiri' gem 'pygments.rb' @@ -34,7 +33,7 @@ gem 'mini_racer' gem 'webrick' # https://github.com/middleman/middleman-syntax/issues/80 -gem 'haml', '~> 5.0' +gem 'haml', '< 6.0' gem 'cocoapods', '~> 1.0' diff --git a/Gemfile.lock b/Gemfile.lock index be167cc8..7f667e06 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT - remote: https://github.com/orta/middleman-gh-pages.git - revision: 87ce11bd60627aeaaea9af2c70a0a1f94be7b6b4 + remote: https://github.com/CocoaPods/middleman-gh-pages.git + revision: 6fa2de7abe554f59f7472bb9c8997a50907ccc6f specs: - middleman-gh-pages (0.0.3) + middleman-gh-pages (0.4.1) rake (> 0.9.3) GIT @@ -17,11 +17,11 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (5.2.8.1) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) @@ -30,12 +30,12 @@ GEM atomos (0.1.3) backports (3.24.1) claide (1.1.0) - cocoapods (1.14.0) + cocoapods (1.14.3) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.14.0) + cocoapods-core (= 1.14.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 2.0) + cocoapods-downloader (>= 2.1, < 3.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-trunk (>= 1.6.0, < 2.0) @@ -48,7 +48,7 @@ GEM nap (~> 1.0) ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.23.0, < 2.0) - cocoapods-core (1.14.0) + cocoapods-core (1.14.3) activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -59,7 +59,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (2.0) + cocoapods-downloader (2.1) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -73,7 +73,7 @@ GEM coffee-script-source (1.12.2) colored2 (3.1.2) concurrent-ruby (1.2.2) - contracts (0.13.0) + contracts (0.16.1) dotenv (2.8.1) em-websocket (0.5.3) eventmachine (>= 0.12.9) @@ -100,30 +100,30 @@ GEM hashie (3.6.0) http_parser.rb (0.8.0) httpclient (2.8.3) - i18n (0.9.5) + i18n (1.6.0) concurrent-ruby (~> 1.0) json (2.6.3) kramdown (2.4.0) rexml libv8-node (18.16.0.0) - listen (3.0.8) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) memoist (0.16.2) - middleman (4.3.11) + middleman (4.5.1) coffee-script (~> 2.2) haml (>= 4.0.5) kramdown (>= 2.3.0) - middleman-cli (= 4.3.11) - middleman-core (= 4.3.11) - middleman-cli (4.3.11) - thor (>= 0.17.0, < 2.0) - middleman-core (4.3.11) - activesupport (>= 4.2, < 6.0) - addressable (~> 2.3) + middleman-cli (= 4.5.1) + middleman-core (= 4.5.1) + middleman-cli (4.5.1) + thor (>= 0.17.0, < 1.3.0) + middleman-core (4.5.1) + activesupport (>= 6.1, < 7.1) + addressable (~> 2.4) backports (~> 3.6) - bundler - contracts (~> 0.13.0) + bundler (~> 2.0) + contracts (~> 0.13, < 0.17) dotenv erubis execjs (~> 2.0) @@ -131,16 +131,18 @@ GEM fastimage (~> 2.0) hamster (~> 3.0) hashie (~> 3.4) - i18n (~> 0.9.0) - listen (~> 3.0.0) + i18n (~> 1.6.0) + listen (~> 3.0) memoist (~> 0.14) - padrino-helpers (~> 0.13.0) + padrino-helpers (~> 0.15.0) parallel rack (>= 1.4.5, < 3) sassc (~> 2.0) servolux tilt (~> 2.0.9) + toml uglifier (~> 3.0) + webrick middleman-livereload (3.4.7) em-websocket (~> 0.5.1) middleman-core (>= 3.3) @@ -159,23 +161,23 @@ GEM nanaimo (0.3.0) nap (1.1.0) netrc (0.11.0) - nokogiri (1.15.4) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) - padrino-helpers (0.13.3.4) - i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.13.3.4) + padrino-helpers (0.15.3) + i18n (>= 0.6.7, < 2) + padrino-support (= 0.15.3) tilt (>= 1.4.1, < 3) - padrino-support (0.13.3.4) - activesupport (>= 3.1) + padrino-support (0.15.3) parallel (1.23.0) + parslet (2.0.0) public_suffix (4.0.7) pygments.rb (2.4.1) - racc (1.7.1) + racc (1.7.3) rack (2.2.8) rack-livereload (0.3.17) rack - rake (13.0.6) + rake (13.1.0) rb-fsevent (0.11.2) rb-inotify (0.10.1) ffi (~> 1.0) @@ -197,13 +199,14 @@ GEM concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) temple (0.8.2) - thor (1.3.0) - thread_safe (0.3.6) + thor (1.2.2) tilt (2.0.11) - typhoeus (1.4.0) + toml (0.3.0) + parslet (>= 1.8.0, < 3.0.0) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (1.2.11) - thread_safe (~> 0.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) uglifier (3.2.0) execjs (>= 0.3.0, < 3) webrick (1.8.1) @@ -220,13 +223,12 @@ PLATFORMS ruby DEPENDENCIES - activesupport (~> 5.0) cocoapods (~> 1.0) concurrent-ruby foreman github-markup - haml (~> 5.0) - middleman (~> 4.0) + haml (< 6.0) + middleman (~> 4.4) middleman-gh-pages! middleman-livereload middleman-sprockets diff --git a/config.rb b/config.rb index 34e35598..b51b303b 100644 --- a/config.rb +++ b/config.rb @@ -5,7 +5,7 @@ # Tools for generating data require "lib/navigation_helpers.rb" require "lib/html_helpers.rb" -require 'lib/doc/code_objects' +require 'lib/doc' set :encoding, 'utf-8' set :relative_links, true @@ -22,6 +22,8 @@ set :markdown, :tables => true, :autolink => true, :gh_blockcode => true, :fenced_code_blocks => true, :with_toc_data => true set :markdown_engine, :redcarpet +set :sass_assets_paths, ['source/shared/sass'] + activate :automatic_image_sizes activate :syntax activate :sprockets @@ -38,6 +40,9 @@ helpers do + def asset_data_uri(*args) + asset_url(*args) + end def shared_partial(*sources) sources.inject([]) do |combined, source| @@ -80,5 +85,3 @@ def shared_partial(*sources) :locals => { :name => 'commands', :guides_page_title => "Command-line Reference", :fullwidth => true }, :ignore => true, } - -data.store(:site, ["guides"]) diff --git a/lib/doc.rb b/lib/doc.rb index d06f4724..6558e28e 100644 --- a/lib/doc.rb +++ b/lib/doc.rb @@ -1,4 +1,4 @@ -DOC_ROOT = Pathname.new(File.expand_path('../', __FILE__)) +DOC_ROOT = Pathname.new(__dir__) $:.unshift((DOC_ROOT).to_s) require 'doc/code_objects' diff --git a/lib/html_helpers.rb b/lib/html_helpers.rb index f119e8b5..bc0037a2 100644 --- a/lib/html_helpers.rb +++ b/lib/html_helpers.rb @@ -1,3 +1,10 @@ + +class RubyHTMLwithPygments < Redcarpet::Render::HTML + def block_code(code, language) + Pygments.highlight(code, lexer: "ruby") + end +end + module HTMLHelpers # Converts a markdown string to HTML. diff --git a/lib/navigation_helpers.rb b/lib/navigation_helpers.rb index 34c40ad7..25b3d4bd 100644 --- a/lib/navigation_helpers.rb +++ b/lib/navigation_helpers.rb @@ -1,7 +1,6 @@ require 'active_support' module NavigationHelpers - # The title of the current page. If not specified with YAML # Frontmatter it is inferred from the file name. # @@ -32,7 +31,7 @@ def page_browser_title # def deserialize(name) @cached_doc_datas ||= {} - @cached_doc_datas[name] ||= YAML::load(File.open("docs_data/#{parameterize name}.yaml")) + @cached_doc_datas[name] ||= YAML.unsafe_load(File.open("docs_data/#{parameterize name}.yaml")) end #-----------------------------------------------------------------------------# diff --git a/source/layouts/quality_indexes.slim b/source/layouts/quality_indexes.slim index e8b99090..13719643 100644 --- a/source/layouts/quality_indexes.slim +++ b/source/layouts/quality_indexes.slim @@ -1,12 +1,4 @@ ruby: - # Make the code renderer ruby by default - class HTMLwithPygments < Redcarpet::Render::HTML - def block_code(code, language) - Pygments.highlight(code, lexer: "ruby") - end - end - - quality = File.read "external/cocoadocs-api/quality_modifiers.rb" markdown = quality.split("#### <---- Start of Markdown").last.split("#### End of Markdown --->").first markdown = markdown.lines.map { |l| l[1...-1] }.join("\n") @@ -14,7 +6,7 @@ ruby: # These procs are getting a bit unweildy for users to see now IMO markdown = markdown.gsub("Proc.new { |spec, cd_stats, stats, cp_stats, owners|", "{ |...|") - renderer = Redcarpet::Markdown.new(HTMLwithPygments) + renderer = Redcarpet::Markdown.new(RubyHTMLwithPygments) result = renderer.render(markdown) = wrap_layout :layout do