mdless 1.0.6 → 1.0.7

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: 838d2a736014669c73bd615bffdb9336fed0cfb761a2999cd1a00edb429b7178
4
- data.tar.gz: 581e295c6e40b55ad424a4211e5475428ed492247f2ddb63015ba1060011a8a6
3
+ metadata.gz: b79330028da2d98251af174cfb9f0ae60294efa6e24de4cff88d245c351340f3
4
+ data.tar.gz: 22c669286e9486f739badc7e74819e1989fb00fc1f415c9e3fd371e60b1a6026
5
5
  SHA512:
6
- metadata.gz: 3c5c4260f4912d22d0c5c053d30d81222b5865a481f7985439041696a4174c87f018e272bf094910325e1ce533f22ed8b0f250ea2894aadcfbe4799d55e80909
7
- data.tar.gz: 234cee6e1ab695ff44c5202d0afb6a770166946bb6019e1f26caf770caefc9ffe4c979276e77f89a152ae9cef0a335668e60db9c9f127e6313ccdeb6ed144aaf
6
+ metadata.gz: 719d4170904c7fd9bc21e5cc4f19ca1a9f5a197d891e211bb29bfd1eecb94cf7d1b9af22943dc253bae4a2ffa0baa91233aae84005752bc5b5f1660ff539dcfa
7
+ data.tar.gz: e69bbfb47daf84166fe3cf930601a5fbbaedbd57453c9361547c3b1c6c9cdfb170b4c4a641793a497f23547a3781097e47100a3a8272a8820f4faeb6d4f4de8a
@@ -41,7 +41,7 @@ module CLIMarkdown
41
41
 
42
42
  @options[:local_images] = false
43
43
  @options[:remote_images] = false
44
- opts.on('-i', '--images=TYPE', 'Include [local|remote (both)] images in output (requires imgcat and iTerm2, default NONE)' ) do |type|
44
+ opts.on('-i', '--images=TYPE', 'Include [local|remote (both)] images in output (requires imgcat and iTerm2, default NONE). Does not work with pagers, use with -P' ) do |type|
45
45
  unless exec_available('imgcat')# && ENV['TERM_PROGRAM'] == 'iTerm.app'
46
46
  @log.warn('images turned on but imgcat not found')
47
47
  else
@@ -817,6 +817,14 @@ module CLIMarkdown
817
817
  ansi = color('h6 color')
818
818
  end
819
819
 
820
+ # If we're in iTerm and not paginating, add
821
+ # iTerm Marks for navigation on h1-3
822
+ if h[0].length < 4 &&
823
+ ENV['TERM_PROGRAM'] =~ /^iterm/i &&
824
+ @options[:pager] == false
825
+ ansi = "\e]1337;SetMark\a" + ansi
826
+ end
827
+
820
828
  "\n#{xc}#{ansi}#{h[1]} #{pad}#{xc}\n"
821
829
  end
822
830
  }
@@ -941,7 +949,7 @@ module CLIMarkdown
941
949
 
942
950
  out = cleanup_tables(out)
943
951
  out = clean_markers(out)
944
- out = out.gsub(/\n+{2,}/m,"\n\n") + "\n#{xc}\n\n"
952
+ out = out.gsub(/\n+{2,}/m,"\n\n") + "\n#{xc}\n"
945
953
 
946
954
  unless @options[:color]
947
955
  out.uncolor!
data/lib/mdless/theme.rb CHANGED
@@ -100,6 +100,13 @@ module CLIMarkdown
100
100
  rescue
101
101
  @log.warn('Error merging user theme')
102
102
  theme = THEME_DEFAULTS
103
+ if File.basename(theme_file) =~ /mdless\.theme/
104
+ FileUtils.rm(theme_file)
105
+ @log.info("Rewriting default theme file to #{theme_file}")
106
+ File.open(theme_file,'w') {|f|
107
+ f.puts theme.to_yaml
108
+ }
109
+ end
103
110
  end
104
111
  theme
105
112
  end
@@ -1,3 +1,3 @@
1
1
  module CLIMarkdown
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
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: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra