Topic on Project:Support desk

How to use Cite extension in RTL projects?

46
49.230.1.137 (talkcontribs)

I want to implement a footnote creation mechanism similar to the one implemented in Hebrew Wikipedia in my own MediaWiki 1.34.0 based website (which is a personal and non communal website).

But,

According to my understanding, the footnote creation mechanism implemented in Hebrew Wikipedia includes the usage of at least five very complicated templates which require installing an external extension Scribunto:


template:footnote | תבנית:הערה

template:margin footnotes | תבנית:הערות שוליים

template:documentation | תבנית:תיעוד

template:parameter management | תבנית:ניהול פרמטרים

template:parameter management/content | תבנית:ניהול פרמטרים/תוכן


Contemplating these templates:

Even if I totally strip out all <templatedata> and [[category:]] ([[קטגוריה:]]) mambo jambo, I am still left with five templates which I personally find too many, too complex, too dense and too confusing and too hard to maintain;


How to use Cite extension in RTL projects (most desirably without all these complexity and without installing Scribunto)?

Bawolff (talkcontribs)
49.230.1.137 (talkcontribs)

@Bawolff Humbly I can, but why was it so important to the Hebrew Wikipedia staff to create all the Scribunto-oriented complexity I have demonstrated if, as one could understand from your suggestion, just following Cite instructions would be enough?

Malyacko (talkcontribs)

There is no "Hebrew Wikipedia staff". You could however ask the community on Hebrew Wikipedia if you want to find out...

49.230.1.137 (talkcontribs)
49.230.1.137 (talkcontribs)

@Malyacko by "staff" I meant to the relevant community members.

I have tried to ask there in the past and didn't answers I recognized as clear.

Thus, I now ask here.

Bawolff (talkcontribs)

because they thought it made things easier and allowed for more consistent formatting.

49.230.1.137 (talkcontribs)

What goes in other RTL Wikis,


@AhmadF.Cheema perhaps you can opinion about Arabic Wikis or if the methodology of Hebrew Wikipedia might be outdated.

AhmadF.Cheema (talkcontribs)

Apologies, but I haven't done any work on Arabic Wikipedia to be able to comment on this.🤔

49.230.1.137 (talkcontribs)

@Bawolff following your above advice I checked the Cite documentation you linked to;

I didn't find the term "RTL" in that page or in any of its linked pages.

Bawolff (talkcontribs)

it works the same way as ltr languages.

49.230.1.137 (talkcontribs)

@Bawolff I'm not sure that that statement is accurate, for example,

If instead <ref> tags one wants {{הערה|תוכן}} to which a plausible translation is {{footnote|CONTENT}}, let along {{footnote|name="xyz"|CONTENT}}, one needs, a significantly configurated Cite extension and possibly also Scribunto extension (if I'm not wrong the | notes require Lua/Scribunto to be parsed).

Using {{הערה|תוכן}} is a comfortable way to make footnotes with RTL languages were <ref> tags would get jumbled in RTL mode.

Thoughts?

Bawolff (talkcontribs)

you can either use defaults and be ok with bidi issues, make your own template that's a simple version (e.g. create a template page of your choice of name containing {{#tag:ref|{{{1}}}}}), or use the prebuilt one.

49.230.1.137 (talkcontribs)

@Bawolff I am not okay with these issues :)

{{#tag:ref|{{{1}}}}} requires Scribunto doesn't it? And anyway this example isn't very clear to me; is there a guide you recommend others and myself to read to understand this code structure?

I don't know what you meant by "prebuilt one".

Kindly,

AhmadF.Cheema (talkcontribs)

Regarding the complicated templates and modules, it should be pointed out that probably most of the times the authors of those templates wouldn't be active in answering questions or they might even have forgotten their reasoning for a particular portion of the code. Furthermore, it would take a long time to explain everything. Therefore, it is extremely unlikely that you would get a detailed explanation for those templates and modules.

For the most part, there is going to be a good reason for the added complications, and most users and MediaWiki admins don't need to worry about those reasons.


To include the Cite functionality, most admins just need to enable the Cite and Scribunto extensions, and export the relevant templates (using מיוחד:ייצוא with לכלול תבניות checked) into their MediaWiki installation. There shouldn't be any need to further configure the Cite and Scribunto extensions.

You should look at how the Hebrew Wikipedia calls or makes use of their citation templates and try to mirror it.

49.230.1.137 (talkcontribs)

@AhmadF.Cheema thanks ; but, in general I like to understand codes I work with and in this case I fell I shouldn't make an exception.

I think that a simpler option would be to work with JavaScript but this could bring all sorts of browser and SEO issues.

So, I wonder:

If all I need is

{{שם|תוכן="xyz"|הערה}}

Which in LTR would be:

{{footnote|name="xyz"|CONTENT}}

Can I indeed work only with two templates with Cite and Scribunto or must I work with all five templates of Hebrew WIkipedia (say, by exporting them to my Wiki)?

182.232.53.70 (talkcontribs)

@Bawolff wrote in this topic:

please stop spreading the same question over multiple threads;

I couldn't reply there so I reply here:

I have no such intention; I dare dealing with this "fragile" topic with almost zero relevant documentation and should be more careful yes but perhaps a bit more patience from your side your be helpful.

I suggest to migrate Mark's comment to the "old" topic (which might be interpreted as essentially different) and then delete the current thread.

182.232.53.70 (talkcontribs)
MarkAHershberger (talkcontribs)

Sure:

> They're complex because they capture how footnotes have been used over the past 15+ years on hewiki.

> If you don't need that complexity, then you should be fine with something simpler. You could probably build something really, really simple for your own wiki.

182.232.53.70 (talkcontribs)

your be = would be*

182.232.53.70 (talkcontribs)

@MarkAHershberger by something "really really simple" do you encapsulate a "Cite only" ("core only") approach or whould you say that if I want something such as:

{{שם|תוכן="xyz"|הערה}}

(LTR example):

{{footnote|name="xyz"|CONTENT}}

I have no choice but to use Scribunto?

MarkAHershberger (talkcontribs)

I don't know what your needs are. Why not just use Cite?

182.232.61.249 (talkcontribs)

@MarkAHershberger My need in that context is to create a footnote creation mechanism which also allows naming certain footnotes so I could call footnotes which I have already created and also named instead making a full clone of each such footnote I have already created (that is, having the same footnote two or more times in the same article, instead just one and call it in many different place).

Side note

Because, in RTL edit mode, <ref> tags (or any other set of tags) gets jumbled with RTL text, than I need to create them via a footnote template call such as as {{שם|תוכן="xyz"|הערה}}

The above footnote template call is very much equivalent to this LTR version:

{{footnote|name="xyz"|CONTENT}}

Of course, this LTR version is redundant in LTR websites where you can just have <ref name="xyz"> without having RTL text jumbling up with these <ref> tags.

Summary

So this is all my need in that context --- just to have a simple footnote creation mechanism which allows naming and most preferably core only (i.e, without installing Scribunto, although I would install it if I have to).

49.230.134.110 (talkcontribs)
MarkAHershberger (talkcontribs)

So, since

  • cite allows you to have named footnotes and
  • a template wrapper like {{שם|תוכן="xyz"|הערה}} would handle any RTL issue

it seems like you just need to use cite and write a simple wrapper template.

What am I missing?

182.232.31.33 (talkcontribs)

@MarkAHershberger I think it's primarily I who misses something.

What I miss is how to create a template that creates named <ref> tags (based on Cite) in RTL MediaWiki websites.

Template calls should look like this:

{{הערה|שם="שם"|תוכן}} (first call)

{{הערה|שם="שם"}} (secondary calls)

MarkAHershberger (talkcontribs)

Check out the Ref and Note templates on SimpleWiki. They don't use Scribunto or Cite.

182.232.172.66 (talkcontribs)

@MarkAHershberger at the start of both linked pages it was written:

Using ref/note tags is not the only way to do footnotes.

I have become confused from that sentence alone --- if I want to create named footnotes, should I always use both these prebuilt templates, or, say, for the simplest scenario, should I use just one of these, and if so, which one?

182.232.165.170 (talkcontribs)

Furthermore, when I go there (Simple Wiki) to template:reflist, I get a much more complicated list:


182.232.165.170 (talkcontribs)
MarkAHershberger (talkcontribs)

I don't know what to tell you. Go back a few years in history on reflist and get the pre-Scribunto version?

182.232.176.239 (talkcontribs)
182.232.176.239 (talkcontribs)
182.232.176.239 (talkcontribs)

@MarkAHershberger based on my two replies above and if it is okay please share with us:

If you install an RTL MediaWiki and you want to have named footnotes AND a footnotes chapter which are core-only and Cite-only based, so that you could call existing template-calls by name in the same page, how will you achieve that?

MarkAHershberger (talkcontribs)

I don't know what to tell you. This is not something I have done or know how to do. I can only suggest that other people here would have to help you out. That, or you could learn Lua.

For what its worth, I have only a cursory familiarity with Lua, but I haven't experienced any problem just using Scribunto code as is.

182.232.40.56 (talkcontribs)

I don't want to learn Lua or work with Scribunto if I don't have to - i.e for the sake of creating named & RTLized references.

Perhaps @AhmadF.Cheema had experience with this and would like to share with us his solution:

Ahmad, if you install an RTL MediaWiki and you want to have named footnotes AND a footnotes chapter which are core-only and Cite-onlybased, so that you could call existing template-calls by name in the same page, how will you achieve that?

AhmadF.Cheema (talkcontribs)

Sorry, no experience with this.🙁

182.232.40.56 (talkcontribs)

Community members, please tag someone who can help with this,

182.232.40.56 (talkcontribs)

Milestone !

I use this template to create a footnotes chapter:

<includeonly><references /></includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>

I use this template to create each footnote:

<includeonly><ref>{{{1}}}</ref></includeonly><noinclude>

[[קטגוריה:תבניות]]
</noinclude>

Now I do get numbered, clickable footnotes created in each webpage that contains footnotes, but, all my footnotes in each webpage look like this:

1. ↑ {{{1}}}
2. ↑ {{{1}}}
3. ↑ {{{1}}}
4. ↑ {{{1}}}
5. ↑ {{{1}}}

While I understand that the up-arrows are prebuilt and give the option to go back to the footnote number, I ask:

Why does is my footnote text doesn't appear at the footnotes chapter and instead I get {{{1}}} (nor it appears when hovering the number)?

AhmadF.Cheema (talkcontribs)

What is your "footnote text" exactly? The text between the <ref></ref> tags is supposed to be the footnote text, and in this example isn't it always {{{1}}}?

What exact code are you using to call the template in your article page?

182.232.40.56 (talkcontribs)

@AhmadF.Cheema my "footnote text" is any text given inside each template-call; for example:

{{הערה|תוכן}}

Where "תוכן" ("content") is any text given inside each template-call.

AhmadF.Cheema (talkcontribs)

Right, got it now. The {{{1}}} variables inside <ref></ref> tags can't work like this.

You'll have to use the following:

<includeonly>{{#tag:ref|{{{1}}}}}</includeonly><noinclude>
[[קטגוריה:תבניות]]
</noinclude>
182.232.40.56 (talkcontribs)

Finally ! Thanks to you @AhmadF.Cheema I can (backendly) create back and forth linked footnotes.

The only thing I miss now is naming footnotes so to call them by name instead re-creating them two or more times per article, and I want to do so without Lua/Scribunto.

While I think that the current topic should be marked as solved, I have started the following topic (which is in need of being updated with your code example), to understand if I can indeed name footnotes and calling them by name without Lua/Scribunto:

Topic:Vlgifegllx057yix

AhmadF.Cheema (talkcontribs)
182.232.44.48 (talkcontribs)

@AhmadF.Cheema yes, I thought it was a Lua command due to similarity with #invoke.

182.232.7.53 (talkcontribs)
Reply to "How to use Cite extension in RTL projects?"