Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.jl.cov
*.jl.mem
/docs/build/
/docs/cloned/
/docs/src/modules
Manifest.toml
*.swp
Expand Down
55 changes: 55 additions & 0 deletions docs/CommercialSupportComponent.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
struct JuliaHubCommercialSupportComponent <: MultiDocumenter.DropdownComponent
link::String
end

function MultiDocumenter.render(c::JuliaHubCommercialSupportComponent, doc, thispage, prettyurls)

return MultiDocumenter.@htl """
<div>
<a href="$(c.link)" class="nav-link nav-item">
<img src="https://info.juliahub.com/hubfs/Julia-Hub-Navigation-Logo-JuliaHub.svg" alt="JuliaHub logo - contact sales today!" style = "padding: 10px;"/>
</a>
<p></p>
<a href="$(c.link)" class="nav-link nav-item">JuliaHub offers commercial support for ModelingToolkit and the SciML ecosystem. Contact us today to discuss your needs!</a>
</div>
"""

end

struct ProductsUsedComponent <: MultiDocumenter.DropdownComponent end

PRODUCTNAME_IMAGE_LINK = [
(; product = "JuliaSim", logo = "https://juliahub.com/ui/juliasim-logo.notext.svg", link = "https://juliahub.com/products/juliasim"),
(; product = "Pumas", logo = "https://juliahub.com/ui/Pumas%20Logomark.svg", link = "https://pumas.ai/"),
(; product = "Cedar EDA", logo = "https://juliahub.com/ui/cedar_eda.svg", link = "https://juliahub.com/products/cedar-eda"),
(; product = "Neuroblox", logo = "https://juliahub.com/ui/Neuroblox-logo-400-300-dark.png", link = "https://www.neuroblox.org/"),
(; product = "Planting Space", logo = "https://planting.space/img/logo_big.svg", link = "https://planting.space/"),
]

function MultiDocumenter.render(c::ProductsUsedComponent, doc, thispage, prettyurls)
strings = [MultiDocumenter.@htl """
<li>
<a href=$(product.link) class="nav-link nav-item">
$(product.product)
</a>
</li>
""" for product in PRODUCTNAME_IMAGE_LINK]

return MultiDocumenter.@htl """
<table>
$strings
</table>
"""
end


struct Link <: MultiDocumenter.DropdownComponent
text::String
link::String
end

function MultiDocumenter.render(c::Link, doc, thispage, prettyurls)
return MultiDocumenter.@htl """
<a href=$(c.link) class="nav-link nav-item">$(c.text)</a>
"""
end
14 changes: 12 additions & 2 deletions docs/make_aggregate.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Documenter, LibGit2, Pkg
using MultiDocumenter

clonedir = mktempdir()
include("CommercialSupportComponent.jl")

clonedir = joinpath(@__DIR__, "cloned")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes repeated builds on a local machine significantly faster, and avoids cluttering the temp directory with 14 GB of files :D


# Ordering Matters!
docsmodules = [
Expand Down Expand Up @@ -182,7 +184,7 @@ docs = Any[MultiDocumenter.MultiDocRef(upstream = joinpath(clonedir, "Home"),
for group in docsmodules
docgroups = []
for cat in group[2]
docsites = []
docsites = MultiDocumenter.DropdownComponent[]
for mod in cat[2]
url = if mod in hasnojl
"https://github.com/SciML/$mod.git"
Expand All @@ -204,6 +206,14 @@ for group in docsmodules
push!(docs, MultiDocumenter.MegaDropdownNav(group[1], docgroups))
end

push!(docs, MultiDocumenter.MegaDropdownNav(
"Commercial Support",
[
MultiDocumenter.Column("Commercial Support", [JuliaHubCommercialSupportComponent("https://juliahub.com/company/contact-us-sciml-docs")]),
MultiDocumenter.Column("Products built with SciML", [ProductsUsedComponent()]),
]
))

outpath = joinpath(@__DIR__, "build")

MultiDocumenter.make(outpath, docs;
Expand Down