added missing plugin oops
This commit is contained in:
parent
dff4f4df20
commit
e127389ac6
1 changed files with 38 additions and 0 deletions
38
_plugins/extensions.rb
Normal file
38
_plugins/extensions.rb
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
require "liquid"
|
||||||
|
require "jekyll"
|
||||||
|
|
||||||
|
module Jekyll
|
||||||
|
module LynnesbianDotSpaceFilters
|
||||||
|
def ansi_colour(code)
|
||||||
|
"\u001b[38;5;#{code}m"
|
||||||
|
end
|
||||||
|
|
||||||
|
def ansi_bg(code)
|
||||||
|
"\u001b[48;5;#{code}m"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class AnsiResetTag < Liquid::Tag
|
||||||
|
def render(context)
|
||||||
|
"\u001b[0m"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class AnsiBoldTag < Liquid::Tag
|
||||||
|
def render(context)
|
||||||
|
"\u001b[1m"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class AnsiUnderlineTag < Liquid::Tag
|
||||||
|
def render(context)
|
||||||
|
"\u001b[4m"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Liquid::Template.register_filter(Jekyll::LynnesbianDotSpaceFilters)
|
||||||
|
Liquid::Template.register_tag('ansi_reset', Jekyll::AnsiResetTag)
|
||||||
|
Liquid::Template.register_tag('ansi_bold', Jekyll::AnsiBoldTag)
|
||||||
|
Liquid::Template.register_tag('ansi_underline', Jekyll::AnsiUnderlineTag)
|
Loading…
Reference in a new issue