mdless 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/mdless/converter.rb +3 -7
- data/lib/mdless/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4bb4133ae1d8d4e3607f02a75c8ef92edb6ca92
|
4
|
+
data.tar.gz: 3104daadc69c2dd78978247eb3bee0d607884a9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd92f5704dedca5c71a0571bcf34080cc0c122c888a4b3e65f20ae13bc353428a85a688ec07915ce699609cb6e6fec79fcb93b8c1d893cef388e2e4482febc71
|
7
|
+
data.tar.gz: 705a61c4a88dee79316c5cc61bb24a99ccfaed0c31d367092f4098768f96a1d2c6bdadbb4f022b8fdfbdf6450ede5833ff26458c1970f182afa128f431a293ef
|
data/README.md
CHANGED
@@ -42,7 +42,7 @@ The pager used is determined by system configuration in this order of preference
|
|
42
42
|
|
43
43
|
-s, --section=TITLE Output only a headline-based section of
|
44
44
|
the input
|
45
|
-
-w, --width=COLUMNS Column width to format for (default
|
45
|
+
-w, --width=COLUMNS Column width to format for (default terminal width)
|
46
46
|
-p, --[no-]pager Formatted output to pager (default on)
|
47
47
|
-P Disable pager (same as --no-pager)
|
48
48
|
-c, --[no-]color Colorize output (default on)
|
data/lib/mdless/converter.rb
CHANGED
@@ -21,12 +21,9 @@ module CLIMarkdown
|
|
21
21
|
@options[:section] = section
|
22
22
|
end
|
23
23
|
|
24
|
-
@options[:width] =
|
25
|
-
opts.on( '-w', '--width=COLUMNS', 'Column width to format for (default
|
24
|
+
@options[:width] = %x{tput cols}.strip.to_i
|
25
|
+
opts.on( '-w', '--width=COLUMNS', 'Column width to format for (default terminal width)' ) do |columns|
|
26
26
|
@options[:width] = columns.to_i
|
27
|
-
if @options[:width] = 0
|
28
|
-
@options[:width] = %x{tput cols}.strip.to_i
|
29
|
-
end
|
30
27
|
end
|
31
28
|
|
32
29
|
@options[:pager] = true
|
@@ -96,7 +93,7 @@ module CLIMarkdown
|
|
96
93
|
|
97
94
|
optparse.parse!
|
98
95
|
|
99
|
-
@cols = @options[:width]
|
96
|
+
@cols = @options[:width]
|
100
97
|
@output = ''
|
101
98
|
|
102
99
|
input = ''
|
@@ -393,7 +390,6 @@ module CLIMarkdown
|
|
393
390
|
"#" * (match[1].length - h_adjust)
|
394
391
|
end
|
395
392
|
|
396
|
-
# TODO: Probably easiest to just collect these with line indexes, remove until other highlighting is finished
|
397
393
|
input.gsub!(/(?i-m)([`~]{3,})([\s\S]*?)\n([\s\S]*?)\1/ ) do |cb|
|
398
394
|
m = Regexp.last_match
|
399
395
|
leader = m[2] ? m[2].upcase + ":" : 'CODE:'
|
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: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|