diff options
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/enunciation.rb | 16 | ||||
-rw-r--r-- | _plugins/example.rb | 2 | ||||
-rw-r--r-- | _plugins/proof.rb | 2 | ||||
-rw-r--r-- | _plugins/singledollar.rb | 1 |
4 files changed, 14 insertions, 7 deletions
diff --git a/_plugins/enunciation.rb b/_plugins/enunciation.rb index b141ae9..17bfd1c 100644 --- a/_plugins/enunciation.rb +++ b/_plugins/enunciation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Jekyll class EnunciationTagBlock < Liquid::Block def initialize(tag_name, arg, parse_context) @@ -11,19 +13,19 @@ module Jekyll # If the enunciation ends with a KaTeX displayed equation, # then we remove the bottom margin. if text[-5, 5] == " $$\n" - text += ' {: .katex-display .mb-0 }' + text << ' {: .katex-display .mb-0 }' elsif text[-3, 3] == "$$\n" - text += '{: .katex-display .mb-0 }' + text << '{: .katex-display .mb-0 }' end # Check if a description was given. if @arg.empty? "{: .#{block_name} }\n #{text.gsub!(/^/, '> ')}" else - if @arg[0] == '*' - title = @arg.delete_prefix('* ') - else - title = "#{block_name.capitalize} (#{@arg})" - end + title = if @arg[0] == '*' + @arg.delete_prefix('* ') + else + "#{block_name.capitalize} (#{@arg})" + end slug = @slugtemplate.render('string' => title) "{: .#{block_name}-title }\n> #{title}\n> {: \##{slug} }\n>\n#{text.gsub!(/^/, '> ')}" end diff --git a/_plugins/example.rb b/_plugins/example.rb index cdff2da..68787df 100644 --- a/_plugins/example.rb +++ b/_plugins/example.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Jekyll class ExampleTagBlock < Liquid::Block def render(context) diff --git a/_plugins/proof.rb b/_plugins/proof.rb index 0c2b63b..e1e3ab0 100644 --- a/_plugins/proof.rb +++ b/_plugins/proof.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Jekyll class ProofTagBlock < Liquid::Block def render(context) diff --git a/_plugins/singledollar.rb b/_plugins/singledollar.rb index bb1f10c..c5b49e4 100644 --- a/_plugins/singledollar.rb +++ b/_plugins/singledollar.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # https://gist.github.com/sp301415/db9f7bee03bda483aa2ca7c0ca92fbfa require 'kramdown/parser/kramdown' |