Skip to content

Commit 87c78d8

Browse files
committed
Pick up project options from frontmatter
1 parent 8ba293e commit 87c78d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/server.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ function _extract_relevant_options(file_frontmatter::Dict, options::Dict)
427427
julia_default = get(file_frontmatter, "julia", nothing)
428428

429429
params_default = get(file_frontmatter, "params", Dict{String,Any}())
430+
project_default = get(file_frontmatter, "project", Dict{String,Any}())
430431

431432
if isempty(options)
432433
return _options_template(;
@@ -441,6 +442,7 @@ function _extract_relevant_options(file_frontmatter::Dict, options::Dict)
441442
daemon = daemon_default,
442443
params = params_default,
443444
cache = cache_default,
445+
project = project_default,
444446
)
445447
else
446448
format = get(D, options, "format")
@@ -469,6 +471,8 @@ function _extract_relevant_options(file_frontmatter::Dict, options::Dict)
469471
cli_params = get(options, "params", Dict())
470472
params_merged = _recursive_merge(params_default, params, cli_params)
471473

474+
project = get(metadata, "project", Dict())
475+
472476
return _options_template(;
473477
fig_width,
474478
fig_height,
@@ -481,6 +485,7 @@ function _extract_relevant_options(file_frontmatter::Dict, options::Dict)
481485
daemon,
482486
params = params_merged,
483487
cache,
488+
project,
484489
)
485490
end
486491
end
@@ -497,6 +502,7 @@ function _options_template(;
497502
daemon,
498503
params,
499504
cache,
505+
project,
500506
)
501507
D = Dict{String,Any}
502508
return D(
@@ -515,6 +521,7 @@ function _options_template(;
515521
"metadata" => D("julia" => julia),
516522
),
517523
"params" => D(params),
524+
"project" => D(project),
518525
)
519526
end
520527

0 commit comments

Comments
 (0)