Skip to content

Commit

Permalink
improve show for generic table
Browse files Browse the repository at this point in the history
  • Loading branch information
alecloudenback committed Oct 20, 2021
1 parent c577004 commit 55cab4a
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions src/XTbML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,40 @@ end
struct XTbML_SelectUltimate
select
ultimate
d::TableMetaData
metadata::TableMetaData
end

struct XTbML_Ultimate
ultimate
d::TableMetaData
metadata::TableMetaData
end

struct XTbML_Generic
tables
d::TableMetaData
metadata::TableMetaData
end

Base.show(io::IO, ::MIME"text/plain", mt::XTbML_Generic) = print(
io,
"""
MortalityTable ($(mt.metadata.content_type)):
Name:
$(mt.metadata.name)
Fields:
$(fieldnames(typeof(mt)))
Provider:
$(mt.metadata.provider)
mort.SOA.org ID:
$(mt.metadata.id)
mort.SOA.org link:
https://mort.soa.org/ViewTable.aspx?&TableIdentity=$(mt.metadata.id)
Description:
$(mt.metadata.description)
Note:
The requested table is not a known type. The values provided will be in a generic format for accessibility, but will not follow the same API as structured tables. See [#TODO link to doc site describing possible breaking changes further].
""",
)

function parseXTbMLTable(x, path)
md = x["XTbML"]["ContentClassification"]
name = get(md, "TableName", nothing) |> strip
Expand Down

0 comments on commit 55cab4a

Please sign in to comment.