From 62791ab422a2b745608627fb34651305df350ca9 Mon Sep 17 00:00:00 2001 From: Anton Reinhard Date: Sun, 17 Sep 2023 11:20:10 +0200 Subject: [PATCH] Fix docs --- docs/make.jl | 5 ++++- docs/src/lib/internals/code_gen.md | 8 ++++++++ docs/src/lib/internals/models.md | 6 +++--- docs/src/lib/internals/properties.md | 2 +- docs/src/lib/internals/utility.md | 2 +- src/code_gen/main.jl | 10 +++++----- 6 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 docs/src/lib/internals/code_gen.md diff --git a/docs/make.jl b/docs/make.jl index 578cdb5..5c81178 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -7,10 +7,12 @@ makedocs( root = "docs", source = "src", build = "build", + warnonly = true, clean = true, doctest = true, modules = Module[MetagraphOptimization], - repo = "https://code.woubery.com/Rubydragon/MetagraphOptimization.jl/src/branch/{commit}{path}#L{line}", + #repo = "https://code.woubery.com/Rubydragon/MetagraphOptimization.jl/src/branch/{commit}{path}#L{line}", + remotes = nothing, sitename = "MetagraphOptimization.jl", pages = [ "index.md", @@ -24,6 +26,7 @@ makedocs( "Models" => "lib/internals/models.md", "Diff" => "lib/internals/diff.md", "Utility" => "lib/internals/utility.md", + "Code Generation" => "lib/internals/code_gen.md", ], "Contribution" => "contribution.md", ], diff --git a/docs/src/lib/internals/code_gen.md b/docs/src/lib/internals/code_gen.md new file mode 100644 index 0000000..a9f4246 --- /dev/null +++ b/docs/src/lib/internals/code_gen.md @@ -0,0 +1,8 @@ +# Code Generation + +## Main +```@autodocs +Modules = [MetagraphOptimization] +Pages = ["code_gen/main.jl"] +Order = [:function] +``` \ No newline at end of file diff --git a/docs/src/lib/internals/models.md b/docs/src/lib/internals/models.md index 1f7877f..192b91c 100644 --- a/docs/src/lib/internals/models.md +++ b/docs/src/lib/internals/models.md @@ -13,7 +13,7 @@ Order = [:type, :constant] ```@autodocs Modules = [MetagraphOptimization] Pages = ["models/abc/particle.jl"] -Order = [:type, :constant] +Order = [:type, :constant, :function] ``` ### Parse @@ -33,14 +33,14 @@ Order = [:function] ### Create ```@autodocs Modules = [MetagraphOptimization] -Pages = ["models/abc/create.jl] +Pages = ["models/abc/create.jl"] Order = [:function] ``` ### Compute ```@autodocs Modules = [MetagraphOptimization] -Pages = ["models/abc/compute.jl] +Pages = ["models/abc/compute.jl"] Order = [:function] ``` diff --git a/docs/src/lib/internals/properties.md b/docs/src/lib/internals/properties.md index 5773020..1539e52 100644 --- a/docs/src/lib/internals/properties.md +++ b/docs/src/lib/internals/properties.md @@ -10,7 +10,7 @@ Order = [:type] ## Create ```@autodocs Modules = [MetagraphOptimization] -Pages = ["task/create.jl"] +Pages = ["properties/create.jl"] Order = [:function] ``` diff --git a/docs/src/lib/internals/utility.md b/docs/src/lib/internals/utility.md index ca034d8..2549cc9 100644 --- a/docs/src/lib/internals/utility.md +++ b/docs/src/lib/internals/utility.md @@ -3,7 +3,7 @@ ## Helper Functions ```@autodocs Modules = [MetagraphOptimization] -Pages = ["utility.jl"] +Pages = ["./utility.jl"] Order = [:type, :function] ``` diff --git a/src/code_gen/main.jl b/src/code_gen/main.jl index 0677d2d..3bbb5a3 100644 --- a/src/code_gen/main.jl +++ b/src/code_gen/main.jl @@ -5,9 +5,9 @@ using DataStructures Generate the code for a given graph. The return value is a tuple of: - - `code::Expr`: The julia expression containing the code for the whole graph. - - `inputSymbols::Dict{String, Symbol}`: A dictionary of symbols mapping the names of the input nodes of the graph to the symbols their inputs should be provided on. - - `outputSymbol::Symbol`: The symbol of the final calculated value +- `code::Expr`: The julia expression containing the code for the whole graph. +- `inputSymbols::Dict{String, Symbol}`: A dictionary of symbols mapping the names of the input nodes of the graph to the symbols their inputs should be provided on. +- `outputSymbol::Symbol`: The symbol of the final calculated value See also: [`execute`](@ref) """ @@ -53,7 +53,7 @@ end """ execute(generated_code, input::Dict{ParticleType, Vector{Particle}}) -Execute the given generated_code (as returned by [`gen_code`](@ref)) on the given input particles. +Execute the given `generated_code` (as returned by [`gen_code`](@ref)) on the given input particles. """ function execute(generated_code, input::Dict{ParticleType, Vector{Particle}}) (code, inputSymbols, outputSymbol) = generated_code @@ -89,7 +89,7 @@ end """ execute(graph::DAG, input::Dict{ParticleType, Vector{Particle}}) -Execute the given generated_code (as returned by [`gen_code`](@ref)) on the given input particles. +Execute the given `generated_code` (as returned by [`gen_code`](@ref)) on the given input particles. The input particles should be sorted correctly into the dictionary to their according [`ParticleType`](@ref)s. See also: [`gen_particles`](@ref)