Skip to content

Commit fa51593

Browse files
Standardize "Examples" heading section levels in docs (#14638)
* Convert "Examples" 3rd level headings to 2nd level when not under a 2nd level * Convert 1st level "Examples" heading to 2nd level
1 parent f2804b9 commit fa51593

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

lib/elixir/lib/calendar/date.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ defmodule Date do
321321
@doc """
322322
Converts the given date to a string according to its calendar.
323323
324-
### Examples
324+
## Examples
325325
326326
iex> Date.to_string(~D[2000-02-28])
327327
"2000-02-28"
@@ -399,7 +399,7 @@ defmodule Date do
399399
or other calendars in which the days also start at midnight.
400400
Attempting to convert dates from other calendars will raise an `ArgumentError`.
401401
402-
### Examples
402+
## Examples
403403
404404
iex> Date.to_iso8601(~D[2000-02-28])
405405
"2000-02-28"

lib/elixir/lib/calendar/datetime.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ defmodule DateTime do
10461046
its abbreviation, which means information is lost when converting to such
10471047
format.
10481048
1049-
### Examples
1049+
## Examples
10501050
10511051
iex> dt = %DateTime{year: 2000, month: 2, day: 29, zone_abbr: "CET",
10521052
...> hour: 23, minute: 0, second: 7, microsecond: {0, 0},
@@ -1390,7 +1390,7 @@ defmodule DateTime do
13901390
custom (but relatively common) representation which appends the time
13911391
zone abbreviation and full name to the datetime.
13921392
1393-
### Examples
1393+
## Examples
13941394
13951395
iex> dt = %DateTime{year: 2000, month: 2, day: 29, zone_abbr: "CET",
13961396
...> hour: 23, minute: 0, second: 7, microsecond: {0, 0},
@@ -1636,7 +1636,7 @@ defmodule DateTime do
16361636
not currently supported in Elixir's standard library but it is available
16371637
by third-party libraries.
16381638
1639-
### Examples
1639+
## Examples
16401640
16411641
iex> dt = DateTime.from_naive!(~N[2018-11-15 10:00:00], "Europe/Copenhagen", FakeTimeZoneDatabase)
16421642
iex> dt |> DateTime.add(3600, :second, FakeTimeZoneDatabase)

lib/elixir/lib/calendar/naive_datetime.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ defmodule NaiveDateTime do
761761
For readability, this function follows the RFC3339 suggestion of removing
762762
the "T" separator between the date and time components.
763763
764-
### Examples
764+
## Examples
765765
766766
iex> NaiveDateTime.to_string(~N[2000-02-28 23:00:13])
767767
"2000-02-28 23:00:13"
@@ -908,7 +908,7 @@ defmodule NaiveDateTime do
908908
Only supports converting naive datetimes which are in the ISO calendar,
909909
attempting to convert naive datetimes from other calendars will raise.
910910
911-
### Examples
911+
## Examples
912912
913913
iex> NaiveDateTime.to_iso8601(~N[2000-02-28 23:00:13])
914914
"2000-02-28T23:00:13"

lib/elixir/lib/calendar/time.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ defmodule Time do
225225
@doc """
226226
Converts the given `time` to a string.
227227
228-
### Examples
228+
## Examples
229229
230230
iex> Time.to_string(~T[23:00:00])
231231
"23:00:00"
@@ -334,7 +334,7 @@ defmodule Time do
334334
format, for human readability. It also supports the "basic" format through
335335
passing the `:basic` option.
336336
337-
### Examples
337+
## Examples
338338
339339
iex> Time.to_iso8601(~T[23:00:13])
340340
"23:00:13"

lib/elixir/lib/kernel.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2815,7 +2815,7 @@ defmodule Kernel do
28152815
This is most commonly used in pipelines, using the `|>/2` operator, allowing you
28162816
to pipe a value to a function outside of its first argument.
28172817
2818-
### Examples
2818+
## Examples
28192819
28202820
iex> 1 |> then(fn x -> x * 2 end)
28212821
2

lib/elixir/lib/list.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ defmodule List do
915915
916916
If `prefix` is an empty list, it returns `true`.
917917
918-
### Examples
918+
## Examples
919919
920920
iex> List.starts_with?([1, 2, 3], [1, 2])
921921
true
@@ -945,7 +945,7 @@ defmodule List do
945945
946946
If `suffix` is an empty list, it returns `true`.
947947
948-
### Examples
948+
## Examples
949949
950950
iex> List.ends_with?([1, 2, 3], [2, 3])
951951
true

lib/elixir/lib/version.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ defmodule Version do
442442
443443
If `string` is an invalid requirement, a `Version.InvalidRequirementError` is raised.
444444
445-
# Examples
445+
## Examples
446446
447447
iex> Version.parse_requirement!("== 2.0.1")
448448
Version.parse_requirement!("== 2.0.1")
@@ -485,7 +485,7 @@ defmodule Version do
485485
@doc """
486486
Converts the given version to a string.
487487
488-
### Examples
488+
## Examples
489489
490490
iex> Version.to_string(%Version{major: 1, minor: 2, patch: 3})
491491
"1.2.3"

0 commit comments

Comments
 (0)