Page MenuHomePhabricator

Ability to transclude only part of a page
Closed, ResolvedPublic

Description

Author: eric

Description:
Is there some way to mark text in a page as "named/exportable"?

For instance, on the memory-alpha.org wiki,(a wiki for the Star Trek universe),
there needs to be a way to pull the Episode descriptions into Episode listing pages.

To do that, the actual episode page would need certain pieces of information to
be named and exportable by some format. To reference this exportable text,
another article could use a link similar to templates {{page_name:exportedTextName}}


Version: unspecified
Severity: enhancement

Details

Reference
bz3911

Related Objects

StatusSubtypeAssignedTask
OpenFeatureNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:55 PM
bzimport set Reference to bz3911.
bzimport added a subscriber: Unknown Object (MLST).

eric wrote:

I guess the page exporting the text would need some kind of wiki-fied markup:

for example on http://memory-alpha.org/en/wiki/Demon (an episode of Voyager), in
the source text we'd have
{{description=''Voyager'', desperately low on fuel, finds deuterium on a highly
hostile "Demon class" planet.}}

...and would render as...

Voyager, desperately low on fuel, finds deuterium on a highly hostile "Demon
class" planet.

...and then the listing page http://memory-alpha.org/en/wiki/VOY#Season%204

*[[Demon]]: {{Demon:description}}

...which would render as...

*Demon: Voyager, desperately low on fuel, finds deuterium on a highly hostile
"Demon class" planet.

and wouldn't de-ref the actual description into the page text.

rowan.collins wrote:

Firstly, I'm changing the summary, because I don't see the sense in which this
is "reversing" anything. I've tried to sum up the solution you're proposing,
rather than the problem, since this is a feature request.

Secondly, what you're describing sounds a little bit like [[meta:Wikidata]], in
that it involves storing a kind of key-value pair separate from but attached to
the article. But that's still a very long way from implementation, so is
probably best forgotten for now.

Thirdly, I think there are ways of creating the desired effect with the current
software - none of them great, but all feasible. For instance:

  • wrap the entire article, except for the summary sentence, in "<noinclude> ...

</noinclude>" sections; this only allows you one section to transclude, and is
probably rather inefficient, but would mean that {{:Demon}} would show only the
summary

  • store the summary in a separate page ("Template:Demon summary",

"Demon/summary", or somesuch), and use the standard syntax to include it onto
both pages - that is, put {{Demon summary}} or {{:Demon/summary}} on both
"Demon" *and* "VOY"

Nonetheless, the idea of editting a section as part of the page, but storing it
separately (for reference elsewhere) is an interesting one, and would also be an
interesting approach to the "threaded wiki"/"LiquidThreads" discussion system
[see recent wikitech-l discussions]...

avarab wrote:

(In reply to comment #3)

  • wrap the entire article, except for the summary sentence, in "<noinclude> ...

</noinclude>" sections; this only allows you one section to transclude, and is
probably rather inefficient, but would mean that {{:Demon}} would show only the
summary

It makes much more sense to wrap only the summary sentence in <onlyinclude>
which would have the same effect, that only works in HEAD though.

rowan.collins wrote:

(In reply to comment #4)

It makes much more sense to wrap only the summary sentence in <onlyinclude>
which would have the same effect, that only works in HEAD though.

Ah, I wasn't aware that such a keyword existed; obviously this would be exactly
when you'd want it.

eric wrote:

Yeah, that notation of <nowiki>{{:Demon}}</nowiki> would work, and I appreciate the
suggestion. Unfortunately, its like taking a sledge hammer to a hang a picture on the wall.

Could this minimalist approach work sooner and pave the way for this improved data handling?

I hope it could be... the benefits of having this meta-data alongside the page, (even slightly
unstructured for the time being) could really begin push the wiki vision even further than I
even imagined...!

ssanbeg wrote:

If you only need one marked section, then marking it with <onlyinclude> and transcluding like {{:demon}} should be exactly what you want. If you want different sections with different names, then you can use the labeled section transclusion extension, which is used for that purpose on wikisource, etc. i.e.

<section begin='Voyager'/>, desperately low on fuel, finds deuterium on a highly hostile "Demon class" planet.<section end='Voyager'/>

{{#include:Demon|Voyager}}