diff --git a/docs/make.jl b/docs/make.jl
index fe4b5a7d..75a52430 100644
--- a/docs/make.jl
+++ b/docs/make.jl
@@ -1,3 +1,21 @@
+using Pkg
+dependents = ["ImageCore"] # direct
+idependents = ["WebP"] # indirect
+devdir = get(ENV, "JULIA_PKG_DEVDIR", nothing) # backup
+workdir = joinpath(@__DIR__, "work")
+ENV["JULIA_PKG_DEVDIR"] = workdir
+Pkg.activate(workdir)
+Pkg.develop(dependents, preserve=PRESERVE_DIRECT)
+ENV["JULIA_PKG_DEVDIR"] = devdir # restore
+for dep in dependents
+ Pkg.activate(joinpath(workdir, dep))
+ Pkg.compat("Colors", "< 1")
+end
+Pkg.activate(@__DIR__) # this project
+pkgspecs = [PackageSpec(path=joinpath(workdir, dep)) for dep in dependents]
+Pkg.develop(pkgspecs, preserve=PRESERVE_DIRECT)
+Pkg.add(idependents)
+
using Documenter, Colors
abstract type SVG end
@@ -39,3 +57,6 @@ makedocs(
deploydocs(
repo = "github.com/JuliaGraphics/Colors.jl.git",
target = "build")
+
+
+Pkg.rm([idependents; dependents], io=IOBuffer())
diff --git a/docs/sampleimages.jl b/docs/sampleimages.jl
index 2554e362..6dda8349 100644
--- a/docs/sampleimages.jl
+++ b/docs/sampleimages.jl
@@ -3,91 +3,42 @@ module SampleImages
using Colors
using Base64
+using WebP
struct BeadsImageSVG <: Main.SVG
buf::IOBuffer
end
+const beads = WebP.read_webp(joinpath(@__DIR__, "src", "assets", "figures", "beads.webp"))
# The following code is ad-hoc and highly depends on "beads.svg".
# Be careful when modifying the svg file or its code.
function BeadsImageSVG(caption::String; filter=nothing, width="64mm", height="36mm")
io = IOBuffer()
- id = string(hash(caption), base=16)
- open(joinpath("assets", "figures", "beads.svg"), "r") do file
- for line in eachline(file, keep=true)
- occursin(""=>
- """ width="$width" height="$height" style="display:inline; margin-left:1em; margin-bottom:1em">""")
- elseif occursin("filter_beads_g", line)
- line = replace(line, "filter_beads_g"=>"filter_"*id)
- elseif occursin("", line)
- text = """
- $caption
- """
- line = replace(line, ""=>text)
- end
+ write(io, """\n""")
+
+ BeadsImageSVG(io)
end
end
diff --git a/docs/src/assets/figures/beads.svg b/docs/src/assets/figures/beads.svg
deleted file mode 100644
index d93975d2..00000000
--- a/docs/src/assets/figures/beads.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
diff --git a/docs/src/assets/figures/beads.webp b/docs/src/assets/figures/beads.webp
new file mode 100644
index 00000000..f8e8d654
Binary files /dev/null and b/docs/src/assets/figures/beads.webp differ
diff --git a/docs/work/.gitignore b/docs/work/.gitignore
new file mode 100644
index 00000000..72e8ffc0
--- /dev/null
+++ b/docs/work/.gitignore
@@ -0,0 +1 @@
+*