Update src/rendering/exportformat.jl

Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
pull/380/head
JonasIsensee 2020-10-03 08:51:22 +02:00 committed by GitHub
parent b583ac2e40
commit e02d5ce2fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -1,18 +1,18 @@
abstract type ExportFormat <: WeaveFormat end
function Base.getproperty(sf::ExportFormat, s::Symbol)
hasfield(typeof(sf), s) && return getfield(sf, s)
function Base.getproperty(sf::T, s::Symbol) where {T<:ExportFormat}
hasfield(T, s) && return getfield(sf, s)
return getproperty(sf.primaryformat, s)
end
function Base.setproperty!(sf::ExportFormat, s::Symbol, v)
if hasfield(typeof(sf), s)
function Base.setproperty!(sf::T, s::Symbol, v) where {T<:ExportFormat}
if hasfield(T, s)
setfield!(sf, s, v)
else
setproperty!(sf.primaryformat, s, v)
end
end
function Base.hasproperty(sf::ExportFormat, s::Symbol)
hasfield(typeof(sf), s) || hasfield(typeof(sf.primaryformat), s)
function Base.hasproperty(sf::T, s::Symbol) where {T<:ExportFormat}
hasfield(T, s) || hasproperty(sf.primaryformat, s)
end
render_doc(df::ExportFormat, body, doc) = render_doc(df.primaryformat, body, doc)