Skip to content

Commit 06ce59f

Browse files
committed
rebase on master
1 parent dd28e10 commit 06ce59f

File tree

10 files changed

+18
-31
lines changed

10 files changed

+18
-31
lines changed

src/generate.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ function makedemos(source::String, templates::Union{Dict, Nothing} = nothing;
156156
out_path = joinpath(relative_root, "index.md")
157157
end
158158

159+
# Ensure every path exists before we actually do the work
160+
walkpage(page) do dir, item
161+
@assert isfile(item.path) || isdir(item.path)
162+
end
163+
159164
@info "SetupDemoCardsDirectory: setting up \"$(source)\" directory."
160165
if isdir(absolute_root)
161166
# a typical and probably safe case -- that we're still in docs/ folder

src/remote.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function Base.show(io::IO, card::LocalRemoteCard)
3434
print(io, basename(card), " => ", card.path)
3535
end
3636

37-
function generate(card::LocalRemoteCard, template)
37+
function generate(card::LocalRemoteCard, template; kwargs...)
3838
with_tempcard(card) do tempcard
39-
generate(tempcard, template)
39+
generate(tempcard, template; kwargs...)
4040
end
4141
end
4242
function save_democards(card_dir::String, card::LocalRemoteCard; kwargs...)

src/types/section.jl

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,6 @@ function DemoSection(root::String)::DemoSection
119119
!(x isa UnmatchedCard)
120120
end
121121

122-
section = DemoSection(root,
123-
cards,
124-
map(DemoSection, section_paths),
125-
"",
126-
"",
127-
Dict{String, Any}())
128-
129-
ordered_paths = joinpath.(root, load_config(section, "order"; config=config))
130-
if !isempty(section.cards)
131-
cards = map(democard, ordered_paths)
132-
subsections = []
133-
else
134-
cards = []
135-
subsections = map(DemoSection, ordered_paths)
136-
end
137-
138122
if haskey(config, "remote")
139123
remote_cards = LocalRemoteCard[]
140124
for (cardname, cardpath) in config["remote"]
@@ -146,7 +130,7 @@ function DemoSection(root::String)::DemoSection
146130
end
147131

148132
subsections = map(DemoSection, section_paths)
149-
section = DemoSection(root, cards, subsections, "", "")
133+
section = DemoSection(root, cards, subsections, "", "", Dict{String, Any}())
150134
cards, subsections = sort_by_order(section, config)
151135

152136
title = load_config(section, "title"; config=config)

test/assets/remote/remote_card_mixed/card1.md

Whitespace-only changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"remote": {
3-
"julia_card": "../../card/julia/title_1.jl",
4-
"markdown_card": "../../card/markdown/title_3.md"
3+
"julia_card1": "../../card/julia/cover_1.jl",
4+
"markdown_card1": "../../card/markdown/cover_3.md"
55
}
66
}
File renamed without changes.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"remote": {
3-
"julia_card.jl": "../../card/julia/title_1.jl",
4-
"markdown_card.md": "../../card/markdown/title_3.md"
3+
"julia_card2.jl": "../../card/julia/version_1.jl",
4+
"markdown_card2.md": "../../card/markdown/description_1.md"
55
},
66
"order": [
7-
"julia_card.jl",
8-
"markdown_card.md",
9-
"title_2.md"
7+
"julia_card2.jl",
8+
"markdown_card2.md",
9+
"card2.md"
1010
]
1111
}

test/assets/remote/remote_card_mixed_order/title_2.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"remote": {
3-
"julia_card": "../../card/julia/title_2.jl",
4-
"markdown_card": "../../card/markdown/title_4.md"
3+
"julia_card3": "../../card/julia/simplest.jl",
4+
"markdown_card3": "../../card/markdown/simplest.md"
55
}
66
}

test/remote.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
(5, "remote_card_mixed"),
1111
(4, "remote_card_simplest")
1212
]
13+
# there will be warnings due to lack of cover images, but we can just safely ignore them
1314
@suppress_err preview_demos(joinpath(abs_root, dir); theme="grid")
1415
page_dir = @suppress_err preview_demos(joinpath(abs_root, dir); require_html=false)
1516
files = readdir(joinpath(page_dir, dir))

0 commit comments

Comments
 (0)