Skip to content

Commit

Permalink
Make description a bit more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Apr 2, 2024
1 parent 85dae81 commit 9e59d00
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ This object prints well in the REPL, and can also be shown as markdown or HTML.
This function is left deliberately unexported, since the name is pretty common.
"""
function description(package_name::AbstractString, dataset_name::AbstractString)
RDatasetDescription(read(joinpath(@__DIR__, "..", "doc",
package_name, "$dataset_name.html"), String))
doc_html_file = joinpath(@__DIR__, "..", "doc", package_name, "$dataset_name.html")
if isfile(doc_html_file)
return RDatasetDescription(read(doc_html_file, String))
else
return RDatasetDescription("No description available.")
end
end

# This is a convenience function to get the description of a dataset from a DataFrame.
Expand Down

0 comments on commit 9e59d00

Please sign in to comment.