diff --git a/docs/make.jl b/docs/make.jl index 52c8b6c..3f5fce8 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -2,6 +2,8 @@ using Tables using Documenter using Documenter.Remotes: GitHub +DocMeta.setdocmeta!(Tables, :DocTestSetup, :(using Tables); recursive=true) + makedocs(; modules=[Tables], format=Documenter.HTML(), diff --git a/src/utils.jl b/src/utils.jl index b6cdca5..979aeb0 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -188,7 +188,7 @@ arguments to `ByRow` does not allow it to determine the number of rows of the source table). # Examples -``` +```jldoctest julia> Tables.ByRow(x -> x^2)(1:3) 3-element Vector{Int64}: 1 @@ -206,14 +206,13 @@ julia> Tables.ByRow(x -> x.a)((a=1:2, b=3:4)) 1 2 - julia> Tables.ByRow(x -> (a=x.a*2, b=sin(x.b), c=x.c))((a=[1, 2, 3], - b=[1.2, 3.4, 5.6], - c=["a", "b", "c"])) -3-element Vector{NamedTuple{(:a, :b, :c), Tuple{Int64, Float64, String}}}: +julia> Tables.ByRow(x -> (a=x.a*2, b=sin(x.b), c=x.c))((a=[1, 2, 3], + b=[1.2, 3.4, 5.6], + c=["a", "b", "c"])) +3-element Vector{@NamedTuple{a::Int64, b::Float64, c::String}}: (a = 2, b = 0.9320390859672263, c = "a") (a = 4, b = -0.2555411020268312, c = "b") (a = 6, b = -0.6312666378723216, c = "c") - ``` """ struct ByRow{T} <: Function