Skip to content

Commit 07b803e

Browse files
committed
docs: replace xml-style markup with markdown in comments
Replace XML-style markup tags in comments with markdown equivalents: - <code>...</code> to `...` (inline code) - <tt>...</tt> to `...` (teletype/monospace) - <i>...</i> to *...* (italics/emphasis) - +...+ to `...` (parameter/variable references) Updated 80+ files across core source, headers, mrbgems, and libraries to use consistent markdown formatting in documentation comments. Handled edge cases including special characters like <=> operators. Co-authored-by: Atlassian Rovo Dev
1 parent 9589578 commit 07b803e

File tree

54 files changed

+828
-822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+828
-822
lines changed

include/mruby.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ MRB_API struct RClass* mrb_define_module_under_id(mrb_state *mrb, struct RClass
935935
* | `I` | inline struct | void *, struct RClass | `I!` gives `NULL` for `nil` |
936936
* | `&` | block | {mrb_value} | &! raises exception if no block given. |
937937
* | `*` | rest arguments | const {mrb_value} *, {mrb_int} | Receive the rest of arguments as an array; `*!` avoid copy of the stack. |
938-
* | <code>\|</code> | optional | | After this spec following specs would be optional. |
938+
* | `\|` | optional | | After this spec following specs would be optional. |
939939
* | `?` | optional given | {mrb_bool} | `TRUE` if preceding argument is given. Used to check optional argument is given. |
940940
* | `:` | keyword args | {mrb_kwargs} const | Get keyword arguments. @see mrb_kwargs |
941941
*

lib/mruby/build/command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ def setup_debug(conf)
144144
#
145145
# === Example of +.d+ file
146146
#
147-
# ==== Without <tt>-MP</tt> compiler flag
147+
# ==== Without `-MP` compiler flag
148148
#
149149
# /build/host/src/array.o: /src/array.c \
150150
# /include/mruby/common.h /include/mruby/value.h \
151151
# /src/value_array.h
152152
#
153-
# ==== With <tt>-MP</tt> compiler flag
153+
# ==== With `-MP` compiler flag
154154
#
155155
# /build/host/src/array.o: /src/array.c \
156156
# /include/mruby/common.h /include/mruby/value.h \

mrbgems/mruby-array-ext/mrblib/array.rb

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ class Array
44
# ary.uniq! -> ary or nil
55
# ary.uniq! { |item| ... } -> ary or nil
66
#
7-
# Removes duplicate elements from +self+.
8-
# Returns <code>nil</code> if no changes are made (that is, no
7+
# Removes duplicate elements from `self`.
8+
# Returns `nil` if no changes are made (that is, no
99
# duplicates are found).
1010
#
1111
# a = [ "a", "a", "b", "b", "c" ]
@@ -42,7 +42,7 @@ def uniq!(&block)
4242
# ary.uniq -> new_ary
4343
# ary.uniq { |item| ... } -> new_ary
4444
#
45-
# Returns a new array by removing duplicate values in +self+.
45+
# Returns a new array by removing duplicate values in `self`.
4646
#
4747
# a = [ "a", "a", "b", "b", "c" ]
4848
# a.uniq #=> ["a", "b", "c"]
@@ -78,15 +78,15 @@ def reverse_each(&block)
7878
# ary.fetch(index, default) -> obj
7979
# ary.fetch(index) { |index| block } -> obj
8080
#
81-
# Tries to return the element at position +index+, but throws an IndexError
82-
# exception if the referenced +index+ lies outside of the array bounds. This
81+
# Tries to return the element at position `index`, but throws an IndexError
82+
# exception if the referenced `index` lies outside of the array bounds. This
8383
# error can be prevented by supplying a second argument, which will act as a
84-
# +default+ value.
84+
# `default` value.
8585
#
8686
# Alternatively, if a block is given it will only be executed when an
87-
# invalid +index+ is referenced.
87+
# invalid `index` is referenced.
8888
#
89-
# Negative values of +index+ count from the end of the array.
89+
# Negative values of `index` count from the end of the array.
9090
#
9191
# a = [ 11, 22, 33, 44 ]
9292
# a.fetch(1) #=> 22
@@ -122,17 +122,17 @@ def fetch(n, ifnone=NONE, &block)
122122
# ary.fill(start [, length] ) { |index| block } -> ary
123123
# ary.fill(range) { |index| block } -> ary
124124
#
125-
# The first three forms set the selected elements of +self+ (which
126-
# may be the entire array) to +obj+.
125+
# The first three forms set the selected elements of `self` (which
126+
# may be the entire array) to `obj`.
127127
#
128-
# A +start+ of +nil+ is equivalent to zero.
128+
# A `start` of `nil` is equivalent to zero.
129129
#
130-
# A +length+ of +nil+ is equivalent to the length of the array.
130+
# A `length` of `nil` is equivalent to the length of the array.
131131
#
132132
# The last three forms fill the array with the value of the given block,
133133
# which is passed the absolute index of each element to be filled.
134134
#
135-
# Negative values of +start+ count from the end of the array, where +-1+ is
135+
# Negative values of `start` count from the end of the array, where +-1+ is
136136
# the last element.
137137
#
138138
# a = [ "a", "b", "c", "d" ]
@@ -174,7 +174,7 @@ def fill(arg0=nil, arg1=nil, arg2=nil, &block)
174174
# ary.delete_if { |item| block } -> ary
175175
# ary.delete_if -> Enumerator
176176
#
177-
# Deletes every element of +self+ for which block evaluates to +true+.
177+
# Deletes every element of `self` for which block evaluates to `true`.
178178
#
179179
# The array is changed instantly every time the block is called, not after
180180
# the iteration is over.
@@ -206,8 +206,8 @@ def delete_if(&block)
206206
# ary.reject! { |item| block } -> ary or nil
207207
# ary.reject! -> Enumerator
208208
#
209-
# Equivalent to Array#delete_if, deleting elements from +self+ for which the
210-
# block evaluates to +true+, but returns +nil+ if no changes were made.
209+
# Equivalent to Array#delete_if, deleting elements from `self` for which the
210+
# block evaluates to `true`, but returns `nil` if no changes were made.
211211
#
212212
# The array is changed instantly every time the block is called, not after
213213
# the iteration is over.
@@ -349,8 +349,8 @@ def bsearch_index(&block)
349349
# ary.keep_if { |item| block } -> ary
350350
# ary.keep_if -> Enumerator
351351
#
352-
# Deletes every element of +self+ for which the given block evaluates to
353-
# +false+.
352+
# Deletes every element of `self` for which the given block evaluates to
353+
# `false`.
354354
#
355355
# See also Array#select!
356356
#
@@ -379,10 +379,10 @@ def keep_if(&block)
379379
# ary.select! {|item| block } -> ary or nil
380380
# ary.select! -> Enumerator
381381
#
382-
# Invokes the given block passing in successive elements from +self+,
383-
# deleting elements for which the block returns a +false+ value.
382+
# Invokes the given block passing in successive elements from `self`,
383+
# deleting elements for which the block returns a `false` value.
384384
#
385-
# If changes were made, it will return +self+, otherwise it returns +nil+.
385+
# If changes were made, it will return `self`, otherwise it returns `nil`.
386386
#
387387
# See also Array#keep_if
388388
#
@@ -409,9 +409,9 @@ def select!(&block)
409409
# call-seq:
410410
# ary.dig(idx, ...) -> object
411411
#
412-
# Extracts the nested value specified by the sequence of <i>idx</i>
413-
# objects by calling +dig+ at each step, returning +nil+ if any
414-
# intermediate step is +nil+.
412+
# Extracts the nested value specified by the sequence of *idx*
413+
# objects by calling `dig` at each step, returning `nil` if any
414+
# intermediate step is `nil`.
415415
#
416416
def dig(idx,*args)
417417
idx = idx.__to_int
@@ -430,10 +430,10 @@ def dig(idx,*args)
430430
# ary.permutation(n) { |p| block } -> ary
431431
# ary.permutation(n) -> Enumerator
432432
#
433-
# When invoked with a block, yield all permutations of length +n+ of the
433+
# When invoked with a block, yield all permutations of length `n` of the
434434
# elements of the array, then return the array itself.
435435
#
436-
# If +n+ is not specified, yield all permutations of all elements.
436+
# If `n` is not specified, yield all permutations of all elements.
437437
#
438438
# The implementation makes no guarantees about the order in which the
439439
# permutations are yielded.
@@ -478,7 +478,7 @@ def permutation(n=self.size, &block)
478478
# ary.combination(n) { |c| block } -> ary
479479
# ary.combination(n) -> Enumerator
480480
#
481-
# When invoked with a block, yields all combinations of length +n+ of elements
481+
# When invoked with a block, yields all combinations of length `n` of elements
482482
# from the array and then returns the array itself.
483483
#
484484
# The implementation makes no guarantees about the order in which the
@@ -554,9 +554,9 @@ def transpose
554554
# ary.to_h -> Hash
555555
# ary.to_h{|item| ... } -> Hash
556556
#
557-
# Returns the result of interpreting <i>array</i> as an array of
558-
# <tt>[key, value]</tt> pairs. If a block is given, it should
559-
# return <tt>[key, value]</tt> pairs to construct a hash.
557+
# Returns the result of interpreting *array* as an array of
558+
# `[key, value]` pairs. If a block is given, it should
559+
# return `[key, value]` pairs to construct a hash.
560560
#
561561
# [[:foo, :bar], [1, 2]].to_h
562562
# # => {:foo => :bar, 1 => 2}
@@ -584,8 +584,8 @@ def to_h(&blk)
584584
# ary.fetch_values(idx, ...) { |i| block } -> array
585585
#
586586
# Returns an array containing the values associated with the given indexes.
587-
# but also raises <code>IndexError</code> when one of indexes can't be found.
588-
# Also see <code>Array#values_at</code> and <code>Array#fetch</code>.
587+
# but also raises `IndexError` when one of indexes can't be found.
588+
# Also see `Array#values_at` and `Array#fetch`.
589589
#
590590
# a = ["cat", "dog", "cow"]
591591
#
@@ -658,7 +658,7 @@ class << list; alias []= call; end
658658
# ary.repeated_combination(n) { |combination| ... } -> self
659659
# ary.repeated_combination(n) -> enumerator
660660
#
661-
# A +combination+ method that contains the same elements.
661+
# A `combination` method that contains the same elements.
662662
def repeated_combination(n, &block)
663663
raise TypeError, "no implicit conversion into Integer" unless 0 <=> n
664664
return to_enum(:repeated_combination, n) unless block
@@ -670,7 +670,7 @@ def repeated_combination(n, &block)
670670
# ary.repeated_permutation(n) { |permutation| ... } -> self
671671
# ary.repeated_permutation(n) -> enumerator
672672
#
673-
# A +permutation+ method that contains the same elements.
673+
# A `permutation` method that contains the same elements.
674674
def repeated_permutation(n, &block)
675675
n = n.__to_int
676676
raise TypeError, "no implicit conversion into Integer" unless 0 <=> n

0 commit comments

Comments
 (0)