Navigation Menu

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

Rethink mime attribute #21

Closed
shaunix opened this issue Feb 15, 2015 · 2 comments
Closed

Rethink mime attribute #21

shaunix opened this issue Feb 15, 2015 · 2 comments

Comments

@shaunix
Copy link
Contributor

shaunix commented Feb 15, 2015

Mallard uses the mime attribute in two places: media and code blocks. Using a MIME type to specify the content type seems natural, but in practice it's hard to remember the right MIME type. This is especially true in code blocks, where there's not a registered MIME type for many languages. People just have to look up the x- MIME types that Yelp happens to understand.

For code blocks, it would be better to use a simple identifier like "c", "javascript", or "xml". That's what code highlighter libraries use anyway. And if we put that in a type attribute, we can take advantage of Ducktype's shorthand for type attributes, e.g.:

[code python]
def frobnicate(self):
    pass

Compare this to:

[code mime="text/x-python"]
def frobnicate(self):
    pass

We could even support multiple values in the type attribute. Space-separated type attributes isn't unprecendented in Mallard. This can help you match different values accepted by different tools, or provide more specific values with fallback, e.g.:

<code type="xslt xml">

Or in Ducktype:

[code xslt xml]

For media elements, the type attribute is already in use, and works well for what it does. Specifying the actual type is less frequently used in this case, although it's important for application-type media elements. Maybe we just keep the mime attribute for that. Or maybe we let media type be a space-separated list, where the first comes from the controlled list of "image", "video", "audio", and "application". Or maybe some other syntax.

@shaunix
Copy link
Contributor Author

shaunix commented Aug 31, 2017

@shaunix shaunix added this to the 1.2 milestone Jan 23, 2019
@shaunix
Copy link
Contributor Author

shaunix commented Jan 24, 2019

We handled the mime attribute on code in Issue #38. I've just opened Issue #55 for the media element. I'm closing this in favor of the element-specific issues.

@shaunix shaunix closed this as completed Jan 24, 2019
@shaunix shaunix removed this from the 1.2 milestone Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant