Skip to content

Styling issues on the Time class page in the Timezone Objects section #2220

@andrykonchin

Description

@andrykonchin

Formatting of a list in the Timezone Objects section on the Time class page is not accurate for Ruby 3.3 and Ruby 3.4 (Chrome Version 131.0.6778.205 (Official Build) (x86_64)).

Ruby 3.3

https://rubyapi.org/3.3/o/time#class-Time-label-Timezone+Objects

Issues:

  • a "nested" bulleted list is displayed on the same level as an "outer" one
  • multiline list items are shifted

Rendering:

Image

Original text is:

=== Timezone Objects

The zone value may be an object responding to certain timezone methods, an
instance of {Timezone}[https://github.com/panthomakos/timezone] and
{TZInfo}[https://tzinfo.github.io] for example.

The timezone methods are:

- +local_to_utc+:

  - Called when Time.new is invoked with +tz+
    as the value of positional argument +zone+ or keyword argument +in:+.
  - Argument: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects].
  - Returns: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects] in the UTC timezone.

- +utc_to_local+:

  - Called when Time.at or Time.now is invoked with +tz+
    as the value for keyword argument +in:+,
    and when Time#getlocal or Time#localtime is called with +tz+
    as the value for positional argument +zone+.
  - Argument: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects].
  - Returns: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects] in the local timezone.

Ruby 3.4

https://rubyapi.org/3.4/o/time#class-Time-label-Timezone+Objects

Issues:

  • some text (e.g. Argument:: ...) is rendered as a table or a section
  • a "nested" text (for each Ruby method) isn't displayed as nested, so I would expect some addition left padding

Rendering:

Image

Original text:

=== Timezone Objects

The zone value may be an object responding to certain timezone methods, an
instance of {Timezone}[https://github.com/panthomakos/timezone] and
{TZInfo}[https://tzinfo.github.io] for example.

The timezone methods are:

- +local_to_utc+:

  Called when Time.new is invoked with +tz+ as the value of positional
  argument +zone+ or keyword argument +in:+.

  Argument:: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects].
  Returns:: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects] in the UTC timezone.

- +utc_to_local+:

  Called when Time.at or Time.now is invoked with +tz+ as the value for
  keyword argument +in:+, and when Time#getlocal or Time#localtime is called
  with +tz+ as the value for positional argument +zone+.

  The UTC offset will be calculated as the difference between the
  original time and the returned object as an +Integer+.
  If the object is in fixed offset, its +utc_offset+ is also counted.

  Argument:: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects].
  Returns:: a {Time-like object}[rdoc-ref:Time@Time-Like+Objects] in the local timezone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions