diff --git a/.claude/skills/mxl-info/SKILL.md b/.claude/skills/mxl-info/SKILL.md index 724300b8..457ad41a 100644 --- a/.claude/skills/mxl-info/SKILL.md +++ b/.claude/skills/mxl-info/SKILL.md @@ -118,6 +118,22 @@ In BSL: Область.Параметры.РасшифровкаТовар = СтрокаТЧ.Номенклатура; // detailParameter ``` +### Template parameters (`[tpl]` suffix) + +Some parameters are embedded in template text: `"Инв № [ИнвентарныйНомер]"`. These are filled via fillType=Template, not fillType=Parameter. The script always extracts them and marks with `[tpl]`: + +``` + НумерацияЛистов: Номер [tpl], Дата [tpl], НомерЛиста [tpl] +``` + +In BSL, template parameters are filled the same way as regular ones: +```bsl +Область.Параметры.Номер = НомерДокумента; +Область.Параметры.Дата = ДатаДокумента; +``` + +Numeric-only placeholders like `[5]`, `[6]` (footnote references in legal forms) are ignored. + ### Text content (`-WithText`) Shows static text (labels, headers) and template strings with `[Param]` placeholders: diff --git a/.claude/skills/mxl-info/scripts/mxl-info.ps1 b/.claude/skills/mxl-info/scripts/mxl-info.ps1 index 46aa4e6c..77327827 100644 --- a/.claude/skills/mxl-info/scripts/mxl-info.ps1 +++ b/.claude/skills/mxl-info/scripts/mxl-info.ps1 @@ -132,14 +132,26 @@ function Get-CellData { $results += $entry } - if ($includeText -and $tl) { + if ($tl) { $content = $tl.SelectSingleNode("v8:item/v8:content", $ns) if ($content -and $content.InnerText) { $text = $content.InnerText - # Detect if this is a Template (has [...] placeholders) - if ($text -match '\[.+\]') { - $results += @{ Kind = "Template"; Value = $text } - } else { + $isTemplate = $text -match '\[.+\]' + + if ($isTemplate) { + # Always extract parameter names from [Param] placeholders + # Skip numeric-only like [5] — these are footnote refs in legal forms + foreach ($m in [regex]::Matches($text, '\[([^\]]+)\]')) { + $val = $m.Groups[1].Value + if ($val -notmatch '^\d+$') { + $results += @{ Kind = "TemplateParam"; Value = $val } + } + } + # Full template text only with -WithText + if ($includeText) { + $results += @{ Kind = "Template"; Value = $text } + } + } elseif ($includeText) { $results += @{ Kind = "Text"; Value = $text } } } @@ -175,8 +187,9 @@ function Get-AreaCellData { $params += $c.Value if ($c.Detail) { $details += "$($c.Value)->$($c.Detail)" } } - "Text" { $texts += $c.Value } - "Template" { $templates += $c.Value } + "TemplateParam" { $params += "$($c.Value) [tpl]" } + "Text" { $texts += $c.Value } + "Template" { $templates += $c.Value } } } } @@ -229,6 +242,7 @@ foreach ($r in $rowMap.Keys | Sort-Object) { $outsideParams += $c.Value if ($c.Detail) { $outsideDetails += "$($c.Value)->$($c.Detail)" } } + "TemplateParam" { $outsideParams += "$($c.Value) [tpl]" } "Text" { $outsideTexts += $c.Value } "Template" { $outsideTemplates += $c.Value } }