12,564
edits
TheNightAvl (talk | contribs) No edit summary |
TheNightAvl (talk | contribs) No edit summary |
||
| Line 20: | Line 20: | ||
local l_gloss = m_data.aliases[gloss_code] | local l_gloss = m_data.aliases[gloss_code] | ||
if l_gloss then -- check valid gloss (does not necessarily check for standardised glossing practices, just whatever is in form of/data) | if l_gloss then -- check valid gloss (does not necessarily check for standardised glossing practices, just whatever is in form of/data) | ||
local l_link | |||
local l = m_data.labels[l_gloss] | local l = m_data.labels[l_gloss] | ||
if l then l_gloss = l.label end -- check if label has glossary text and update | if l then | ||
l_gloss = l.label | |||
l_link = type(l.glossary) == "string" and l.glossary or l.label | |||
end -- check if label has glossary text and update | |||
glosslet_format = frame:expandTemplate{title = "hover", args = {glosslet_format, l_gloss, noline = args.noline or (args.style == nil and l and args.nolinks == nil), style = args.style}} --[[ format hover text (I spent ages agonising over the logic in excel for the conditions of this system, so here it is) | glosslet_format = frame:expandTemplate{title = "hover", args = {glosslet_format, l_gloss, noline = args.noline or (args.style == nil and l and args.nolinks == nil), style = args.style}} --[[ format hover text (I spent ages agonising over the logic in excel for the conditions of this system, so here it is) | ||
LINKS ENABLED? IN GLOSSARY? (L) NOLINK=1 STYLE NOLINE=1 LINE DISPLAYED? FINAL BOOLEAN FOR NO LINE | LINKS ENABLED? IN GLOSSARY? (L) NOLINK=1 STYLE NOLINE=1 LINE DISPLAYED? FINAL BOOLEAN FOR NO LINE | ||
| Line 37: | Line 41: | ||
× × ✓ × ✓ × TRUE | × × ✓ × ✓ × TRUE | ||
-]] | -]] | ||
if l and args.nolinks == nil then glosslet_format = "[[Appendix:Glossary#" .. l_gloss .. "|" .. glosslet_format .. "]]" end | if l and args.nolinks == nil then glosslet_format = "[[Appendix:Glossary#" .. (l_link or l_gloss) .. "|" .. glosslet_format .. "]]" end | ||
-- format links (hover and links MUST be done in this order for the gloss' hover texts to override the links') | -- format links (hover and links MUST be done in this order for the gloss' hover texts to override the links') | ||
end | end | ||