Skip to content

Commit 6952cba

Browse files
committed
strict docs
1 parent 78ab622 commit 6952cba

File tree

6 files changed

+24
-13
lines changed

6 files changed

+24
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ docs/site/
2121
# It records a fixed state of all packages used by the project. As such, it should not be
2222
# committed for packages, but should be committed for applications that require a static
2323
# environment.
24-
Manifest.toml
24+
Manifest.toml
25+
docs/src/assets/Project.toml

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
2+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
23
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
34
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
45

docs/make.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ makedocs(sitename = "NonlinearSolve.jl",
99
authors = "Chris Rackauckas",
1010
modules = [NonlinearSolve, NonlinearSolve.SciMLBase],
1111
clean = true, doctest = false,
12-
format = Documenter.HTML(analytics = "UA-90474609-3",
13-
assets = ["assets/favicon.ico"],
12+
strict = [
13+
:doctest,
14+
:linkcheck,
15+
:parse_error,
16+
:example_block,
17+
# Other available options are
18+
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block
19+
],
20+
format = Documenter.HTML(assets = ["assets/favicon.ico"],
1421
canonical = "https://docs.sciml.ai/NonlinearSolve/stable/"),
1522
pages = pages)
1623

docs/src/basics/FAQ.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This is addressed in a [Twitter thread with the author of the improved fzero](https://twitter.com/ChrisRackauckas/status/1544743542094020615).
66
On the test example:
77

8-
```julia
8+
```@example
99
using NonlinearSolve, BenchmarkTools
1010
1111
N = 100_000;
@@ -22,7 +22,7 @@ end
2222
2323
function f2(out, levels, u0)
2424
for i in 1:N
25-
out[i] = solve(IntervalNonlinearProblem{false}(IntervalNonlinearFunction{false}(myfun),
25+
out[i] = solve(NonlinearProblem{false}(IntervalNonlinearFunction{false}(myfun),
2626
u0, levels[i]), SimpleNewtonRaphson()).u
2727
end
2828
end

docs/src/tutorials/iterator_interface.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
There is an iterator form of the nonlinear solver which mirrors the DiffEq integrator interface:
44

5-
```julia
5+
```@example
6+
using NonlinearSolve
67
f(u, p) = u .* u .- 2.0
7-
u0 = 1.5 # brackets
8+
u0 = 1.5
89
probB = NonlinearProblem(f, u0)
910
cache = init(probB, NewtonRaphson()) # Can iterate the solver object
1011
solver = solve!(cache)

docs/src/tutorials/nonlinear.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ A nonlinear system $$f(u) = 0$$ is specified by defining a function `f(u,p)`,
44
where `p` are the parameters of the system. For example, the following solves
55
the vector equation $$f(u) = u^2 - p$$ for a vector of equations:
66

7-
```julia
7+
```@example
88
using NonlinearSolve, StaticArrays
99
1010
f(u,p) = u .* u .- p
1111
u0 = @SVector[1.0, 1.0]
1212
p = 2.0
1313
probN = NonlinearProblem{false}(f, u0, p)
14-
solver = solve(probN, NewtonRaphson(), tol = 1e-9)
14+
solver = solve(probN, NewtonRaphson(), reltol = 1e-9)
1515
```
1616

1717
where `u0` is the initial condition for the rootfind. Native NonlinearSolve.jl
@@ -24,9 +24,10 @@ AbstractArray for automatic differentiation.
2424
For scalar rootfinding problems, bracketing methods exist. In this case, one passes
2525
a bracket instead of an initial condition, for example:
2626

27-
```julia
28-
f(u, p) = u .* u .- 2.0
29-
u0 = (1.0, 2.0) # brackets
30-
probB = IntervalNonlinearProblem(f, u0)
27+
```@example
28+
using NonlinearSolve
29+
f(u, p) = u*u - 2.0
30+
uspan = (1.0, 2.0) # brackets
31+
probB = IntervalNonlinearProblem(f, uspan)
3132
sol = solve(probB, Falsi())
3233
```

0 commit comments

Comments
 (0)