|
let |
|
sharedTab = Record.ToTable(#shared), |
|
//select only functions from #shared |
|
functions = Table.SelectRows(sharedTab, each Type.Is(Value.Type([Value]),type function)), |
|
//parse Module from function name |
|
modules = Table.AddColumn(functions, "Module", each Text.Split([Name], "."){0}, type text), |
|
functionNames = Table.AddColumn(modules, "FunctionName", each List.Last(Text.Split([Name], ".")), type text), |
|
//get category from documentation |
|
categories = Table.AddColumn(functionNames, "Category", each try Value.Metadata(Value.Type(Record.Field(#shared,[Name])))[Documentation.Category] otherwise ""), |
|
//parse only the first code example from documentation |
|
examples = Table.AddColumn(categories, "Examples", each |
|
let eg = Value.Metadata(Value.Type(Record.Field(#shared,[Name])))[Documentation.Examples]? |
|
in if Type.Is(Value.Type(eg),type record) then eg[Code] else eg{0}?[Code]?), |
|
//get the short description from the documentation |
|
descriptions = Table.AddColumn(examples, "Description", each Value.Metadata(Value.Type(Record.Field(#shared,[Name])))[Documentation.Description]?), |
|
//parse subcategories |
|
subcategories = Table.AddColumn(descriptions, "DotCategory", each List.Last(Text.Split([Category],"."))), |
|
//adding the signature of the functions |
|
out = Table.AddColumn(subcategories, "Signature", each Signature(Record.Field(#shared,[Name]))) |
|
in |
|
out |