From 8206ca2d14b56293e55964f1cf53ef53c4238cc7 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Sun, 14 Jun 2020 14:25:21 +0900 Subject: [PATCH] fix `set_chunk_options!` --- src/config.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config.jl b/src/config.jl index 956c259b..0dcf9012 100644 --- a/src/config.jl +++ b/src/config.jl @@ -28,9 +28,9 @@ const _DEFAULT_PARAMS = Dict{Symbol,Any}( const DEFAULT_PARAMS = deepcopy(_DEFAULT_PARAMS) # might be changed at runtime """ - set_chunk_defaults!(k::Symbol, v::Any) = DEFAULT_PARAMS[k]= v - set_chunk_defaults!(kv::Pair{Symbol,Any}...) = for (k,v) in kv; set_chunk_defaults!(k, v); end - set_chunk_defaults!(opts::AbstractDict{Symbol,Any}) = merge!(DEFAULT_PARAMS, opts) + set_chunk_defaults!(k, v) + set_chunk_defaults!(kv::Pair...) + set_chunk_defaults!(opts::AbstractDict) Set default options for code chunks, use [`get_chunk_defaults`](@ref) to see the current values. @@ -39,9 +39,9 @@ E.g.: all the three examples below will set default `dpi` to `200` and `fig_widt - `set_chunk_defaults!(:dpi => 200, :fig_width => 8)` - `set_chunk_defaults!(Dict(:dpi => 200, :fig_width => 8))` """ -set_chunk_defaults!(k::Symbol, v::Any) = DEFAULT_PARAMS[k]= v -set_chunk_defaults!(kv::Pair{Symbol,Any}...) = for (k,v) in kv; set_chunk_defaults!(k, v); end -set_chunk_defaults!(opts::AbstractDict{Symbol,Any}) = merge!(DEFAULT_PARAMS, opts) +set_chunk_defaults!(k, v) = DEFAULT_PARAMS[k]= v +set_chunk_defaults!(kv::Pair...) = for (k,v) in kv; set_chunk_defaults!(k, v); end +set_chunk_defaults!(opts::AbstractDict) = merge!(DEFAULT_PARAMS, opts) """ get_chunk_defaults()