mdless 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mdless/converter.rb +10 -2
- data/lib/mdless/theme.rb +7 -0
- data/lib/mdless/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b79330028da2d98251af174cfb9f0ae60294efa6e24de4cff88d245c351340f3
|
|
4
|
+
data.tar.gz: 22c669286e9486f739badc7e74819e1989fb00fc1f415c9e3fd371e60b1a6026
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 719d4170904c7fd9bc21e5cc4f19ca1a9f5a197d891e211bb29bfd1eecb94cf7d1b9af22943dc253bae4a2ffa0baa91233aae84005752bc5b5f1660ff539dcfa
|
|
7
|
+
data.tar.gz: e69bbfb47daf84166fe3cf930601a5fbbaedbd57453c9361547c3b1c6c9cdfb170b4c4a641793a497f23547a3781097e47100a3a8272a8820f4faeb6d4f4de8a
|
data/lib/mdless/converter.rb
CHANGED
|
@@ -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
|
|
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
|
data/lib/mdless/version.rb
CHANGED