markdownr 0.6.12 → 0.6.14
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e1a7ba09af27621d312b09f8fbf2d590664c9265762e40705487e8efdc88851b
|
|
4
|
+
data.tar.gz: 70e8227e25b38fbf729c0d1d84a7e48a1f874a4306cfb26c13e1e897f8137da4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 933b70b7b1b9187e84f4e0a5f80a74be842d874476c1119d47571a629d98be0a81b6888a9b32e74df4a5e9ef976b79dbe196b6d0e94659498949ca990afb1289
|
|
7
|
+
data.tar.gz: 2e33af70f39e9dbbb29e6a38fdcb7b4bacb8838511b640ada29048ba4bcdd02d424c11f19d717e68eb42ded4c24e543c7db94ab246680274ecee2b75af00b486
|
data/lib/markdown_server/app.rb
CHANGED
|
@@ -730,11 +730,21 @@ module MarkdownServer
|
|
|
730
730
|
audio_btn = if data_pronunc.length > 10
|
|
731
731
|
au = "#{base}/lang/lexicon/lexPronouncePlayer.cfm?skin=#{data_pronunc}"
|
|
732
732
|
%(<button onclick="var a=this._a||(this._a=new Audio('#{h(au)}'));a.currentTime=0;a.play();" ) +
|
|
733
|
-
%(style="background:none;border:none;cursor:pointer;padding:0 0 0 4px;font-size:1.1em;vertical-align:middle;" title="Play pronunciation">🔊</button>)
|
|
733
|
+
%(style="background:none;border:none;cursor:pointer;padding:0 0 0 4px;font-size:1.1em;vertical-align:middle;" title="Play pronunciation (Blue Letter Bible)">🔊</button>)
|
|
734
734
|
else
|
|
735
735
|
""
|
|
736
736
|
end
|
|
737
737
|
|
|
738
|
+
# StudyLight pronunciation button — extract Strong's number from URL
|
|
739
|
+
sl_match = url.to_s.match(%r{/lexicon/([hg])(\d+)/}i)
|
|
740
|
+
if sl_match
|
|
741
|
+
sl_lang = sl_match[1].downcase == "h" ? "hebrew" : "greek"
|
|
742
|
+
sl_num = sl_match[2]
|
|
743
|
+
sl_url = "https://www.studylight.org/multi-media/audio/lexicons/eng/#{sl_lang}.html?n=#{sl_num}"
|
|
744
|
+
audio_btn += %(<button onclick="var a=this._a||(this._a=new Audio('#{h(sl_url)}'));a.currentTime=0;a.play();" ) +
|
|
745
|
+
%(style="background:none;border:none;cursor:pointer;padding:0 0 0 4px;font-size:1.1em;vertical-align:middle;" title="Play pronunciation (StudyLight)">🔊</button>)
|
|
746
|
+
end
|
|
747
|
+
|
|
738
748
|
# ── Part of speech ────────────────────────────────────────────────────
|
|
739
749
|
pos = html[/<div[^>]+id="lexPart".*?small-text-right"[^>]*>(.*?)<\/div>/im, 1]
|
|
740
750
|
&.gsub(/<[^>]+>/, "")&.strip || ""
|
|
@@ -874,16 +884,25 @@ module MarkdownServer
|
|
|
874
884
|
.subst-t, .subst-o, .subst-x, .subst-s { display: none; }
|
|
875
885
|
.subst-r { display: inline; color: #7c3aed; font-style: italic; }
|
|
876
886
|
.section-heading { font-size: 1rem; font-weight: bold; margin: 1.5rem 0 0.25rem; color: #444; }
|
|
887
|
+
.verse-block { margin: 0.5rem 0; text-indent: 1.5em; }
|
|
888
|
+
.verse-block.chapter-opening { margin-top: 0; text-indent: 0; }
|
|
889
|
+
.verse-block.no-first-indent { text-indent: 0; }
|
|
877
890
|
.verse-number { font-size: 0.65em; font-weight: bold; color: #888; vertical-align: super; margin-right: 0.1em; line-height: 0; }
|
|
878
891
|
.chapter-number { font-size: 1.5em; font-weight: bold; vertical-align: 0.1em; margin-right: 0.15em; }
|
|
879
|
-
.
|
|
892
|
+
.divine-name { font-variant: small-caps; }
|
|
893
|
+
.footnotes, .crossrefs { border-top: 1px solid #ddd; margin-top: 2rem; padding-top: 0.75rem; font-size: 0.85rem; color: #555; }
|
|
880
894
|
.footnotes ol { padding-left: 1.5rem; margin: 0.5rem 0 0; list-style-type: lower-alpha; }
|
|
895
|
+
.crossrefs ol { padding-left: 2.5rem; margin: 0.5rem 0 0; }
|
|
896
|
+
.footnote-marker, .crossref-marker { cursor: pointer; font-size: 0.75em; line-height: 0; vertical-align: super; text-decoration: none; }
|
|
897
|
+
.footnote-marker { color: #2563eb; }
|
|
898
|
+
.crossref-marker { color: #16a34a; }
|
|
881
899
|
.words-of-jesus { color: #8b0000; }
|
|
882
900
|
.poetry-stanza { margin: 0 0 0 3rem; }
|
|
883
901
|
.poetry-stanza.stanza-break { margin-top: 0.75rem; }
|
|
884
902
|
.poetry-line { margin: 0; padding: 0; line-height: 1.5; }
|
|
885
903
|
.poetry-line.indent-1 { padding-left: 2em; }
|
|
886
904
|
.poetry-line.indent-2 { padding-left: 4em; }
|
|
905
|
+
.verse-selected { background: #e5eefb; border-radius: 2px; }
|
|
887
906
|
.subst-tip { display: none; }
|
|
888
907
|
</style>
|
|
889
908
|
CSS
|
|
@@ -942,13 +961,23 @@ module MarkdownServer
|
|
|
942
961
|
return html unless strongs.match?(/\A[GH]\d+\z/i) && %w[hebrew greek].include?(lang)
|
|
943
962
|
|
|
944
963
|
icon = %(<button class="pronunciation-btn" data-strongs="#{h(strongs.upcase)}" ) +
|
|
945
|
-
%(title="Play pronunciation" ) +
|
|
964
|
+
%(title="Play pronunciation (Blue Letter Bible)" ) +
|
|
946
965
|
%(style="background:none;border:none;cursor:pointer;padding:0 0 0 6px;font-size:1.1em;vertical-align:middle;line-height:1;color:#888;" ) +
|
|
947
966
|
%(onclick="(function(btn){if(btn._loading)return;var a=btn._audio;if(a){a.currentTime=0;a.play();return;}btn._loading=true;btn.style.opacity='0.4';\
|
|
948
967
|
fetch('/pronunciation?strongs='+btn.dataset.strongs).then(function(r){return r.json()}).then(function(d){\
|
|
949
968
|
if(d.audio){a=new Audio(d.audio);btn._audio=a;a.play();}btn._loading=false;btn.style.opacity='1';}).catch(function(){\
|
|
950
969
|
btn._loading=false;btn.style.opacity='1';});})(this)">🔊</button>)
|
|
951
970
|
|
|
971
|
+
sl_lang = lang == "hebrew" ? "hebrew" : "greek"
|
|
972
|
+
sl_num = strongs.upcase.sub(/\A[HG]/, "")
|
|
973
|
+
sl_url = "https://www.studylight.org/multi-media/audio/lexicons/eng/#{sl_lang}.html?n=#{sl_num}"
|
|
974
|
+
icon2 = %(<button class="pronunciation-btn" ) +
|
|
975
|
+
%(title="Play pronunciation (StudyLight)" ) +
|
|
976
|
+
%(style="background:none;border:none;cursor:pointer;padding:0 0 0 4px;font-size:1.1em;vertical-align:middle;line-height:1;color:#888;" ) +
|
|
977
|
+
%(onclick="var a=this._a||(this._a=new Audio('#{h(sl_url)}'));a.currentTime=0;a.play();">🔊</button>)
|
|
978
|
+
|
|
979
|
+
icon = icon + icon2
|
|
980
|
+
|
|
952
981
|
# Insert before the closing tag of the first <h2>
|
|
953
982
|
html.sub(%r{</h2>}) { " #{icon}</h2>" }
|
|
954
983
|
end
|
|
@@ -100,7 +100,7 @@ module MarkdownServer
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
encode = ->(s) { URI.encode_www_form_component(s).gsub("+", "%20") }
|
|
103
|
-
url = "https://scrip.risensavior.com/browse
|
|
103
|
+
url = "https://scrip.risensavior.com/browse/#{encode[version]}/#{encode[canonical]}/#{chapter}.html"
|
|
104
104
|
url += "#v#{start_verse}" if start_verse
|
|
105
105
|
url
|
|
106
106
|
end
|