@@ -55,9 +55,9 @@ like [`string`](@ref) but preserves any annotations present in the arguments.
55
55
56
56
# Examples
57
57
58
- ```julia-repl
58
+ ```jldoctest; setup=:(using Base: AnnotatedString)
59
59
julia> AnnotatedString("this is an example annotated string",
60
- [(1:18, :A => 1), (12:28, :B => 2), (18:35, :C => 3)])
60
+ [(1:18, :A, 1), (12:28, :B, 2), (18:35, :C, 3)])
61
61
"this is an example annotated string"
62
62
```
63
63
"""
@@ -87,8 +87,8 @@ AnnotatedChar(s::S, annotations::Vector{$Annotation})
87
87
88
88
# Examples
89
89
90
- ```julia-repl
91
- julia> AnnotatedChar('j', :label => 1 )
90
+ ```jldoctest; setup=:(using Base: AnnotatedChar)
91
+ julia> AnnotatedChar('j', [( :label, 1)] )
92
92
'j': ASCII/Unicode U+006A (category Ll: Letter, lowercase)
93
93
```
94
94
"""
@@ -232,11 +232,11 @@ See also [`AnnotatedString`](@ref) and [`AnnotatedChar`](@ref).
232
232
233
233
## Examples
234
234
235
- ```julia-repl
235
+ ```jldoctest; setup=:(using Base: AnnotatedString, annotatedstring)
236
236
julia> annotatedstring("now a AnnotatedString")
237
237
"now a AnnotatedString"
238
238
239
- julia> annotatedstring(AnnotatedString("annotated", [(1:9, :label => 1)]), ", and unannotated")
239
+ julia> annotatedstring(AnnotatedString("annotated", [(1:9, :label, 1)]), ", and unannotated")
240
240
"annotated, and unannotated"
241
241
```
242
242
"""
344
344
annotate!(str::AnnotatedString, [range::UnitRange{Int}], label::Symbol, value)
345
345
annotate!(str::SubString{AnnotatedString}, [range::UnitRange{Int}], label::Symbol, value)
346
346
347
- Annotate a `range` of `str` (or the entire string) with a labeled value (` label` => ` value`) .
347
+ Annotate a `range` of `str` (or the entire string) with a labeled value `( label, value)` .
348
348
To remove existing `label` annotations, use a value of `nothing`.
349
349
350
350
The order in which annotations are applied to `str` is semantically meaningful,
@@ -365,7 +365,7 @@ annotate!(s::SubString{<:AnnotatedString}, label::Symbol, @nospecialize(val::Any
365
365
"""
366
366
annotate!(char::AnnotatedChar, label::Symbol, value::Any)
367
367
368
- Annotate `char` with the pair ` label => value`.
368
+ Annotate `char` with the labeled value `( label, value) `.
369
369
"""
370
370
annotate! (c:: AnnotatedChar , label:: Symbol , @nospecialize (val:: Any )) =
371
371
(push! (c. annotations, Annotation ((; label, val))); c)
0 commit comments