Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Literate.jl to generate automatically documentation (#3)
Documentation can be automatically generated from test files using Literate.jl. Looks promising approach!
- Loading branch information
Showing
6 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
docs/build/ | ||
docs/site/ | ||
docs/src/tests | ||
*.cov | ||
*.pyc | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
# This file is a part of JuliaFEM. | ||
# License is MIT: see https://github.com/JuliaFEM/HeatTransfer.jl/blob/master/LICENSE | ||
|
||
using Documenter, HeatTransfer | ||
haskey(Pkg.installed(), "Literate") || Pkg.add("Literate") | ||
|
||
using Documenter, HeatTransfer, Literate | ||
|
||
# automatically generate documentation from tests | ||
pkg_dir = Pkg.dir("HeatTransfer") | ||
testdir = joinpath(pkg_dir, "test") | ||
outdir = joinpath(pkg_dir, "docs", "src", "tests") | ||
test_pages = [] | ||
for test_file in readdir(joinpath(pkg_dir, "test")) | ||
startswith(test_file, "test_") || continue | ||
Literate.markdown(joinpath(testdir, test_file), outdir; documenter=true) | ||
generated_test_file = joinpath("tests", first(splitext(test_file)) * ".md") | ||
push!(test_pages, generated_test_file) | ||
end | ||
|
||
makedocs(modules=[HeatTransfer], | ||
format = :html, | ||
checkdocs = :all, | ||
sitename = "HeatTransfer.jl", | ||
pages = ["index.md"] | ||
pages = [ | ||
"index.md", | ||
"Examples" => test_pages | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters