Rosetta Code:Village Pump/Adding transclusion plugin: Difference between revisions
(Wanted extension not available) |
m (Mcint moved page Rosetta Code:Village Pump/Transclusion-Content from other pages to Rosetta Code:Village Pump/Adding transclusion plugin: Refocusing page as plugin proposal. Other vp topics already cover desire for language-aggregation pages.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Vptopic |
{{Vptopic |
||
|topic=Adding transclusion plugin |
|||
|topic=Transclusion-Content from other pages |
|||
|summary=Suggestion to add an existing mediawiki plugin, Transclusion, to address other village pump topics |
|||
|summary=Creating a template page which will extract content from existing pages on the fly and present cross-cutting content. For example, a page of all examples in a particular language |
|||
}} |
}} |
||
==Relevant vp-topics== |
|||
==Likely relevant tasks== |
|||
⚫ | |||
I think this is relevant to |
|||
⚫ | |||
# [[Rosetta Code:Village Pump/Download Perl Code]] |
# [[Rosetta Code:Village Pump/Download Perl Code]] |
||
⚫ | |||
⚫ | |||
but I'd like to wait until I have a working small example to add to those pages. |
|||
⚫ | |||
==MediaWiki support and documentation== |
==MediaWiki support and documentation== |
||
[[mw:Transclusion|Transclusion]] is the inclusion of content by reference. MediaWiki has a [[mw:Extension:Labeled_Section_Transclusion|plugin]] for it, which would be ready for use in RosettaCode thanks to consistent use of headers per-programming language, through the [[mw:Extension:Labeled_Section_Transclusion#Transcluding_sections_by_headings|header-based transclusion]] command it adds to wiki markup. |
|||
[[mw:Transclusion|MediaWiki:Transclusion]] has background information and favors one use case, |
|||
The plugin is not currently installed, according to the [[Special:Version]] page. |
|||
but it also mentions [[mw:Extension:Labeled_Section_Transclusion|MediaWiki:Extension:Labeled_Section_Transclusion]], |
|||
⚫ | |||
which has a particularly useful section in [[mw:Extension:Labeled_Section_Transclusion#Transclude_a_specific_section]] |
|||
=Transclusion scratch space= |
|||
It says the function can be called as follows: |
It says the function can be called as follows: |
||
{{#lsth:pagename|sectionX}} |
{{#lsth:pagename|sectionX}} |
||
===Current (guesses) conclusions=== |
|||
Current guess is that using the <nowiki>{{header|...}}</nowiki> macro in a section name is preventing the title from being recognized to do the transclusion |
Current guess is that using the <nowiki>{{header|...}}</nowiki> macro in a section name is preventing the title from being recognized to do the transclusion |
||
: The extension "Labeled Section Transclusion" isn't available on Rosetta Code. Thus <code>lsth</code> isn't recognized as a parser hook and the whole <code>{{#...}}</code> part is interpreted as normal text. --[[User:AndiPersti|Andreas Perstinger]] ([[User talk:AndiPersti|talk]]) 09:25, 25 September 2015 (UTC) |
: The extension "Labeled Section Transclusion" isn't available on Rosetta Code. Thus <code>lsth</code> isn't recognized as a parser hook and the whole <code>{{#...}}</code> part is interpreted as normal text. --[[User:AndiPersti|Andreas Perstinger]] ([[User talk:AndiPersti|talk]]) 09:25, 25 September 2015 (UTC) |
||
==Attempted Usage== |
|||
I would like to call: |
I would like to call: |
||
<nowiki>=={{header|OCaml}}==</nowiki> |
<nowiki>=={{header|OCaml}}==</nowiki> |
||
from the [[Pythagorean triples]] page |
from the [[Pythagorean triples]] page. Also not working: |
||
not working: |
|||
<nowiki>{{#lsth:Pythagorean triples|OCaml}}</nowiki> |
<nowiki>{{#lsth:Pythagorean triples|OCaml}}</nowiki> |
||
{{#lsth:Pythagorean triples|OCaml}} |
{{#lsth:Pythagorean triples|OCaml}} |
||
nor: |
|||
nor does |
|||
<nowiki>{{#lsth:Pythagorean triples|{{header|OCaml}}}}</nowiki> |
<nowiki>{{#lsth:Pythagorean triples|{{header|OCaml}}}}</nowiki> |
||
{{#lsth:Pythagorean triples|{{header|OCaml}}}} |
{{#lsth:Pythagorean triples|{{header|OCaml}}}} |
Latest revision as of 06:03, 5 December 2015
This is a particular discussion thread among many which consider Rosetta Code.
Summary
Suggestion to add an existing mediawiki plugin, Transclusion, to address other village pump topics
Discussion
Relevant vp-topics
- Rosetta Code:Village Pump/SMW Examples by language and concept
- Rosetta Code:Village Pump/Language template enhancements
- Rosetta Code:Village Pump/Download Perl Code
MediaWiki support and documentation
Transclusion is the inclusion of content by reference. MediaWiki has a plugin for it, which would be ready for use in RosettaCode thanks to consistent use of headers per-programming language, through the header-based transclusion command it adds to wiki markup.
The plugin is not currently installed, according to the Special:Version page.
--Mcint (talk) 05:51, 5 December 2015 (UTC)
Transclusion scratch space
It says the function can be called as follows:
{{#lsth:pagename|sectionX}}
Current guess is that using the {{header|...}} macro in a section name is preventing the title from being recognized to do the transclusion
- The extension "Labeled Section Transclusion" isn't available on Rosetta Code. Thus
lsth
isn't recognized as a parser hook and the whole{{#...}}
part is interpreted as normal text. --Andreas Perstinger (talk) 09:25, 25 September 2015 (UTC)
Attempted Usage
I would like to call:
=={{header|OCaml}}==
from the Pythagorean triples page. Also not working:
{{#lsth:Pythagorean triples|OCaml}}
{{#lsth:Pythagorean triples|OCaml}} nor:
{{#lsth:Pythagorean triples|{{header|OCaml}}}}
{{#lsth:Pythagorean triples|OCaml}}