mirror of https://github.com/mpastell/Weave.jl
maxlog for deprecation warning
parent
af45cc01ab
commit
f4caba1561
|
@ -7,6 +7,7 @@ const PKG_DIR = normpath(@__DIR__, "..")
|
|||
const TEMPLATE_DIR = normpath(PKG_DIR, "templates")
|
||||
const WEAVE_OPTION_NAME = "weave_options"
|
||||
const WEAVE_OPTION_NAME_DEPRECATED = "options" # remove this when tagging v0.11
|
||||
const WEAVE_OPTION_DEPRECATE_ID = "weave_option_duplicate_id"
|
||||
|
||||
# keeps paths of sample documents for easy try
|
||||
const EXAMPLE_FOLDER = normpath(PKG_DIR, "examples")
|
||||
|
@ -130,7 +131,7 @@ function weave(
|
|||
# NOTE: these YAML options can NOT be given dynamically
|
||||
weave_options = get(doc.header, WEAVE_OPTION_NAME, nothing)
|
||||
if haskey(doc.header, WEAVE_OPTION_NAME_DEPRECATED)
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead."
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead." _id = WEAVE_OPTION_DEPRECATE_ID maxlog = 1
|
||||
weave_options = get(doc.header, WEAVE_OPTION_NAME_DEPRECATED, nothing)
|
||||
end
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ function restore_header!(doc)
|
|||
# only strips Weave headers
|
||||
delete!(doc.header, WEAVE_OPTION_NAME)
|
||||
if haskey(doc.header, WEAVE_OPTION_NAME_DEPRECATED)
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead."
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead." _id = WEAVE_OPTION_DEPRECATE_ID maxlog = 1
|
||||
delete!(doc.header, WEAVE_OPTION_NAME_DEPRECATED)
|
||||
end
|
||||
isempty(doc.header) && return
|
||||
|
|
|
@ -18,7 +18,7 @@ function WeaveDoc(source, informat = nothing)
|
|||
end
|
||||
end
|
||||
if haskey(header, WEAVE_OPTION_NAME_DEPRECATED)
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead."
|
||||
@warn "Weave: `options` key is deprecated. Use `weave_options` key instead." _id = WEAVE_OPTION_DEPRECATE_ID maxlog = 1
|
||||
for key in keys(chunk_defaults)
|
||||
if (val = get(header[WEAVE_OPTION_NAME_DEPRECATED], string(key), nothing)) !== nothing
|
||||
chunk_defaults[key] = val
|
||||
|
|
Loading…
Reference in New Issue