mdless 2.1.28 → 2.1.29
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/CHANGELOG.md +5 -0
- data/bin/mdless +1 -1
- data/lib/mdless/converter.rb +11 -10
- data/lib/mdless/string.rb +1 -1
- data/lib/mdless/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e5c2be4377b1bad77f8c7f3e0ab932a16ca9339332c91e3bc5f0b7db8c71df2
|
4
|
+
data.tar.gz: f540f256c1117dab4a9ef0e758f940d3f79a848abe2f15f5b2866e5f2e052656
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b52a6501909c93927e508419298a767aeb759c661b45c877feb33b72caa9f512146ab5fc67a41530666328e5e37ebc53bf25979b0340ee50666433e85f2df920
|
7
|
+
data.tar.gz: da7f8a1949c56474461847ca9b66fccc1dea888552976b2e00b3dea12a250ba3c28cc70bf2496a1293171c4c17300779f68c228ff24ddf9068ff08046492db6e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
2.1.26
|
2
2
|
|
3
|
+
2.1.29
|
4
|
+
: More code cleanup, help output improvements
|
5
|
+
: Line breaks in help output
|
6
|
+
: This release should fix an error on Ruby 2.7 in string.rb
|
7
|
+
|
3
8
|
2.1.28
|
4
9
|
: Default to 0 width, which makes the width the column width of the terminal
|
5
10
|
: Don't save a --width setting to config, require that to be manually updated if desired
|
data/bin/mdless
CHANGED
data/lib/mdless/converter.rb
CHANGED
@@ -45,7 +45,8 @@ module CLIMarkdown
|
|
45
45
|
default(:local_images, false)
|
46
46
|
default(:remote_images, false)
|
47
47
|
opts.on('-i', '--images=TYPE',
|
48
|
-
'Include [local|remote (both)|none] images in output
|
48
|
+
'Include [local|remote (both)|none] images in output'\
|
49
|
+
' (requires chafa or imgcat, default none).') do |type|
|
49
50
|
if exec_available('imgcat') || exec_available('chafa')
|
50
51
|
case type
|
51
52
|
when /^(r|b|a)/i
|
@@ -62,7 +63,8 @@ module CLIMarkdown
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
65
|
-
opts.on('-I', '--all-images', 'Include local and remote images in output
|
66
|
+
opts.on('-I', '--all-images', 'Include local and remote images in output'\
|
67
|
+
' (requires imgcat or chafa)') do
|
66
68
|
if exec_available('imgcat') || exec_available('chafa') # && ENV['TERM_PROGRAM'] == 'iTerm.app'
|
67
69
|
MDLess.options[:local_images] = true
|
68
70
|
MDLess.options[:remote_images] = true
|
@@ -124,9 +126,7 @@ module CLIMarkdown
|
|
124
126
|
end
|
125
127
|
|
126
128
|
MDLess.cols = MDLess.options[:width]
|
127
|
-
if MDLess.cols
|
128
|
-
MDLess.cols = TTY::Screen.cols - 2
|
129
|
-
end
|
129
|
+
MDLess.cols = TTY::Screen.cols - 2 if MDLess.cols.zero?
|
130
130
|
|
131
131
|
default(:autolink, true)
|
132
132
|
opts.on('--[no-]autolink', 'Convert bare URLs and emails to <links>') do |p|
|
@@ -145,8 +145,9 @@ module CLIMarkdown
|
|
145
145
|
Process.exit 0
|
146
146
|
end
|
147
147
|
|
148
|
-
opts.on('--edit-theme',
|
149
|
-
|
148
|
+
opts.on('--edit-theme', 'Open the default/specified theme in ' \
|
149
|
+
"#{File.basename(ENV['EDITOR']) || 'default editor'}, "\
|
150
|
+
'populating a new theme if needed. Use after --theme in the command.') do
|
150
151
|
raise 'No $EDITOR defined' unless ENV['EDITOR']
|
151
152
|
|
152
153
|
theme = MDLess.options[:theme] =~ /default/ ? 'mdless' : MDLess.options[:theme]
|
@@ -157,7 +158,7 @@ module CLIMarkdown
|
|
157
158
|
end
|
158
159
|
|
159
160
|
default(:inline_footnotes, false)
|
160
|
-
opts.on('--[no-]
|
161
|
+
opts.on('--[no-]inline-footnotes',
|
161
162
|
'Display footnotes immediately after the paragraph that references them') do |p|
|
162
163
|
MDLess.options[:inline_footnotes] = p
|
163
164
|
end
|
@@ -174,8 +175,8 @@ module CLIMarkdown
|
|
174
175
|
|
175
176
|
default(:links, :inline)
|
176
177
|
opts.on('--links=FORMAT',
|
177
|
-
'Link style ([inline, reference, paragraph],
|
178
|
-
"paragraph" will position reference links after each paragraph)') do |fmt|
|
178
|
+
'Link style ([*inline, reference, paragraph],'\
|
179
|
+
' "paragraph" will position reference links after each paragraph)') do |fmt|
|
179
180
|
MDLess.options[:links] = case fmt
|
180
181
|
when /^:?r/i
|
181
182
|
:reference
|
data/lib/mdless/string.rb
CHANGED
@@ -67,7 +67,7 @@ class ::String
|
|
67
67
|
input.sub!(/(?i-m)^---[ \t]*\n(?<content>[\s\S]*?)\n[-.]{3}[ \t]*\n/m) do
|
68
68
|
m = Regexp.last_match
|
69
69
|
MDLess.log.info('Processing YAML Header')
|
70
|
-
|
70
|
+
YAML.load(m['content']).map { |k, v| MDLess.meta[k.downcase] = v }
|
71
71
|
lines = m['content'].split(/\n/)
|
72
72
|
longest = lines.inject { |memo, word| memo.length > word.length ? memo : word }.length
|
73
73
|
longest = longest < @cols ? longest + 1 : @cols
|
data/lib/mdless/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mdless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redcarpet
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
161
|
+
rubygems_version: 3.4.0.dev
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: A pager like less, but for Markdown files
|