Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MIME docstring #56942

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

nathanrboyer
Copy link
Contributor

Closes #56768

@nsajko nsajko added docs This change adds or pertains to documentation display and printing Aesthetics and correctness of printed representations of objects. labels Jan 3, 2025
@giordano giordano requested a review from stevengj January 4, 2025 02:15
A type representing a standard internet data format. "MIME" stands for
"Multipurpose Internet Mail Extensions", since the standard was originally
used to describe multimedia attachments to email messages.
A parametric type representing a standard internet data format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A parametric type representing a standard internet data format.
A parametric type representing a content type/format, which is used to define [`show`](@ref)
methods to output objects in different formats and allows [`display(x)`](@ref) to detect
which formats are available for a given `x` in a particular display environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MIME type is only used for the show function? Should the docstring limit the type's usage in this way?

base/multimedia.jl Outdated Show resolved Hide resolved
base/multimedia.jl Outdated Show resolved Hide resolved
base/multimedia.jl Outdated Show resolved Hide resolved
Comment on lines 34 to 35
[`@MIME_str`](@ref) is defined to simplify creation of singleton types in this way,
e.g. `MIME"text/plain"`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[`@MIME_str`](@ref) is defined to simplify creation of singleton types in this way,
e.g. `MIME"text/plain"`.
The string macro [`@MIME_str`](@ref) allow you to specify `MIME{Symbol("...")}` types more succinctly
as `MIME"..."`, for example `MIME"text/plain"`.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I slightly rewrote this.

base/multimedia.jl Outdated Show resolved Hide resolved
Comment on lines 40 to 41
A `MIME` object can be passed as the second argument to [`show`](@ref)
to request output in that format.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A `MIME` object can be passed as the second argument to [`show`](@ref)
to request output in that format.
A `mime::MIME` instance can be passed as the second argument to [`show(io, mime, x)`](@ref)
to request output in that format (if it is implemented for `x`), as well as to various other functions like
[`showable`](@ref), [`repr`](@ref), and [`display`](@ref); most such functions also allow you to
pass a string (e.g. `"text/plain"`) that will be converted to a `MIME` instance for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I slightly rewrote this to avoid "you".

base/multimedia.jl Outdated Show resolved Hide resolved
nathanrboyer and others added 8 commits January 6, 2025 08:01
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs information on MIMEs?
3 participants