Skip to content

Commit 470a881

Browse files
authored
Enhance docs (#46)
* Add logo * docs: add the UAI file format descriptions * docs: improve home page * Improve UAI file descriptions and fix unresolved path * docs: enhance probabilities with latex equations * docs: add link to local descriptions of UAI file formats * Add a background section * Improve letters that denote different sets of vars * Improve grammar * docs: improve API section * Keep the Index order consistent with the order of appearance * Fix scaling of TikzPictures * docs: show network above the var descriptions * Move docs CI build to a separate file * docs: use setup-julia@latest * docs: update apt-get packages on CI * docs: delete old docs CI config * docs: update development GitHub branch
1 parent 57f5068 commit 470a881

File tree

19 files changed

+2985
-65
lines changed

19 files changed

+2985
-65
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,3 @@ jobs:
3737
- uses: codecov/codecov-action@v3
3838
with:
3939
files: lcov.info
40-
docs:
41-
name: Documentation
42-
runs-on: ubuntu-latest
43-
permissions:
44-
contents: write
45-
steps:
46-
- uses: actions/checkout@v2
47-
- uses: julia-actions/setup-julia@v1
48-
with:
49-
version: '1'
50-
- uses: julia-actions/julia-buildpkg@v1
51-
- uses: julia-actions/julia-docdeploy@v1
52-
env:
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
- run: |
55-
julia --project=docs -e '
56-
using Documenter: DocMeta, doctest
57-
using TensorInference
58-
DocMeta.setdocmeta!(TensorInference, :DocTestSetup, :(using TensorInference); recursive=true)
59-
doctest(TensorInference)'

.github/workflows/documentation.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Based on: https://documenter.juliadocs.org/stable/man/hosting/#GitHub-Actions
2+
3+
name: Documentation
4+
5+
on:
6+
push:
7+
branches:
8+
- main # update to match your development branch (master, main, dev, trunk, ...)
9+
tags: '*'
10+
pull_request:
11+
12+
jobs:
13+
build:
14+
permissions:
15+
contents: write
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: julia-actions/setup-julia@latest
20+
with:
21+
version: '1'
22+
# TexLive installation (taken from https://github.com/JuliaTeX/TikzPictures.jl/blob/master/.github/workflows/CI.yml)
23+
- name: Install TexLive
24+
run: sudo apt-get update --fix-missing; sudo apt-get install pdf2svg texlive-latex-base texlive-binaries texlive-pictures texlive-latex-extra texlive-luatex
25+
- name: Install dependencies
26+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
27+
- name: Build and deploy
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: julia --project=docs/ docs/make.jl

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# TensorInference
1+
<p align="center">
2+
<img width="700px" src="./docs/src/assets/logo-with-name.svg"/>
3+
</p>
24

35
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://TensorBFS.github.io/TensorInference.jl/stable/)
46
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://TensorBFS.github.io/TensorInference.jl/dev/)

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
44
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
55
TensorInference = "c2297e78-99bd-40ad-871d-f50e56b81012"
6+
TikzPictures = "37f6aa50-8035-52d0-81c2-5a1d08754b2d"

docs/make.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,20 @@ makedocs(;
2626
prettyurls=get(ENV, "CI", "false") == "true",
2727
canonical="https://TensorBFS.github.io/TensorInference.jl",
2828
edit_link="main",
29-
assets=String[],
29+
assets = [joinpath("assets", "favicon.ico")],
3030
),
3131
pages=[
3232
"Home" => "index.md",
33+
"Background" => "background.md",
3334
"Examples" => [
3435
"Asia network" => "generated/asia/main.md",
3536
],
36-
"Performance Tips" => "performance.md",
37-
"References" => "ref.md",
37+
"UAI file formats" => "uai-file-formats.md",
38+
"Performance tips" => "performance.md",
39+
"API" => [
40+
"Public" => "api/public.md",
41+
"Internal" => "api/internal.md"
42+
],
3843
],
3944
doctest = false,
4045
)

docs/src/api/internal.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Internal API
2+
3+
## Index
4+
5+
[Types](@ref internal_Types)
6+
7+
```@index
8+
Pages = ["internal.md"]
9+
Order = [:type]
10+
```
11+
12+
[Functions](@ref internal_Functions)
13+
14+
```@index
15+
Pages = ["internal.md"]
16+
Order = [:function]
17+
```
18+
19+
## [Types](@id internal_Types)
20+
21+
```@autodocs
22+
Modules = [TensorInference]
23+
Order = [:type]
24+
Public = false
25+
```
26+
27+
## [Functions](@id internal_Functions)
28+
29+
```@autodocs
30+
Modules = [TensorInference]
31+
Order = [:function]
32+
Public = false
33+
```

docs/src/api/public.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Public API
2+
3+
## Index
4+
5+
[Modules](@ref)
6+
7+
```@index
8+
Pages = ["public.md"]
9+
Order = [:module]
10+
```
11+
12+
[Types](@ref)
13+
14+
```@index
15+
Pages = ["public.md"]
16+
Order = [:type]
17+
```
18+
19+
[Functions](@ref)
20+
21+
```@index
22+
Pages = ["public.md"]
23+
Order = [:function]
24+
```
25+
26+
## Modules
27+
28+
```@docs
29+
TensorInference
30+
```
31+
32+
## Types
33+
34+
```@docs
35+
GreedyMethod
36+
KaHyParBipartite
37+
MergeGreedy
38+
MergeVectors
39+
SABipartite
40+
TreeSA
41+
MMAPModel
42+
RescaledArray
43+
TensorNetworkModel
44+
UAIInstance
45+
```
46+
47+
## Functions
48+
49+
```@docs
50+
contraction_complexity
51+
get_cards
52+
get_vars
53+
log_probability
54+
marginals
55+
maximum_logp
56+
most_probable_config
57+
probability
58+
read_evidence_file
59+
read_instance
60+
read_model_file
61+
read_solution_file
62+
read_td_file
63+
sample
64+
set_evidence!
65+
```

docs/src/assets/favicon.ico

60.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)