ZMediumToMarkdown 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ZMediumToMarkdown +4 -4
- data/lib/Helper.rb +12 -2
- data/lib/ZMediumFetcher.rb +0 -4
- 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: fa026cbea9d117e46a188297165e98602f40a32862699ff9cfb28da67002bfd1
|
4
|
+
data.tar.gz: 06a512791cef282c8fd5ccd1d587dc851e6223f5ca7f9659a846c0800aecc618
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bb69819a9591b7fa9056cbf12a97b26148e98a5e8e4d3a9155ff6e77f4416e5755326b83ac562d30a3b961b49db6501c9ce729687dec1d6e7d54ab0ccec3b10
|
7
|
+
data.tar.gz: 13479a388652bfa137c01a6d02300f30fe0b66402aca6b240b29a4d6bd653349b066b3e478420224ef07bb15eb9052a46a73e76d06d83bc494a6ef49ac8dc020
|
data/bin/ZMediumToMarkdown
CHANGED
@@ -19,21 +19,21 @@ class Main
|
|
19
19
|
opts.banner = "Usage: ZMediumFetcher [options]"
|
20
20
|
|
21
21
|
opts.on('-uUSERNAME', '--username=USERNAME', 'Downloading all posts from user') do |username|
|
22
|
-
outputFilePath = PathPolicy.new(filePath, "
|
22
|
+
outputFilePath = PathPolicy.new(filePath, "Output")
|
23
23
|
fetcher.downloadPostsByUsername(username, outputFilePath)
|
24
24
|
|
25
25
|
Helper.printNewVersionMessageIfExists()
|
26
26
|
end
|
27
27
|
|
28
28
|
opts.on('-pPOST_URL', '--postURL=POST_URL', 'Downloading single post') do |postURL|
|
29
|
-
outputFilePath = PathPolicy.new(filePath, "
|
29
|
+
outputFilePath = PathPolicy.new(filePath, "Output")
|
30
30
|
fetcher.downloadPost(postURL, outputFilePath)
|
31
31
|
|
32
32
|
Helper.printNewVersionMessageIfExists()
|
33
33
|
end
|
34
34
|
|
35
35
|
opts.on('-jUSERNAME', '--jekyllUsername=USERNAME', 'Downloading all posts from user with Jekyll friendly') do |username|
|
36
|
-
outputFilePath = PathPolicy.new(filePath, "
|
36
|
+
outputFilePath = PathPolicy.new(filePath, "/")
|
37
37
|
fetcher.isForJekyll = true
|
38
38
|
fetcher.downloadPostsByUsername(username, outputFilePath)
|
39
39
|
|
@@ -41,7 +41,7 @@ class Main
|
|
41
41
|
end
|
42
42
|
|
43
43
|
opts.on('-kpPOST_URL', '--jekyllPostURL=POST_URL', 'Downloading single post with Jekyll friendly') do |postURL|
|
44
|
-
outputFilePath = PathPolicy.new(filePath, "
|
44
|
+
outputFilePath = PathPolicy.new(filePath, "/")
|
45
45
|
fetcher.isForJekyll = true
|
46
46
|
fetcher.downloadPost(postURL, outputFilePath)
|
47
47
|
|
data/lib/Helper.rb
CHANGED
@@ -159,7 +159,17 @@ class Helper
|
|
159
159
|
end
|
160
160
|
|
161
161
|
|
162
|
-
def self.createWatermark(postURL)
|
163
|
-
text = "\r\n
|
162
|
+
def self.createWatermark(postURL)
|
163
|
+
text = "\r\n\r\n\r\n"
|
164
|
+
text += "+-----------------------------------------------------------------------------------+"
|
165
|
+
text += "\r\n"
|
166
|
+
text += "\r\n"
|
167
|
+
text += "| **[View original post on Medium](#{postURL}) - Converted by [ZhgChgLi](https://zhgchg.li)/[ZMediumToMarkdown](https://github.com/ZhgChgLi/ZMediumToMarkdown)** |"
|
168
|
+
text += "\r\n"
|
169
|
+
text += "\r\n"
|
170
|
+
text += "+-----------------------------------------------------------------------------------+"
|
171
|
+
text += "\r\n"
|
172
|
+
|
173
|
+
text
|
164
174
|
end
|
165
175
|
end
|
data/lib/ZMediumFetcher.rb
CHANGED
@@ -253,10 +253,6 @@ class ZMediumFetcher
|
|
253
253
|
if !linkParser.nil?
|
254
254
|
result = linkParser.parse(result, paragraph.markupLinks)
|
255
255
|
end
|
256
|
-
|
257
|
-
if paragraph.orgText == "延伸閱讀" or result.include? "Like Z Realm" or paragraph.orgText == "有任何問題及指教歡迎與我聯絡。"
|
258
|
-
break
|
259
|
-
end
|
260
256
|
|
261
257
|
file.puts(result)
|
262
258
|
|