Improve Markdown talent export with Ascension build string integration
- Added support for Ascension's native build string in `GenerateMarkdownTalents`. - Generated URL and iframe embedding for talent
This commit is contained in:
@@ -339,21 +339,35 @@ end
|
||||
|
||||
-- Markdown talents export generator
|
||||
function AE:GenerateMarkdownTalents()
|
||||
local talents = self.CollectTalents and self.CollectTalents() or { selected = {} }
|
||||
local talents = self.CollectTalents and self.CollectTalents() or {}
|
||||
local _, class = UnitClass("player")
|
||||
|
||||
local lines = {}
|
||||
table.insert(lines, "## Talents\n")
|
||||
|
||||
-- Count talents
|
||||
local count = #(talents.selected or {})
|
||||
-- Check if we have Ascension build string
|
||||
if talents.buildString and talents.buildString ~= "" then
|
||||
-- Use Ascension's native build string format
|
||||
local buildString = talents.buildString
|
||||
|
||||
-- Generate URL for talent calculator
|
||||
local url = string.format("https://exil.es/en/wow/talent-calc?build=%s", buildString)
|
||||
table.insert(lines, string.format("[View in Talent Calculator](%s)\n", url))
|
||||
|
||||
-- Embed iframe for Wiki.js
|
||||
table.insert(lines, string.format('<iframe src="/static/talents/?build=%s&embed=true" width="100%%" height="840" style="border: 0px solid #333; border-radius: 8px;"></iframe>\n', buildString))
|
||||
|
||||
return table.concat(lines, "\n")
|
||||
end
|
||||
|
||||
-- Fallback: check for old-style selected talents
|
||||
local count = #(talents.selected or {})
|
||||
if count == 0 then
|
||||
table.insert(lines, "*No talents selected. Make sure you have spent talent points on your character.*\n")
|
||||
return table.concat(lines, "\n")
|
||||
end
|
||||
|
||||
-- Generate the talent calc URL
|
||||
-- Generate the talent calc URL (old format)
|
||||
local url = self.GenerateTalentCalcURL and self.GenerateTalentCalcURL(talents, class)
|
||||
if url then
|
||||
table.insert(lines, string.format("[View in Talent Calculator](%s)\n", url))
|
||||
|
||||
Reference in New Issue
Block a user