Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit e2a85c1

Browse files
authored
fix julia scripts in markdown (#90)
* add missing language specification in md * replace type with struct
1 parent 7544a38 commit e2a85c1

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

docs/src/internals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defines
99
RecipesBase.apply_recipe(plotattributes, args...; kwargs...)
1010
```
1111
returning a `Vector{RecipeData}` where `RecipeData` holds the `plotattributes` Dict and the arguments returned in [`@recipe`](@ref) or in [`@series`](@ref).
12-
```
12+
```julia
1313
struct RecipeData
1414
plotattributes::AbstractDict{Symbol,Any}
1515
args::Tuple

docs/src/types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ We have already seen an example for a user recipe in the syntax section above.
104104
User recipes can also be used to define a custom visualization without necessarily wishing to plot a custom type.
105105
For this purpose we can create a type to dispatch on.
106106
The [`@userplot`](@ref) macro is a convenient way to do this.
107-
```
107+
```julia
108108
@userplot MyPlot
109109
```
110110
expands to
111-
```
111+
```julia
112112
mutable struct MyPlot
113113
args
114114
end
@@ -119,7 +119,7 @@ myplot!(args...; kw...) = plot!(MyPlot(args); kw...)
119119

120120
To check `args` type, define a struct with type parameters.
121121

122-
```
122+
```julia
123123
@userplot struct MyPlot{T<:Tuple{AbstractVector}}
124124
args::T
125125
end
@@ -259,11 +259,11 @@ We can define a seriestype `:yscaleplot`, that automatically shows data with a l
259259
end
260260
```
261261
We can call it with `plot(...; ..., seriestype = :yscaleplot)` or we can define a shorthand with the [`@shorthands`](@ref) macro.
262-
```
262+
```julia
263263
@shorthands myseries
264264
```
265265
expands to
266-
```
266+
```julia
267267
export myseries, myseries!
268268
myseries(args...; kw...) = plot(args...; kw..., seriestype = :myseries)
269269
myseries!(args...; kw...) = plot!(args...; kw..., seriestype = :myseries)

src/RecipesBase.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ should replace the current arguments.
219219
220220
An example:
221221
222-
```
222+
```julia
223223
using RecipesBase
224224
225225
# Our custom type that we want to display
226-
type T end
226+
struct T end
227227
228228
@recipe function plot{N<:Integer}(t::T, n::N = 1; customcolor = :green)
229229
markershape --> :auto, :require
@@ -301,7 +301,7 @@ end
301301
"""
302302
Meant to be used inside a recipe to add additional RecipeData objects to the list:
303303
304-
```
304+
```julia
305305
@recipe function f(::T)
306306
# everything get this setting
307307
linecolor --> :red
@@ -334,7 +334,7 @@ end
334334

335335
"""
336336
You can easily define your own plotting recipes with convenience methods:
337-
```
337+
```julia
338338
@userplot GroupHist
339339
340340
@recipe function f(gh::GroupHist)

0 commit comments

Comments
 (0)