ZMediumToMarkdown 1.7.0 → 1.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff9b27bae7ac1365701ccb1b3174a8b7a2d3b7b2fa12771d10665368636c1733
4
- data.tar.gz: 0f68f9aca2a902694898560c82b689bc10b0e45d6c2d181b279002fb263f74d4
3
+ metadata.gz: fa026cbea9d117e46a188297165e98602f40a32862699ff9cfb28da67002bfd1
4
+ data.tar.gz: 06a512791cef282c8fd5ccd1d587dc851e6223f5ca7f9659a846c0800aecc618
5
5
  SHA512:
6
- metadata.gz: a397b8860995b6fe0e7f4aea405c352d5ce05de20de0d9dc041001bc8af3c8509ac01387f5ea7ae5ecedc844ba41e70ade1ac6f6f58d4d9baca02cce0783c28d
7
- data.tar.gz: 532bcf53a46474d897bb27dcdfe3153dfd3103cc43de01a9588608776284ddb0f23f89e836797bf453469168c38ed041a1c63f1a607c0b16616bafd002df75f1
6
+ metadata.gz: 4bb69819a9591b7fa9056cbf12a97b26148e98a5e8e4d3a9155ff6e77f4416e5755326b83ac562d30a3b961b49db6501c9ce729687dec1d6e7d54ab0ccec3b10
7
+ data.tar.gz: 13479a388652bfa137c01a6d02300f30fe0b66402aca6b240b29a4d6bd653349b066b3e478420224ef07bb15eb9052a46a73e76d06d83bc494a6ef49ac8dc020
@@ -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, "Output")
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, "Output")
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[Medium 原文](#{postURL})"
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
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZMediumToMarkdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhgChgLi