mdless 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef90f38be64fdcd4e3666782b957ac2a27ec4346103fa79a1760626977051a8f
4
- data.tar.gz: 856113d17ab7217c28de2f2c2405acd185e99cdc4ca0370fbb73053371babab1
3
+ metadata.gz: 2a8bb0bc65cda56264422a8f0fc98ed7c8d75f67d6604791fe157d111223d358
4
+ data.tar.gz: 25fa19dec8c2c34bccaa00b3fccf542c13384e12498cda7f1b529f703a7b8399
5
5
  SHA512:
6
- metadata.gz: f291d6eef35c904afc13adecc673db8736b002e556fc55f311cae6721685868f709cc285cf2a2906657933a05f385ce5168190e8672f16a672b8dd41f3bb7d1c
7
- data.tar.gz: 75c67e0498a10ff7c26d2b9f9d43808174826807369650b33918ba0b63342cfaf1ae359530f957db2b9c403026918783d3411a291f92b732e6a2921efccd15b0
6
+ metadata.gz: 65664be5ef8893f3f2c1e377633bdb69c3780e2a957c2f555e50add0e059242a966663bb0faaf609d6a9015d4ec49aba18c849bcdee58bc62e2ab7cd251505e2
7
+ data.tar.gz: 6b784620a50a0c182a49244640bf278e7ab19a6e3e840d8bc1c83eb308709f5fcb0979120157b8671101b0135cbec6a1bf52ec3cd42d765ae08aed8a940cab45
data/README.md CHANGED
@@ -94,6 +94,21 @@ Font and color settings are set using a string of color names and modifiers. A t
94
94
 
95
95
  Some extra (non-color) settings are available for certain keys, e.g. `pad_char` to define the right padding character used on level 1 and 2 headlines. Note that you can change the [Pygments](http://pygments.org/) theme used for syntax highlighting with the code_block.pygments_theme setting. For a list of available styles (assuming you have Pygments installed), use `pygmentize -L styles`.
96
96
 
97
+ The display of characters around emphasis and code spans can be configured. By default, the surrounding character for bold is `**`, italic is `_`, and code span is \`. You can leave these keys empty to not display characters at all. For triple-emphasized text, the text will be surrounded by italic and bold characters, in that order.
98
+
99
+ ```yaml
100
+ emphasis:
101
+ bold: b
102
+ bold_character: "**"
103
+ italic: u i
104
+ italic_character: ""
105
+ bold-italic: b u i
106
+ code_span:
107
+ marker: b white
108
+ color: b white on_intense_black
109
+ character: ""
110
+ ```
111
+
97
112
  *Note:* the ANSI escape codes are reset every time the color changes, so, for example, if you have a key that defines underlines for the url in a link, the underline will automatically be removed when it gets to a bracket. This also means that if you define a background color, you'll need to define it again on all the keys that it should affect.
98
113
 
99
114
  Base colors:
data/lib/mdless/colors.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module CLIMarkdown
2
2
  module Colors
3
+ ESCAPE_REGEX = /(?<=\[)(?:(?:(?:[349]|10)[0-9]|[0-9])?;?)+(?=m)/.freeze
3
4
 
4
5
  COLORS = {
5
6
  :reset => 0, # synonym for :clear
@@ -57,6 +58,118 @@ module CLIMarkdown
57
58
  self.gsub(/\e\[[\d;]+m/,'')
58
59
  end
59
60
 
61
+ # Get the calculated ANSI color at the end of the
62
+ # string
63
+ #
64
+ # @return ANSI escape sequence to match color
65
+ #
66
+ def last_color_code
67
+ m = scan(ESCAPE_REGEX)
68
+
69
+ em = ['0']
70
+ fg = nil
71
+ bg = nil
72
+ rgbf = nil
73
+ rgbb = nil
74
+
75
+ m.each do |c|
76
+ case c
77
+ when '0'
78
+ em = ['0']
79
+ fg, bg, rgbf, rgbb = nil
80
+ when /^[34]8/
81
+ case c
82
+ when /^3/
83
+ fg = nil
84
+ rgbf = c
85
+ when /^4/
86
+ bg = nil
87
+ rgbb = c
88
+ end
89
+ else
90
+ c.split(/;/).each do |i|
91
+ x = i.to_i
92
+ if x <= 9
93
+ em << x
94
+ elsif x >= 30 && x <= 39
95
+ rgbf = nil
96
+ fg = x
97
+ elsif x >= 40 && x <= 49
98
+ rgbb = nil
99
+ bg = x
100
+ elsif x >= 90 && x <= 97
101
+ rgbf = nil
102
+ fg = x
103
+ elsif x >= 100 && x <= 107
104
+ rgbb = nil
105
+ bg = x
106
+ end
107
+ end
108
+ end
109
+ end
110
+
111
+ escape = "\e[#{em.join(';')}m"
112
+ escape += "\e[#{rgbb}m" if rgbb
113
+ escape += "\e[#{rgbf}m" if rgbf
114
+ escape + "\e[#{[fg, bg].delete_if(&:nil?).join(';')}m"
115
+ end
116
+
117
+ # Get the calculated ANSI color at the end of the
118
+ # string
119
+ #
120
+ # @return ANSI escape sequence to match color
121
+ #
122
+ def last_color_code
123
+ m = scan(ESCAPE_REGEX)
124
+
125
+ em = ['0']
126
+ fg = nil
127
+ bg = nil
128
+ rgbf = nil
129
+ rgbb = nil
130
+
131
+ m.each do |c|
132
+ case c
133
+ when '0'
134
+ em = ['0']
135
+ fg, bg, rgbf, rgbb = nil
136
+ when /^[34]8/
137
+ case c
138
+ when /^3/
139
+ fg = nil
140
+ rgbf = c
141
+ when /^4/
142
+ bg = nil
143
+ rgbb = c
144
+ end
145
+ else
146
+ c.split(/;/).each do |i|
147
+ x = i.to_i
148
+ if x <= 9
149
+ em << x
150
+ elsif x >= 30 && x <= 39
151
+ rgbf = nil
152
+ fg = x
153
+ elsif x >= 40 && x <= 49
154
+ rgbb = nil
155
+ bg = x
156
+ elsif x >= 90 && x <= 97
157
+ rgbf = nil
158
+ fg = x
159
+ elsif x >= 100 && x <= 107
160
+ rgbb = nil
161
+ bg = x
162
+ end
163
+ end
164
+ end
165
+ end
166
+
167
+ escape = "\e[#{em.join(';')}m"
168
+ escape += "\e[#{rgbb}m" if rgbb
169
+ escape += "\e[#{rgbf}m" if rgbf
170
+ escape + "\e[#{[fg, bg].delete_if(&:nil?).join(';')}m"
171
+ end
172
+
60
173
  def blackout(bgcolor)
61
174
  key = bgcolor.to_sym
62
175
  bg = COLORS.key?(key) ? COLORS[key] : 40
@@ -7,11 +7,21 @@ module Redcarpet
7
7
 
8
8
  @@listitemid = 0
9
9
  @@listid = 0
10
+ @@elementid = 0
10
11
  @@footnotes = []
11
12
  @@headers = []
12
13
  @@links = []
13
14
  @@footer_links = []
14
15
 
16
+ def pre_element
17
+ @@elementid += 1
18
+ "<<pre#{@@elementid}>>"
19
+ end
20
+
21
+ def post_element
22
+ "<<post#{@@elementid}>>"
23
+ end
24
+
15
25
  def xc
16
26
  x + color('text')
17
27
  end
@@ -268,42 +278,72 @@ module Redcarpet
268
278
 
269
279
  def autolink(link, _)
270
280
  [
281
+ pre_element,
271
282
  color('link brackets'),
272
283
  '<',
273
284
  color('link url'),
274
285
  link,
275
286
  color('link brackets'),
276
287
  '>',
277
- xc
288
+ xc,
289
+ post_element
278
290
  ].join('')
279
291
  end
280
292
 
281
293
  def codespan(code)
282
294
  [
295
+ pre_element,
283
296
  color('code_span marker'),
284
- '`',
297
+ @theme['code_span']['character'],
285
298
  color('code_span color'),
286
299
  code,
287
300
  color('code_span marker'),
288
- '`',
289
- xc
301
+ @theme['code_span']['character'],
302
+ xc,
303
+ post_element
290
304
  ].join('')
291
305
  end
292
306
 
293
307
  def double_emphasis(text)
294
- "#{color('emphasis bold')}#{text}#{xc}"
308
+ [
309
+ pre_element,
310
+ color('emphasis bold'),
311
+ @theme['emphasis']['bold_character'],
312
+ text,
313
+ @theme['emphasis']['bold_character'],
314
+ xc,
315
+ post_element
316
+ ].join
295
317
  end
296
318
 
297
319
  def emphasis(text)
298
- "#{color('emphasis italic')}#{text}#{xc}"
320
+ [
321
+ pre_element,
322
+ color('emphasis italic'),
323
+ @theme['emphasis']['italic_character'],
324
+ text,
325
+ @theme['emphasis']['italic_character'],
326
+ xc,
327
+ post_element
328
+ ].join
299
329
  end
300
330
 
301
331
  def triple_emphasis(text)
302
- "#{color('emphasis bold-italic')}#{text}#{xc}"
332
+ [
333
+ pre_element,
334
+ color('emphasis bold-italic'),
335
+ @theme['emphasis']['italic_character'],
336
+ @theme['emphasis']['bold_character'],
337
+ text,
338
+ @theme['emphasis']['bold_character'],
339
+ @theme['emphasis']['italic_character'],
340
+ xc,
341
+ post_element
342
+ ].join
303
343
  end
304
344
 
305
345
  def highlight(text)
306
- "#{color('highlight')}#{text}#{xc}"
346
+ "#{pre_element}#{color('highlight')}#{text}#{xc}#{post_element}"
307
347
  end
308
348
 
309
349
  def color_image_tag(link, title, alt_text)
@@ -321,80 +361,12 @@ module Redcarpet
321
361
  title.nil? ? '' : %( "#{title}"),
322
362
  color('image brackets'),
323
363
  ')',
324
- xc
364
+ xc,
325
365
  ].join
326
366
  end
327
367
 
328
368
  def image(link, title, alt_text)
329
- if (exec_available('imgcat') || exec_available('chafa')) && @options[:local_images]
330
- if exec_available('imgcat')
331
- @log.info('Using imgcat for image rendering')
332
- elsif exec_available('chafa')
333
- @log.info('Using chafa for image rendering')
334
- end
335
- img_path = link
336
- if img_path =~ /^http/ && @options[:remote_images]
337
- if exec_available('imgcat')
338
- @log.info('Using imgcat for image rendering')
339
- begin
340
- res, s = Open3.capture2(%(curl -sS "#{img_path}" 2> /dev/null | imgcat))
341
-
342
- if s.success?
343
- pre = !alt_text.nil? ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
344
- post = !title.nil? ? "\n #{c(%i[b blue])}-- #{title} --" : ''
345
- result = pre + res + post
346
- end
347
- rescue StandardError => e
348
- @log.error(e)
349
- end
350
- elsif exec_available('chafa')
351
- @log.info('Using chafa for image rendering')
352
- term = ''
353
- term = ENV['TERM_PROGRAM'] =~ /iterm/i ? '-f iterm' : term
354
- term = ENV['TERM_PROGRAM'] =~ /kitty/i ? '-f kitty' : term
355
- FileUtils.rm_r '.mdless_tmp', force: true if File.directory?('.mdless_tmp')
356
- Dir.mkdir('.mdless_tmp')
357
- Dir.chdir('.mdless_tmp')
358
- `curl -SsO #{img_path} 2> /dev/null`
359
- tmp_img = File.basename(img_path)
360
- img = `chafa #{term} "#{tmp_img}"`
361
- pre = alt_text ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
362
- post = title ? "\n #{c(%i[b blue])}-- #{tail} --" : ''
363
- result = pre + img + post
364
- Dir.chdir('..')
365
- FileUtils.rm_r '.mdless_tmp', force: true
366
- else
367
- @log.warn('No viewer for remote images')
368
- end
369
- else
370
- if img_path =~ %r{^[~/]}
371
- img_path = File.expand_path(img_path)
372
- elsif @file
373
- base = File.expand_path(File.dirname(@file))
374
- img_path = File.join(base, img_path)
375
- end
376
- if File.exist?(img_path)
377
- pre = !alt_text.nil? ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
378
- post = !title.nil? ? "\n #{c(%i[b blue])}-- #{title} --" : ''
379
- if exec_available('imgcat')
380
- img = `imgcat -p "#{img_path}"`
381
- @log.info("Rendering image with `imgcat -p #{img_path}`")
382
- elsif exec_available('chafa')
383
- term = ''
384
- term = ENV['TERM_PROGRAM'] =~ /iterm/i ? '-f iterm' : term
385
- term = ENV['TERM_PROGRAM'] =~ /kitty/i ? '-f kitty' : term
386
- @log.info("Rendering image with `chafa #{term} #{img_path}`")
387
- img = `chafa #{term} "#{img_path}"`
388
- end
389
- result = pre + img + post
390
- end
391
- end
392
- end
393
- if result.nil?
394
- color_image_tag(link, title, alt_text)
395
- else
396
- result + xc
397
- end
369
+ "<<img>>#{link}||#{title}||#{alt_text}<</img>>"
398
370
  end
399
371
 
400
372
  def linebreak
@@ -403,6 +375,7 @@ module Redcarpet
403
375
 
404
376
  def color_link(link, title, content)
405
377
  [
378
+ pre_element,
406
379
  color('link brackets'),
407
380
  '[',
408
381
  color('link text'),
@@ -414,12 +387,14 @@ module Redcarpet
414
387
  title.nil? ? '' : %( "#{title}"),
415
388
  color('link brackets'),
416
389
  ')',
417
- xc
390
+ xc,
391
+ post_element
418
392
  ].join
419
393
  end
420
394
 
421
395
  def color_link_reference(link, idx, content)
422
396
  [
397
+ pre_element,
423
398
  color('link brackets'),
424
399
  '[',
425
400
  color('link text'),
@@ -430,7 +405,8 @@ module Redcarpet
430
405
  idx,
431
406
  color('link brackets'),
432
407
  ']',
433
- xc
408
+ xc,
409
+ post_element
434
410
  ].join
435
411
  end
436
412
 
@@ -463,19 +439,19 @@ module Redcarpet
463
439
  end
464
440
 
465
441
  def color_tags(html)
466
- html.gsub(%r{(<\S+( .*?)?/?>)}, "#{color('html brackets')}\\1#{xc}")
442
+ html.gsub(%r{(<\S+( [^>]+)?>)}, "#{color('html brackets')}\\1#{xc}")
467
443
  end
468
444
 
469
445
  def raw_html(raw_html)
470
- "#{color('html color')}#{color_tags(raw_html)}#{xc}"
446
+ "#{pre_element}#{color('html color')}#{color_tags(raw_html)}#{xc}#{post_element}"
471
447
  end
472
448
 
473
449
  def strikethrough(text)
474
- "#{color('strikethrough')}#{text}#{xc}"
450
+ "#{pre_element}#{color('strikethrough')}#{text}#{xc}#{post_element}"
475
451
  end
476
452
 
477
453
  def superscript(text)
478
- "#{color('super')}^#{text}#{xc}"
454
+ "#{pre_element}#{color('super')}^#{text}#{xc}#{post_element}"
479
455
  end
480
456
 
481
457
  def footnotes(text)
@@ -513,9 +489,11 @@ module Redcarpet
513
489
 
514
490
  def footnote_ref(text)
515
491
  [
492
+ pre_element,
516
493
  color('footnote title'),
517
494
  "[^#{text}]",
518
- xc
495
+ xc,
496
+ post_element
519
497
  ].join('')
520
498
  end
521
499
 
@@ -722,7 +700,117 @@ module Redcarpet
722
700
  end
723
701
  end
724
702
 
703
+ def fix_colors(input)
704
+ input.gsub(/<<pre(?<id>\d+)>>(?<content>.*?)<<post\k<id>>>/m) do
705
+ m = Regexp.last_match
706
+ pre = m.pre_match
707
+ last_color = pre.last_color_code
708
+ "#{fix_colors(m['content'])}#{last_color}"
709
+ end.gsub(/<<(pre|post)\d+>>/, '')
710
+ end
711
+
712
+ def render_images(input)
713
+ input.gsub(%r{<<img>>(.*?)<</img>>}) do
714
+ link, title, alt_text = Regexp.last_match(1).split(/\|\|/)
715
+
716
+ if (exec_available('imgcat') || exec_available('chafa')) && @options[:local_images]
717
+ if exec_available('imgcat')
718
+ @log.info('Using imgcat for image rendering')
719
+ elsif exec_available('chafa')
720
+ @log.info('Using chafa for image rendering')
721
+ end
722
+ img_path = link
723
+ if img_path =~ /^http/ && @options[:remote_images]
724
+ if exec_available('imgcat')
725
+ @log.info('Using imgcat for image rendering')
726
+ begin
727
+ res, s = Open3.capture2(%(curl -sS "#{img_path}" 2> /dev/null | imgcat))
728
+
729
+ if s.success?
730
+ pre = !alt_text.nil? ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
731
+ post = !title.nil? ? "\n #{c(%i[b blue])}-- #{title} --" : ''
732
+ result = pre + res + post
733
+ end
734
+ rescue StandardError => e
735
+ @log.error(e)
736
+ end
737
+ elsif exec_available('chafa')
738
+ @log.info('Using chafa for image rendering')
739
+ term = '-f sixels'
740
+ term = ENV['TERMINAL_PROGRAM'] =~ /iterm/i ? '-f iterm' : term
741
+ term = ENV['TERMINAL_PROGRAM'] =~ /kitty/i ? '-f kitty' : term
742
+ FileUtils.rm_r '.mdless_tmp', force: true if File.directory?('.mdless_tmp')
743
+ Dir.mkdir('.mdless_tmp')
744
+ Dir.chdir('.mdless_tmp')
745
+ `curl -SsO #{img_path} 2> /dev/null`
746
+ tmp_img = File.basename(img_path)
747
+ img = `chafa #{term} "#{tmp_img}"`
748
+ pre = alt_text ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
749
+ post = title ? "\n #{c(%i[b blue])}-- #{tail} --" : ''
750
+ result = pre + img + post
751
+ Dir.chdir('..')
752
+ FileUtils.rm_r '.mdless_tmp', force: true
753
+ else
754
+ @log.warn('No viewer for remote images')
755
+ end
756
+ else
757
+ if img_path =~ %r{^[~/]}
758
+ img_path = File.expand_path(img_path)
759
+ elsif @file
760
+ base = File.expand_path(File.dirname(@file))
761
+ img_path = File.join(base, img_path)
762
+ end
763
+ if File.exist?(img_path)
764
+ pre = !alt_text.nil? ? " #{c(%i[d blue])}[#{alt_text.strip}]\n" : ''
765
+ post = !title.nil? ? "\n #{c(%i[b blue])}-- #{title} --" : ''
766
+ if exec_available('imgcat')
767
+ img = `imgcat "#{img_path}"`
768
+ elsif exec_available('chafa')
769
+ term = '-f sixels'
770
+ term = ENV['TERMINAL_PROGRAM'] =~ /iterm/i ? '-f iterm' : term
771
+ term = ENV['TERMINAL_PROGRAM'] =~ /kitty/i ? '-f kitty' : term
772
+ img = `chafa #{term} "#{img_path}"`
773
+ end
774
+ result = pre + img + post
775
+ end
776
+ end
777
+ end
778
+ if result.nil?
779
+ color_image_tag(link, title, alt_text)
780
+ else
781
+ "#{pre_element}#{result}#{xc}#{post_element}"
782
+ end
783
+ end
784
+ end
785
+
786
+ def fix_equations(input)
787
+ input.gsub(/((\\\\\[|\$\$)(.*?)(\\\\\]|\$\$)|(\\\\\(|\$)(.*?)(\\\\\)|\$))/) do
788
+ m = Regexp.last_match
789
+ if m[2]
790
+ brackets = [m[2], m[4]]
791
+ equat = m[3]
792
+ else
793
+ brackets = [m[5], m[7]]
794
+ equat = m[6]
795
+ end
796
+ [
797
+ pre_element,
798
+ color('math brackets'),
799
+ brackets[0],
800
+ xc,
801
+ color('math equation'),
802
+ equat,
803
+ color('math brackets'),
804
+ brackets[1],
805
+ xc,
806
+ post_element
807
+ ].join
808
+ end
809
+ end
810
+
725
811
  def postprocess(input)
812
+ input.scrub!
813
+
726
814
  if @options[:inline_footnotes]
727
815
  input = insert_footnotes(input)
728
816
  else
@@ -736,25 +824,15 @@ module Redcarpet
736
824
  # escaped characters
737
825
  input.gsub!(/\\(\S)/, '\1')
738
826
  # equations
739
- input.gsub!(/((\\\\\[|\$\$)(.*?)(\\\\\]|\$\$)|(\\\\\(|\$)(.*?)(\\\\\)|\$))/) do
740
- m = Regexp.last_match
741
- if m[2]
742
- brackets = [m[2], m[4]]
743
- equat = m[3]
744
- else
745
- brackets = [m[5], m[7]]
746
- equat = m[6]
747
- end
748
- "#{c(%i[b black])}#{brackets[0]}#{xc}#{c(%i[b blue])}#{equat}#{c(%i[b black])}#{brackets[1]}" + xc
749
- end
827
+ input = fix_equations(input)
750
828
  # misc html
751
- input.gsub!(%r{<br */?>}, "\n")
829
+ input.gsub!(%r{<br */?>}, "#{pre_element}\n#{post_element}")
752
830
  # format links
753
- if @options[:links] == :reference || @options[:links] == :paragraph
754
- input = reference_links(input)
755
- end
831
+ input = reference_links(input) if @options[:links] == :reference || @options[:links] == :paragraph
756
832
  # lists
757
- fix_lists(input, 0)
833
+ input = fix_lists(input, 0)
834
+ input = render_images(input) if @options[:local_images]
835
+ fix_colors(input)
758
836
  end
759
837
  end
760
838
  end
@@ -14,7 +14,7 @@ module CLIMarkdown
14
14
 
15
15
  def initialize(args)
16
16
  @log = Logger.new($stderr)
17
- @log.level = Logger::ERROR
17
+ @log.level = Logger::WARN
18
18
 
19
19
  @options = {}
20
20
  config = File.expand_path('~/.config/mdless/config.yml')
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ # String helpers
4
+ class ::String
5
+ def scrub
6
+ encode('utf-16', invalid: :replace).encode('utf-8')
7
+ end
8
+
9
+ def scrub!
10
+ replace scrub
11
+ end
12
+ end
data/lib/mdless/theme.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  module CLIMarkdown
2
2
  module Theme
3
-
4
3
  THEME_DEFAULTS = {
5
4
  'metadata' => {
6
5
  'border' => 'd blue on_black',
@@ -9,9 +8,12 @@ module CLIMarkdown
9
8
  },
10
9
  'emphasis' => {
11
10
  'bold' => 'b',
11
+ 'bold_character' => '**',
12
12
  'italic' => 'u i',
13
+ 'italic_character' => '_',
13
14
  'bold-italic' => 'b u i'
14
15
  },
16
+ 'highlight' => 'b black on_yellow',
15
17
  'h1' => {
16
18
  'color' => 'b intense_black on_white',
17
19
  'pad' => 'd black on_white',
@@ -58,7 +60,8 @@ module CLIMarkdown
58
60
  },
59
61
  'code_span' => {
60
62
  'marker' => 'b white',
61
- 'color' => 'b white on_intense_black'
63
+ 'color' => 'b white on_intense_black',
64
+ 'character' => '`'
62
65
  },
63
66
  'code_block' => {
64
67
  'marker' => 'intense_black',
@@ -69,6 +72,13 @@ module CLIMarkdown
69
72
  'eol' => 'intense_black on_black',
70
73
  'pygments_theme' => 'monokai'
71
74
  },
75
+ 'blockquote' => {
76
+ 'marker' => {
77
+ 'character' => '>',
78
+ 'color' => 'yellow'
79
+ },
80
+ 'color' => 'b white'
81
+ },
72
82
  'dd' => {
73
83
  'term' => 'black on_white',
74
84
  'marker' => 'd red',
@@ -88,6 +98,10 @@ module CLIMarkdown
88
98
  'brackets' => 'd yellow on_black',
89
99
  'color' => 'yellow on_black'
90
100
  },
101
+ 'math' => {
102
+ 'brackets' => 'b black',
103
+ 'equation' => 'b blue'
104
+ },
91
105
  'super' => 'b green',
92
106
  'text' => 'white'
93
107
  }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module CLIMarkdown
2
- VERSION = '2.0.8'
4
+ VERSION = '2.0.9'
3
5
  end
data/lib/mdless.rb CHANGED
@@ -8,6 +8,7 @@ require 'mdless/version.rb'
8
8
  require 'mdless/colors'
9
9
  require 'mdless/tables'
10
10
  require 'mdless/hash'
11
+ require 'mdless/string'
11
12
  require 'mdless/theme'
12
13
  require 'redcarpet'
13
14
  require 'mdless/console'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdless
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -82,6 +82,7 @@ files:
82
82
  - lib/mdless/console.rb
83
83
  - lib/mdless/converter.rb
84
84
  - lib/mdless/hash.rb
85
+ - lib/mdless/string.rb
85
86
  - lib/mdless/tables.rb
86
87
  - lib/mdless/theme.rb
87
88
  - lib/mdless/version.rb
@@ -112,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
113
  - !ruby/object:Gem::Version
113
114
  version: '0'
114
115
  requirements: []
115
- rubygems_version: 3.2.16
116
+ rubygems_version: 3.2.15
116
117
  signing_key:
117
118
  specification_version: 4
118
119
  summary: A pager like less, but for Markdown files