Page MenuHomePhabricator

RFC: Update profile URLs in content types to point to format documentation
Closed, ResolvedPublic

Description

The profile mime type parameter aims to provide a URL identifying a flavor of a more general format. While dereferencing of this URL is not required, we can make our content types more self-describing by using URLs that point to actual format documentation.

Linking to an entry in a hierachy of specs on MediaWiki.org would give us a convenient place to maintain and discuss format descriptions. Example URL:

The downside of using wiki pages is that we'll need to monitor changes for accuracy, but I think at this point this risk is out-weighed by the potential for contributions.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

We've already discussed this in another task, but I can't seem to find it now :/

Yeah, I unsuccessfully looked for it as well. Perhaps we only discussed this on IRC?

I created https://www.mediawiki.org/wiki/Specs/DOM/1.2.0 and tried to transclude https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec, but apparently my transclusion-fu is not what it used to be. I am only getting a mocking 'foo'. Anybody with stronger transclusion-fu around?

I created https://www.mediawiki.org/wiki/Specs/DOM/1.2.0 and tried to transclude https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec, but apparently my transclusion-fu is not what it used to be. I am only getting a mocking 'foo'. Anybody with stronger transclusion-fu around?

This appears to be because of a bug in MW. The page you're transcluding contains <tt><nowiki>foo<onlyinclude>bar</onlyinclude>baz</nowiki></tt>, and apparently <onlyinclude> is not ignored inside of <nowiki>.

Separately, I think we should get rid of "text/html; charset=utf-8;" pieces from the accept header. It is not like we are going to support anything other than text/html or a different charset for those endpoints. Thoughts?

Somewhat tangentially, I also made some dumb changes in https://gerrit.wikimedia.org/r/#/c/271929/5/lib/wt2html/DOMPostProcessor.js .. I think I should have added a version number for html and data-parsoid instead of adding the entire profile string there. I am going to update that with the next version bump.

I created https://www.mediawiki.org/wiki/Specs/DOM/1.2.0 and tried to transclude https://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec, but apparently my transclusion-fu is not what it used to be. I am only getting a mocking 'foo'. Anybody with stronger transclusion-fu around?

Instead of transcluding, wouldn't it be better to just link to the appropriate revision of the dom spec and indicate what changed since the previous version bump? I think the change info summary would be useful info instead of having to look at the entire dom spec without knowing what exactly changed since the previous version.

Separately, I think we should get rid of "text/html; charset=utf-8;" pieces from the accept header. It is not like we are going to support anything other than text/html or a different charset for those endpoints. Thoughts?

This would break standard HTML semantics, which expect the Accept header to supply the expected mime type(s).

Instead of transcluding, wouldn't it be better to just link to the appropriate revision of the dom spec and indicate what changed since the previous version bump?

I think we can just archive versions once they are superseded. I agree that a 'changes' section would be useful as well.

Generally, how about moving the master to the versioned path, and transcluding the latest version from the old location?

@Catrope: That's a fun bug. @ssastry, do you think it's worth creating a task for that?

We have now created several spec pages on MediaWiki.org:

https://www.mediawiki.org/wiki/Specs

Patches to update content types to this are under way:

This was merged and deployed a long time ago, profiles now point to specs on mediawiki, the ticket can be closed.