Quantcast
Channel: openSUSE Forums
Viewing all articles
Browse latest Browse all 40713

Help with template.

$
0
0
Hi.

Given that the wiki has no support for references, I'm trying to workaround the problem in the Spanish wiki by using templates. I've done two of them: ref and Lista de referencias. The first one creates a code that simulates de link to the reference section, and the second creates an ordered list of up to 15 references.


  • ref has 3 parameters: the text of the reference, the target index of the reference and the index of the point of return and generates the code <span id="back index">text of reference</span><sup><span style="font-size: x-small">[[#target index|[target index]]]</span>
  • Lista de referencias is just a list with the text you want to show in the references list. It creates an ordered list with up to 15 references and adds links to go back to the original point.


Problem: Templates are more complicated and less extensible than they should because {{ #expr: }} doesn't allow a parameter of the form {{{1}}} (unnamed parameter). So I cannot use arithmetic to calculate the back index in both ref and Lista de referencias.
Any hints or a workaround to simplify the templates (use arithmetic with parameters)? You can see a working example in this page of the Spanish wiki. You don't need to know Spanish, just see the code and use the simulated references. If you don't understand something, you just ask and I'll try to do my best to explain it to you with my limited knowledge of the English language XD.

Greetings.

Viewing all articles
Browse latest Browse all 40713

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>