Closed Bug 1108479 Opened 10 years ago Closed 4 years ago

Option to replace templates within revision view

Categories

(developer.mozilla.org Graveyard :: Wiki pages, enhancement)

All
Other
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sebo, Unassigned)

References

Details

(Whiteboard: [specification][type:feature])

What problems would this solve?
===============================
Revisions are displayed without the templates they use being replaced. So there's no way to see the revision like when it was the current one.

Who would use this?
===================
Reviewers checking older revisions.

What would users see?
=====================
Reviewers would see previous revisions the same way as the current revision.

What would users do? What would happen as a result?
===================================================
It would improve the UX.

Is there anything else we should know?
======================================
This may be implemented as an option. I.e. by default the templates would not be replaced. And there would be a button to switch to the view with replaced templates.

Errors in templates (e.g. in case they don't exist anymore or changed in behavior) should be suppressed. In that case the template string might stay unreplaced, be replaced by an empty string or be replaced by a message telling the user why the template string can't be replaced.
needinfo'ing :groovecoder to say if this is even possible.  If it is, it would involve either storing fully rendered past revisions, which would greatly increase the db size.
Severity: normal → enhancement
Component: General → Wiki pages
Flags: needinfo?(lcrouch)
(In reply to Māris Fogels [:mars] from comment #1)
> needinfo'ing :groovecoder to say if this is even possible.  If it is, it
> would involve either storing fully rendered past revisions, which would
> greatly increase the db size.

Isn't it possible to dynamically replace the templates?

Sebastian
:davidwalsh - Would it be possible to render templates while viewing historical revisions by POSTing the revision's content to the same $preview call we use while editing?

But, we don't include a specific *revision* of templates in docs, so when you're viewing the old revision content with template output, the templates would be the newest templates. I.e., it may not be the content that was actually rendered for the older revision. It will be old content mixed with new template content.
Flags: needinfo?(lcrouch) → needinfo?(dwalsh)
(In reply to Luke Crouch [:groovecoder] from comment #3)
> But, we don't include a specific *revision* of templates in docs, so when
> you're viewing the old revision content with template output, the templates
> would be the newest templates. I.e., it may not be the content that was
> actually rendered for the older revision. It will be old content mixed with
> new template content.

Would be ok for me. Though, against my initial description, maybe it would even be better to just make a snapshot of the page with replaced templates. I.e. save the generated HTML. Would that be an option? Does something speak against that?

Sebastian
We would have to add a rendered_content property to the Revision objects. Rendered content can be much larger than un-rendered content. (e.g., the JavaScript page is 12.2k un-rendered vs. 30.8k rendered) So there's a risk that the database size will grow too large.

I wouldn't do it without a more compelling value to store every revision's rendered content.
groovecoder:  I guess so?  I wouldn't do anything like that, however, until we've solidified/enhanced the preview feature.
Flags: needinfo?(dwalsh)
Thanks :davidwalsh; adding the blocker bug.
Depends on: 1038878
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.