Skip to content

Commit

Permalink
Literate-in-docs (#46)
Browse files Browse the repository at this point in the history
* add tutorial to documentation
* add literate to docs
* theme
* remove demo link
  • Loading branch information
mmikhasenko authored Aug 21, 2024
1 parent 025cf1c commit bc2ebd2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .cspell/julia.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
autodocs
btime
circleorigin
coeffs
Expand Down Expand Up @@ -28,6 +29,7 @@ mssq
nonpole
permutedims
polardalitz
postprocess
println
rborder
reim
Expand All @@ -49,4 +51,3 @@ warntype
σjofk
σkmax
σkmin
autodocs
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ The code mostly inherits notations of the paper:
- `ζ_kj_for_0` is the Wigner angle of the 0-particle, an angle of `vec pⱼ+pⱼ` with respect the the chain `j`.
- `ζ_ij_for_k` is the Wigner angle for the particle `k` (the angle in the rest frame of particle `k`) that is mismatched for the chain `i` with respect to the chain `j`.

See [example](docs/src/demo.jl) for a demonstration case.

## Installation

```julia
Expand Down
7 changes: 3 additions & 4 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Don't forget to run
#
# pkg> dev ..
#
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
ThreeBodyDecays = "e6563dab-9ca1-5843-bde3-2ccf38d63843"

[compat]
Expand Down
25 changes: 24 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using ThreeBodyDecays
using Documenter
using Literate

DocMeta.setdocmeta!(
ThreeBodyDecays,
Expand All @@ -10,6 +11,28 @@ DocMeta.setdocmeta!(

const page_rename = Dict("developer.md" => "Developer docs") # Without the numbers

function fix_literate_output(content)
content = replace(content, "EditURL = \"@__REPO_ROOT_URL__/\"" => "")
return content
end

docs_src_dir = joinpath(@__DIR__, "src")
#
files = readdir(docs_src_dir)
filter!(file -> splitext(file)[2] == ".jl", files)
map(files) do file
name = splitext(file)[1]
tutorial_src = joinpath(@__DIR__, "src", "$(name).jl")
Literate.markdown(
tutorial_src,
docs_src_dir;
name,
documenter = true,
credit = true,
postprocess = fix_literate_output,
)
end

makedocs(;
modules = [ThreeBodyDecays],
authors = "Misha Mikhasenko <[email protected]> and contributors",
Expand All @@ -22,7 +45,7 @@ makedocs(;
pages = [
"index.md"
[
file for file in readdir(joinpath(@__DIR__, "src")) if
file for file in readdir(docs_src_dir) if
file != "index.md" && splitext(file)[2] == ".md"
]
],
Expand Down
17 changes: 14 additions & 3 deletions docs/src/demo.jl → docs/src/10-tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@
using ThreeBodyDecays # import the module
using Plots
using QuadGK
theme(:wong2)
#
theme(
:wong,
frame = :box,
lab = "",
minorticks = true,
guidefontvalign = :top,
guidefonthalign = :right,
xlim = (:auto, :auto),
ylim = (0, :auto),
grid = false,
)

# decay Λb ⟶ Jψ p K
constants = Dict("mJψ" => 3.09, "mp" => 0.938, "mK" => 0.49367, "mLb" => 5.62) # masses of the particles
Expand Down Expand Up @@ -74,7 +85,7 @@ end
Ps = Conserving,
tbs = tbs,
)
Λs = (Λ1520, Λ1690, Λ1810)
Λs = (Λ1520, Λ1690, Λ1810);

# chains-3, i.e. (1+2): Pentaquarks with the lowest ls, LS
Pc4312 = DecayChainLS(
Expand All @@ -98,7 +109,7 @@ Pc4457 = DecayChainLS(
Ps = Conserving,
tbs = tbs,
)
Pcs = (Pc4312, Pc4440, Pc4457)
Pcs = (Pc4312, Pc4440, Pc4457);

# ## Unpolarized intensity

Expand Down

0 comments on commit bc2ebd2

Please sign in to comment.