mirror of
https://github.com/vale981/Looping.jl
synced 2025-03-04 08:51:39 -05:00
add docs
This commit is contained in:
parent
6abf712764
commit
fa996de265
6 changed files with 52 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
/Manifest.toml
|
||||
/.direnv/
|
||||
docs/build
|
||||
|
|
|
@ -5,6 +5,7 @@ version = "0.1.0"
|
|||
|
||||
[deps]
|
||||
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
LanguageServer = "2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
|
||||
|
|
5
docs/make.jl
Normal file
5
docs/make.jl
Normal file
|
@ -0,0 +1,5 @@
|
|||
push!(LOAD_PATH,"../src/")
|
||||
using Documenter, Looping
|
||||
|
||||
DocMeta.setdocmeta!(Looping.Utilities, :DocTestSetup, :(using Looping.Utilities); recursive=true)
|
||||
makedocs(sitename="Looping Documentation", modules=[Looping.Utilities], draft=false, strict=:doctest)
|
11
docs/src/index.md
Normal file
11
docs/src/index.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Looping.jl Documentation
|
||||
|
||||
Some numerical tools and experiments for the fiber loop reservoir
|
||||
engineering project.
|
||||
|
||||
|
||||
|
||||
```@contents
|
||||
Pages = ["modules/Utilities.md"]
|
||||
Depth = 3
|
||||
```
|
17
docs/src/modules/Utilities.md
Normal file
17
docs/src/modules/Utilities.md
Normal file
|
@ -0,0 +1,17 @@
|
|||
# Utilities
|
||||
|
||||
```@docs
|
||||
Looping.Utilities
|
||||
```
|
||||
|
||||
|
||||
```@meta
|
||||
CurrentModule = Looping.Utilities
|
||||
```
|
||||
|
||||
|
||||
|
||||
```@docs
|
||||
periodic_distance
|
||||
restrict_to_range
|
||||
```
|
|
@ -1,3 +1,6 @@
|
|||
"""
|
||||
Some common utilities that haven't yet made it into their own packagage.
|
||||
"""
|
||||
module Utilities
|
||||
|
||||
export periodic_distance
|
||||
|
@ -11,9 +14,10 @@ conditions for a chain of length `N`.
|
|||
|
||||
# Examples
|
||||
```jldoctest
|
||||
julia> periodic_difference(1,4,5)
|
||||
julia> periodic_distance(1, 4, 5)
|
||||
2
|
||||
julia> periodic_difference(1,3,5)
|
||||
|
||||
julia> periodic_distance(1, 3, 5)
|
||||
-2
|
||||
```
|
||||
"""
|
||||
|
@ -32,7 +36,17 @@ end
|
|||
"""
|
||||
restrict_to_range(x, border)
|
||||
|
||||
Returns the value `x` restricted to the range `[-border, border]`.
|
||||
Returns the value `x` restricted to the range `[-border, border]` by
|
||||
lettting it roll over to `+-border`.
|
||||
|
||||
# Examples
|
||||
```jldoctest
|
||||
julia> restrict_to_range(6, 5)
|
||||
-4
|
||||
|
||||
julia> restrict_to_range(5, 5)
|
||||
5
|
||||
```
|
||||
"""
|
||||
function restrict_to_range(x::Real, border::Real)
|
||||
sign = x ≥ border ? -1 : 1
|
||||
|
|
Loading…
Add table
Reference in a new issue