RGJ
(Richard - Communiteq)
2020 年 9 月 9 日午後 7:31
1
The Reftagger library allows you to convert bible references on your Discourse forum into links with a hover-preview.
By request of @outofthebox we made a theme component based on this code .
I’ve added a setting that allows you to select the translation you want to use, and the component extends the content security policy to allow for the reftagger library to be included.
Repository here .
「いいね!」 13
@RGJ , our community loves this feature. Thank you for developing in a secure and customizable manner. I appreciate your generosity in sharing this work back to the Discourse community.
「いいね!」 5
We’ve been using that for the last 18 months or so, and it’s worked like a charm. Happy to see it improved and made more easily available!
「いいね!」 3
jrgong
(jrgong)
2020 年 9 月 10 日午前 7:28
4
Wow, that’s super cool.
I would love to see a similar component in which custom keywords and previews can be defined.
That would be super useful to create a glossary for example
「いいね!」 1
RGJ
(Richard - Communiteq)
2020 年 9 月 10 日午前 8:04
5
There is the auto abbrify words theme component which does such a thing.
「いいね!」 3
I really appreciate you and everyone who contributed to the original conversation on Meta about how to make this feature work!
「いいね!」 2
Hello everyone, Reftagger was working swimmingly for a few months, and then it just stopped. It will still automatically generate an external link for the book/chapter/verse format, but it will not load the hover preview.
It appears to be up to date too. Any ideas?
「いいね!」 1
RGJ
(Richard - Communiteq)
2021 年 8 月 29 日午前 8:58
8
What Discourse version are you running?
「いいね!」 1
How can I find this info?
RGJ
(Richard - Communiteq)
2021 年 8 月 29 日午前 9:29
10
It should be somewhere in the admin dashboard at /admin
It just says that it is up to date:
「いいね!」 1
Seems to be working fine on Discourse 2.7.7 (at least in Safari) for me.
RGJ
(Richard - Communiteq)
2021 年 8 月 29 日午後 9:08
13
It’s working again now.
Reftagger apparently switched to a different CDN (reftagger.bibliacdn.com) which had to be whitelisted in the content security policy. I have added it and pushed a new version of the theme component. All you need to do is update the component.
「いいね!」 3
There it is, thank you sir
「いいね!」 1
BrianC
(Brian)
2025 年 7 月 29 日午後 7:12
15
リチャード様
古いスレッドを再確認しています。このテーマコンポーネントをインストールしたところ、2つの問題が発生しています。
1つ目は、コンポーネントのアップデートが必要であるというメッセージです。
[管理者通知] テーマ ‘Reftagger’ には、アップデートが必要なコードが含まれています。(id:discourse.script-tag-discourse-plugin) (詳細はこちら )
2つ目は、コンポーネントのアップデートが必要であるという最初の通知に関連している可能性があります。参照がタグ付けされておらず、ブラウザのタブでローディングサークルが表示されてページがハングしているようです。
このコンポーネントをアップデートしていただけますでしょうか?
BrianC
(Brian)
2025 年 7 月 30 日午後 11:42
16
ChatGPT を使用して、Logos RefTagger と Blue Letter Bible の両方の作業用 reftagger を作成することができました。
これらをコミュニティで使用できるテーマコンポーネントにバンドルできれば素晴らしいですが、そうでない場合は、テーマコンポーネントは単に作成するだけです。お好みのどちらかのコードを取得し、新しいテーマコンポーネントの JS タブに配置するだけです。Discourse の JS タブにあるデフォルトのコードを削除する必要があります。
改善点についてフィードバックがあれば歓迎します。私のスキルは LLM をガイドする程度です。
Logos RefTagger を使用:
import { apiInitializer } from "discourse/lib/api";
import loadScript from "discourse/lib/load-script";
export default apiInitializer("0.1", (api) => {
// 1. スクリプトをロードする前に window で RefTagger 設定を定義します
window.refTagger = {
settings: {
bibleVersion: "ESV", // 例: デフォルトの聖書バージョン
tagChapters: true, // 章の参照もタグ付けする
convertHyperlinks: false, // 既存のリンクを再タグ付けしない
roundCorners: true,
socialSharing: [],
}
};
// 2. Discourse の投稿レンダリングにフックします:
api.decorateCooked((element) => {
// 外部 RefTagger スクリプトをロードします (まだロードされていない場合)
loadScript("https://api.reftagger.com/v2/RefTagger.js").then(() => {
// 新しいコンテンツ要素でタグ付けを実行します
window.refTagger.tag(element);
});
});
});
BLB ScriptTagger を使用:
import { apiInitializer } from "discourse/lib/api";
import loadScript from "discourse/lib/load-script";
export default apiInitializer("0.1", (api) => {
// オプションで、ロード前に BLB ScriptTagger 設定を設定します (デフォルト値が表示されています)
window.BLB ||= {}; // グローバル BLB オブジェクトが存在することを確認します
window.BLB.Tagger ||= {};
window.BLB.Tagger.Translation = "NKJV"; // デフォルトの翻訳バージョン
window.BLB.Tagger.HyperLinks = "all"; // リンクされた参照もタグ付けする
window.BLB.Tagger.TargetNewWindow = true; // リンクは新しいタブで開きます
// ... (必要に応じて DarkTheme などの他の設定)
api.decorateCooked((elem) => {
loadScript("https://www.blueletterbible.org/assets/scripts/blbToolTip/BLB_ScriptTagger-min.js")
.then(() => {
if (window.BLB && window.BLB.Tagger) {
window.BLB.Tagger.pageInit(); // 新しいコンテンツで聖句を再スキャンします:contentReference
}
});
});
});
RGJ
(Richard - Communiteq)
2025 年 10 月 2 日午前 11:19
17
これは現在解決済みです。
これは、上記の問題を解決する前でさえ(これは単なる警告であり、エラーではありませんでした)、再現できません。
「いいね!」 3