@@ -55,9 +55,9 @@ like [`string`](@ref) but preserves any annotations present in the arguments.
5555
5656# Examples
5757
58- ```julia-repl
58+ ```jldoctest; setup=:(using Base: AnnotatedString)
5959julia> 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)])
6161"this is an example annotated string"
6262```
6363"""
@@ -87,8 +87,8 @@ AnnotatedChar(s::S, annotations::Vector{$Annotation})
8787
8888# Examples
8989
90- ```julia-repl
91- julia> AnnotatedChar('j', :label => 1 )
90+ ```jldoctest; setup=:(using Base: AnnotatedChar)
91+ julia> AnnotatedChar('j', [( :label, 1)] )
9292'j': ASCII/Unicode U+006A (category Ll: Letter, lowercase)
9393```
9494"""
@@ -232,11 +232,11 @@ See also [`AnnotatedString`](@ref) and [`AnnotatedChar`](@ref).
232232
233233## Examples
234234
235- ```julia-repl
235+ ```jldoctest; setup=:(using Base: AnnotatedString, annotatedstring)
236236julia> annotatedstring("now a AnnotatedString")
237237"now a AnnotatedString"
238238
239- julia> annotatedstring(AnnotatedString("annotated", [(1:9, :label => 1)]), ", and unannotated")
239+ julia> annotatedstring(AnnotatedString("annotated", [(1:9, :label, 1)]), ", and unannotated")
240240"annotated, and unannotated"
241241```
242242"""
344344 annotate!(str::AnnotatedString, [range::UnitRange{Int}], label::Symbol, value)
345345 annotate!(str::SubString{AnnotatedString}, [range::UnitRange{Int}], label::Symbol, value)
346346
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)` .
348348To remove existing `label` annotations, use a value of `nothing`.
349349
350350The order in which annotations are applied to `str` is semantically meaningful,
@@ -365,7 +365,7 @@ annotate!(s::SubString{<:AnnotatedString}, label::Symbol, @nospecialize(val::Any
365365"""
366366 annotate!(char::AnnotatedChar, label::Symbol, value::Any)
367367
368- Annotate `char` with the pair ` label => value`.
368+ Annotate `char` with the labeled value `( label, value) `.
369369"""
370370annotate! (c:: AnnotatedChar , label:: Symbol , @nospecialize (val:: Any )) =
371371 (push! (c. annotations, Annotation ((; label, val))); c)
0 commit comments