From 46d363e897b40493e08769f75b93d45f9ecf84f6 Mon Sep 17 00:00:00 2001 From: Michael Goerz Date: Sat, 27 Jan 2024 14:47:15 -0500 Subject: [PATCH] Do not write inventory if Documenter can do it Just skip writing the inventory if the function `Documenter.HTMLWriter.write_inventory` exists, indicating that the installed version of Documenter can write inventories itself. For compatibility with https://github.com/JuliaDocs/Documenter.jl/pull/2424 --- Project.toml | 2 +- src/write_inventory.jl | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 9f5cc20..e897a5a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "DocumenterInterLinks" uuid = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" authors = ["Michael Goerz "] -version = "0.2.4" +version = "0.2.4+dev" [deps] CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" diff --git a/src/write_inventory.jl b/src/write_inventory.jl index 3790489..c546c07 100644 --- a/src/write_inventory.jl +++ b/src/write_inventory.jl @@ -28,8 +28,12 @@ function Selectors.matcher(::Type{WriteInventory}, doc::Documenter.Document) end function Selectors.runner(::Type{WriteInventory}, doc::Documenter.Document) - @info "WriteInventory: writing `objects.inv` and `inventory.toml.gz` file." - write_inventory(doc) + if isdefined(Documenter.HTMLWriter, :write_inventory) + @debug "Skip writing inventories in DocumenterInterLinks: handled by Documenter" + else + @info "WriteInventory: writing `objects.inv` and `inventory.toml.gz` file." + write_inventory(doc) + end end