For citation template references we may also want to specify a subset of parameters to show first.
Links and citation mocks:
Version: unspecified
Severity: enhancement
Esanders | |
Aug 13 2014, 2:26 PM |
F18092: 1-02.png | |
Dec 3 2014, 1:33 AM |
F18090: context-03.png | |
Dec 3 2014, 1:33 AM |
For citation template references we may also want to specify a subset of parameters to show first.
Links and citation mocks:
Version: unspecified
Severity: enhancement
We could list template values in order until we run out of room, but this may not lead to desirable results, for example the first parameter in {{Cite web}} is URL.
A more complex solution would be to come up with a format for defining how to generate the summary of a template and store it in template data, either as a value on the column (summary order):
Field Desc Summary order
url ... null
publisher ... 2
title ... 1
date ... 3
month ... null
A simplified version of this would just flag one field as being used in the summary.
etc.
Or as a string concatenation message somewhere:
"{{{title}}}, {{{publisher}}} - {{{date}}}"
I think we'd much rather keep the current model of showing the name of something shown, or the value of something not shown (like for HTML comments)…
Any attempt to "parse" the template parameters is going to become very complex or fail to address the needs of wikis other than the English Wikipedia. How about just displaying the parsed content of the reference, stripped of links and any block markup, and limited to some length?
I played with it and the following sort of works for all reference node types. There must be a better way to do it, but I can't find one. (It also doesn't update the tooltip after reference contents are changed, probably because that is done deferred or something.)
ve.ce.MWReferenceNode.static.getDescription = function ( model ) { var refModel = ve.dm.MWReferenceModel.static.newFromReferenceNode( model ); var surface = ve.init.target.createSurface( refModel.getDocument() ); var text = $( surface.getView().$element ).text(); surface.destroy(); return text; };
(I tried messing around with ve.dm.Converter too, but it seems impossible to render the contents of templated references without involving the surface, probably because they're magically generated in ve.ce.)
(In reply to Bartosz Dziewoński from comment #6)
(I tried messing around with ve.dm.Converter too, but it seems impossible to
render the contents of templated references without involving the surface,
probably because they're magically generated in ve.ce.)
Yeah, this needs CE. I think we may have to rethink how we do descriptions a little.