From aace071f89993ccbaf3809273bdeaf199c0ebf90 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Tue, 12 May 2020 15:33:23 +0300 Subject: [PATCH] fix bc style breaks from rouge 3.x (#1226) * fix bc style breaks from rouge 3.x Signed-off-by: Matthew Peveler * use bright_pink for Name::Label Signed-off-by: Matthew Peveler --- config.rb | 1 + lib/monokai_sublime_slate.rb | 95 ++++++++++++++++++++++++++++++ source/layouts/layout.erb | 2 +- source/stylesheets/screen.css.scss | 4 ++ 4 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 lib/monokai_sublime_slate.rb diff --git a/config.rb b/config.rb index b3ba23e..22e956d 100644 --- a/config.rb +++ b/config.rb @@ -23,6 +23,7 @@ set :fonts_dir, 'fonts' # Activate the syntax highlighter activate :syntax ready do + require './lib/monokai_sublime_slate.rb' require './lib/multilang.rb' end diff --git a/lib/monokai_sublime_slate.rb b/lib/monokai_sublime_slate.rb new file mode 100644 index 0000000..cd2de33 --- /dev/null +++ b/lib/monokai_sublime_slate.rb @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- # +# frozen_string_literal: true + +# this is based on https://github.com/rouge-ruby/rouge/blob/master/lib/rouge/themes/monokai_sublime.rb +# but without the added background, and changed styling for JSON keys to be soft_yellow instead of white + +module Rouge + module Themes + class MonokaiSublimeSlate < CSSTheme + name 'monokai.sublime.slate' + + palette :black => '#000000' + palette :bright_green => '#a6e22e' + palette :bright_pink => '#f92672' + palette :carmine => '#960050' + palette :dark => '#49483e' + palette :dark_grey => '#888888' + palette :dark_red => '#aa0000' + palette :dimgrey => '#75715e' + palette :emperor => '#555555' + palette :grey => '#999999' + palette :light_grey => '#aaaaaa' + palette :light_violet => '#ae81ff' + palette :soft_cyan => '#66d9ef' + palette :soft_yellow => '#e6db74' + palette :very_dark => '#1e0010' + palette :whitish => '#f8f8f2' + palette :orange => '#f6aa11' + palette :white => '#ffffff' + + style Generic::Heading, :fg => :grey + style Literal::String::Regex, :fg => :orange + style Generic::Output, :fg => :dark_grey + style Generic::Prompt, :fg => :emperor + style Generic::Strong, :bold => false + style Generic::Subheading, :fg => :light_grey + style Name::Builtin, :fg => :orange + style Comment::Multiline, + Comment::Preproc, + Comment::Single, + Comment::Special, + Comment, :fg => :dimgrey + style Error, + Generic::Error, + Generic::Traceback, :fg => :carmine + style Generic::Deleted, + Generic::Inserted, + Generic::Emph, :fg => :dark + style Keyword::Constant, + Keyword::Declaration, + Keyword::Reserved, + Name::Constant, + Keyword::Type, :fg => :soft_cyan + style Literal::Number::Float, + Literal::Number::Hex, + Literal::Number::Integer::Long, + Literal::Number::Integer, + Literal::Number::Oct, + Literal::Number, + Literal::String::Char, + Literal::String::Escape, + Literal::String::Symbol, :fg => :light_violet + style Literal::String::Doc, + Literal::String::Double, + Literal::String::Backtick, + Literal::String::Heredoc, + Literal::String::Interpol, + Literal::String::Other, + Literal::String::Single, + Literal::String, :fg => :soft_yellow + style Name::Attribute, + Name::Class, + Name::Decorator, + Name::Exception, + Name::Function, :fg => :bright_green + style Name::Variable::Class, + Name::Namespace, + Name::Entity, + Name::Builtin::Pseudo, + Name::Variable::Global, + Name::Variable::Instance, + Name::Variable, + Text::Whitespace, + Text, + Name, :fg => :white + style Name::Label, :fg => :bright_pink + style Operator::Word, + Name::Tag, + Keyword, + Keyword::Namespace, + Keyword::Pseudo, + Operator, :fg => :bright_pink + end + end + end diff --git a/source/layouts/layout.erb b/source/layouts/layout.erb index 29b80d7..1453728 100644 --- a/source/layouts/layout.erb +++ b/source/layouts/layout.erb @@ -32,7 +32,7 @@ under the License. <%= current_page.data.title || "API Documentation" %> <%= stylesheet_link_tag :screen, media: :screen %> <%= stylesheet_link_tag :print, media: :print %> diff --git a/source/stylesheets/screen.css.scss b/source/stylesheets/screen.css.scss index 83da68c..ed23b31 100644 --- a/source/stylesheets/screen.css.scss +++ b/source/stylesheets/screen.css.scss @@ -511,6 +511,10 @@ html, body { // This is all the stuff that appears in the right half of the page .content { + &>div.highlight { + clear:none; + } + pre, blockquote { background-color: $code-bg; color: #fff;