User talk:Desu: Difference between revisions

Line 19: Line 19:
Good day, Neko Knight, and thank you for reaching out. My user talk page is a suitable place to reach out to me for issues such as these, and I'm glad I can assist you. I have went ahead and enabled '''$wgAllowUserCss''', feel free to let me know if you need any further assistance and thank you for taking the time to translate your request, too! --[[User:Desu|Desu]] ([[User talk:Desu|talk]]) 19:12, 7 January 2025 (UTC)
Good day, Neko Knight, and thank you for reaching out. My user talk page is a suitable place to reach out to me for issues such as these, and I'm glad I can assist you. I have went ahead and enabled '''$wgAllowUserCss''', feel free to let me know if you need any further assistance and thank you for taking the time to translate your request, too! --[[User:Desu|Desu]] ([[User talk:Desu|talk]]) 19:12, 7 January 2025 (UTC)
::I confirm that the user CSS is now enabled. Appreciate your quick work! Thanks! --[[User:Neko Knight|Neko Knight]] ([[User talk:Neko Knight|talk]]) 11:56, 8 January 2025 (UTC)
::I confirm that the user CSS is now enabled. Appreciate your quick work! Thanks! --[[User:Neko Knight|Neko Knight]] ([[User talk:Neko Knight|talk]]) 11:56, 8 January 2025 (UTC)
== Semantic Mediawikiの拡張機能であるSemantic Scribuntoを導入できますか? ==
Semantic Scribunto : https://github.com/SemanticMediaWiki/SemanticScribunto<br />
'''PHP''' : 7.3 or later<br />
'''MediaWiki''' : 1.39 or later<br />
'''Semantic MediaWiki''' : 4.0.2 or later<br />
※一応ローカル環境で動作は確認しました。MediaWiki 1.43.1/SMW 5.0.1/Semantic Scribunto 2.3.2<br />
この拡張機能はluaモジュール内でsmwの追加パーサー関数のaskなどが使えるようになる機能です。
先日、アイテムのページでクラフトの材料に含まれる一覧をInline queriesで一覧を作成したら、除外したい情報を取得してしまいました。<br />
また、[[Elin:切り身|切り身]]の分類が「魚」でありながら、加工設備に使用できないなどの細かい設定もありました。<br />
これらをSMWのみの機能では実装することができませんでした。
Semantic Scribuntoを導入できない場合は、moduleにテーブル変数化したcard data(things)を入れて、<br />
クラフトデータを取得して表示するという方法もあるので、Ylvapediaのバージョン環境に不都合があれば諦めます。
機械翻訳で解釈違いがおきそうなので、日本語のままにしています。すみません...<br />
導入の検討よろしくおねがいします! --[[User:Neko Knight|Neko Knight]] ([[User talk:Neko Knight|talk]]) 14:43, 15 April 2025 (UTC)
.<br />↓テストコード↓
{{Collapse top|lang=EN}}
前提条件<br />
#[[Module:CraftingTable]]で[[Property:IngredientAll]]に材料を入れていること
<syntaxhighlight lang="lua">localp = {}
function p.ask(frame)
  local query = '[[Category:Elin アイテム]] [[IngredientAll::果物]] OR [[IngredientAll::~*,果物*]] OR  [[IngredientAll::~*果物,*]]'
  local resultN = mw.smw.ask{
    query,
    '?Name',
    limit = 99,
    mainlabel = '-'
  } or {}
  mw.log('SMW Query: ' .. query)
  mw.log('SMW Result:')
  mw.logObject(resultN)
  local results = {}
  for _, row in ipairs(resultN) do
    local name = row.Name
    if name then
      table.insert(results, '* ' .. name)
    end
  end
  if #results > 0 then
    return table.concat(results, '\n')
  else
    return 'no result'
  end
end
return p
</syntaxhighlight >{{Collapse bottom}}