Skip to content

Commit 8525126

Browse files
committed
Update docstring formatting
- Add syntax highlighting tags - Add headers for examples - Add backticks for monospace content
1 parent 4054c8d commit 8525126

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

docs/src/basicUsage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ If `TermInterface` is loaded (below), the `operation` method returns the outermo
344344

345345
The `Basic` type is a Julia type wrapping an underlying symengine object. When a Julia method is called on symbolic objects, the method almost always resolves to some call (via `ccall`) into the `libsymengine` C++ library. The design typically involves mutating a newly constructed `Basic` variable. Some allocations can be saved by calling the mutating version of the operations:
346346

347-
```
347+
```julia
348348
@vars x
349349
a = Basic()
350350
SymEngine.sin!(a, x)
@@ -359,7 +359,7 @@ There is an extension for `TermInterface` (and `SymbolicUtils`) which should all
359359

360360

361361
```@example symengine
362-
using SymbolicUtils;
362+
using SymbolicUtils
363363
@vars x
364364
simplify(sin(x)^2 + cos(x)^2)
365365
```

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This site contains the documentation and `julia` language bindings for the [Syme
1010
## Installation
1111
The package and dependencies can be obtained with standard `Pkg` calls.
1212

13-
```julia
13+
```julia-repl
1414
julia> Pkg.add("SymEngine")
1515
```
1616

src/dense-matrix.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ LinearAlgebra.factorize(M::CDenseMatrix) = factorize(convert(Matrix, M))
171171
"""
172172
LU decomposition for CDenseMatrix, dense matrices of symbolic values
173173
174-
Also: lufact(a, val{:false}) for non-pivoting lu factorization
174+
Also: `lufact(a, Val{:false})` for non-pivoting lu factorization
175175
"""
176176
function LinearAlgebra.lu(a::CDenseMatrix)
177177
l, u = dense_matrix_LU(a)

src/subs.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
99
Substitute values into a symbolic expression.
1010
11-
Examples
12-
```
11+
### Examples
12+
13+
```julia
1314
@vars x y
1415
ex = x^2 + y^2
1516
subs(ex, x, 1) # 1 + y^2
@@ -131,7 +132,7 @@ walk_expression(b) = convert(Expr, b)
131132
"""
132133
lambdify(ex, vars=[]; cse=false)
133134
134-
evaluates a symbolless expression or returns a function
135+
Evaluates a symbol-less expression or returns a function
135136
"""
136137
function lambdify(ex, vars=[])
137138
if length(vars) == 0
@@ -174,7 +175,7 @@ end
174175
function _lambdify(ex::Expr, vars)
175176
try
176177
fn = eval(Expr(:function,
177-
Expr(:call, gensym(), map(Symbol,vars)...),
178+
Expr(:call, gensym(), map(Symbol,vars)...),
178179
ex))
179180
(args...) -> invokelatest(fn, args...) # https://github.com/JuliaLang/julia/pull/19784
180181
catch err

src/types.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ _symbol(s::Symbol) = _symbol(string(s))
137137
138138
Construct symbolic value.
139139
140-
Examples:
141-
```
140+
### Examples
141+
142+
```julia
142143
a = symbols(:a)
143144
x = symbols("x")
144145
x,y = symbols("x y")
@@ -162,7 +163,7 @@ end
162163
163164
Macro to define 1 or more variables or symbolic function
164165
165-
Example
166+
### Examples
166167
```
167168
@vars x y z
168169
@vars x[1:4]

0 commit comments

Comments
 (0)