markdownr 0.6.17 → 0.7.0

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: 1a2282422f5341fe474b7b7e34af4387a7d6784b1945501f969ea3098e768377
4
- data.tar.gz: 45b589b50541dc8e88999cba5df250047a0a298d00bbc2b54bb5d7dd5868009d
3
+ metadata.gz: 19a2cd0d721b3dc1f53ae1d064b78e6f7ade715092bccb57cdd8b2b56c00152b
4
+ data.tar.gz: 96e0930a7215b8706ec1b59bd6c927c6e1612a15c40b7a94bc4f588d8e5364ff
5
5
  SHA512:
6
- metadata.gz: 56e7530f96dd2622ad883c0fdf9ee83d6731f8ce372476907a2ea7f22979e739e13f630f3ee0b121f39d3d3192f702ca27434de441ae59cd11f3515054f62c8d
7
- data.tar.gz: d0831ec05ccd0e1e57dfe07f57dd3ba6ccca5d7d958c7ddf72e578995dbd4ea9ce911eb7af8e6fac96553b32c76221369338e521fab88c67ac5839d8c2d932cb
6
+ metadata.gz: acd320649054e144b400a20f92e66dbb999ecea0a7f29b1fe33f1b1408bd9c70fae1c170cc2f5c9485e847e59ad7796172eda8da869d270bb87ff60e2cc178f5
7
+ data.tar.gz: 4fed410b97722c3e7239ef5c21288d34f8a6875ba9197b3bcc1483bd2a68211282946a0d8f154a048c46b8ac68060a835526045bce333bc8c795cd3bca094fff
data/bin/markdownr CHANGED
@@ -48,20 +48,14 @@ OptionParser.new do |opts|
48
48
  options[:verbose] = true
49
49
  end
50
50
 
51
- opts.on("--no-bible-citations", "Disable Bible verse citation auto-linking") do
51
+ opts.on("--plugin NAME", "Enable a plugin by name (can be specified multiple times)") do |name|
52
52
  options[:plugin_overrides] = (options[:plugin_overrides] || {}).merge(
53
- "bible_citations" => (options.dig(:plugin_overrides, "bible_citations") || {}).merge("enabled" => false)
53
+ name => (options.dig(:plugin_overrides, name) || {}).merge("enabled" => true)
54
54
  )
55
55
  end
56
56
 
57
- opts.on("--biblegateway", "Link Bible citations to BibleGateway instead of scrip.risensavior.com") do
58
- options[:plugin_overrides] = (options[:plugin_overrides] || {}).merge(
59
- "bible_citations" => (options.dig(:plugin_overrides, "bible_citations") || {}).merge("link_target" => "biblegateway")
60
- )
61
- end
62
-
63
- opts.on("--dictionary-url URL", "URL to dictionary.json for Strong's number popup resolution") do |u|
64
- options[:dictionary_url] = u
57
+ opts.on("--plugin-dir DIR", "Additional directory containing plugins (can be specified multiple times)") do |d|
58
+ (options[:plugin_dirs] ||= []) << d
65
59
  end
66
60
 
67
61
  opts.on("-v", "--version", "Show version") do
@@ -90,7 +84,7 @@ MarkdownServer::App.set :port, options[:port]
90
84
  MarkdownServer::App.set :bind, options[:bind]
91
85
  MarkdownServer::App.set :server_settings, { max_threads: options[:threads], min_threads: 1 }
92
86
  MarkdownServer::App.set :plugin_overrides, options[:plugin_overrides] || {}
93
- MarkdownServer::App.set :dictionary_url, options[:dictionary_url] if options[:dictionary_url]
87
+ MarkdownServer::App.set :plugin_dirs, options[:plugin_dirs] || []
94
88
 
95
89
  # Load .markdownr.yml popup settings
96
90
  config_path = File.join(dir, ".markdownr.yml")
@@ -103,8 +97,9 @@ if File.exist?(config_path)
103
97
  MarkdownServer::App.set :popup_external, popups.fetch("external", true)
104
98
  MarkdownServer::App.set :popup_external_domains, popups.fetch("external_domains", [])
105
99
  end
106
- if yaml && yaml["dictionary_url"]
107
- MarkdownServer::App.set :dictionary_url, yaml["dictionary_url"]
100
+ if yaml && yaml["plugin_dirs"].is_a?(Array)
101
+ existing = MarkdownServer::App.settings.plugin_dirs
102
+ MarkdownServer::App.set :plugin_dirs, (yaml["plugin_dirs"] + existing).uniq
108
103
  end
109
104
  end
110
105