Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Egbe Eugene
Hi All,

I am implementing template https://en.wikipedia.org/wiki/Template:Cite_web in
VE and after using the template code[1], I get results shown below

{{Cite web|url=
https://www.w3schools.com/jsref/jsref_replace.asp|title=W3Schools|last=W3Schools|first=W3Schools
}}

what I desire to get is

<ref>{{Cite web|url=
https://www.w3schools.com/jsref/jsref_replace.asp|title=W3Schools|last=W3Schools|first=W3Schools}
}</ref>

So I guess I am missing something. Please I need help with this.

Thanks
Eugene
--
[1] https://etherpad.wikimedia.org/p/Template_cite_with_VE
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Jaime Crespo
Hi,

On Tue, Dec 31, 2019 at 12:42 PM Egbe Eugene <[hidden email]> wrote:

> Hi All,
>
> I am implementing template https://en.wikipedia.org/wiki/Template:Cite_web
> in
> VE and after using the template code[1], I get results shown below
>

Sorry, I may not be understanding what you are trying to accomplish, I am
guessing reimplementing Cite_web functionality on your own local mediawiki
installation?
I don't know much about visual editor or references-related code, someone
else may be able to help you here better, but I know that is implemented on
enwiki:
https://phab.wmfusercontent.org/file/data/wz3njgh6k6iwrugvap6f/PHID-FILE-n6el7aiazixa4mwb2rq2/Screenshot_20191231_150008.png
https://en.wikipedia.org/w/index.php?title=User:JCrespo_(WMF)/sandbox&type=revision&diff=933365112&oldid=926096219&diffmode=visual

So my only suggestion is to look at how enwiki has it configured and try to
adapt it to your needs.

Another suggestion is to use Phaste:
https://phabricator.wikimedia.org/paste/edit/form/14/ for code snippets, as
it will prevent vandals from editing it + allow comments.

Sorry I cannot be of more help,
--
Jaime Crespo
<http://wikimedia.org>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Eran Rosenthal
Hi Eugene,
Assuming it is local installation or wiki other than English wikipedia
where citations aren't yet configurated you can follow

E.g copy
https://en.wikipedia.org/wiki/MediaWiki:Citoid-template-type-map.json
and
https://en.wikipedia.org/wiki/MediaWiki:Visualeditor-cite-tool-definition.json

If you are doing it in one of Wikimedia projects and not local
installation, it will be great to update :
https://phabricator.wikimedia.org/T127354


On Tue, Dec 31, 2019 at 4:13 PM Jaime Crespo <[hidden email]> wrote:

> Hi,
>
> On Tue, Dec 31, 2019 at 12:42 PM Egbe Eugene <[hidden email]>
> wrote:
>
> > Hi All,
> >
> > I am implementing template
> https://en.wikipedia.org/wiki/Template:Cite_web
> > in
> > VE and after using the template code[1], I get results shown below
> >
>
> Sorry, I may not be understanding what you are trying to accomplish, I am
> guessing reimplementing Cite_web functionality on your own local mediawiki
> installation?
> I don't know much about visual editor or references-related code, someone
> else may be able to help you here better, but I know that is implemented on
> enwiki:
>
> https://phab.wmfusercontent.org/file/data/wz3njgh6k6iwrugvap6f/PHID-FILE-n6el7aiazixa4mwb2rq2/Screenshot_20191231_150008.png
>
> https://en.wikipedia.org/w/index.php?title=User:JCrespo_(WMF)/sandbox&type=revision&diff=933365112&oldid=926096219&diffmode=visual
>
> So my only suggestion is to look at how enwiki has it configured and try to
> adapt it to your needs.
>
> Another suggestion is to use Phaste:
> https://phabricator.wikimedia.org/paste/edit/form/14/ for code snippets,
> as
> it will prevent vandals from editing it + allow comments.
>
> Sorry I cannot be of more help,
> --
> Jaime Crespo
> <http://wikimedia.org>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Bartosz Dziewoński
In reply to this post by Egbe Eugene
{{Cite web}} and similar templates can also be used outside of a <ref>
tag, e.g. on a page like this:
https://en.wikipedia.org/wiki/Review_aggregator#Bibliography (not the
greatest example, but the best I could find quickly).

If you want it inside of a footnote, it's a bit complicated in visual
mode, since the footnotes can be reused multiple times. The way it works
is that there is a separate place in the document where the contents of
every reference are placed (the "internal list"), and the location of
the <ref> contains only a small node that links to the internal list.

Manually constructing the data so that both these things refer to each
other would be a pain, but there is a helper class that makes it more
convenient, ve.dm.MWReferenceModel.

You'd use it like this:

https://phabricator.wikimedia.org/P10018

I adapted that example from the code in
ve.ui.MWCitationDialog.prototype.getActionProcess, which is how VE
itself inserts new references.

Hope that helps (and doesn't look too awful).


--
Bartosz Dziewoński

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Egbe Eugene
Thanks for the help Bartosz.  However, I have a large data definition of
both texts and citations so I was wondering if its possible to insert the
texts and citations
all in one go when writing to the VE surface. In such cases, we expect the
VE surface to identify, the citation where
we are including the 'mwTransclusionInline' template in our data. Please is
this possible?

Thanks

On Wed, Jan 1, 2020 at 4:56 AM Bartosz Dziewoński <[hidden email]>
wrote:

> {{Cite web}} and similar templates can also be used outside of a <ref>
> tag, e.g. on a page like this:
> https://en.wikipedia.org/wiki/Review_aggregator#Bibliography (not the
> greatest example, but the best I could find quickly).
>
> If you want it inside of a footnote, it's a bit complicated in visual
> mode, since the footnotes can be reused multiple times. The way it works
> is that there is a separate place in the document where the contents of
> every reference are placed (the "internal list"), and the location of
> the <ref> contains only a small node that links to the internal list.
>
> Manually constructing the data so that both these things refer to each
> other would be a pain, but there is a helper class that makes it more
> convenient, ve.dm.MWReferenceModel.
>
> You'd use it like this:
>
> https://phabricator.wikimedia.org/P10018
>
> I adapted that example from the code in
> ve.ui.MWCitationDialog.prototype.getActionProcess, which is how VE
> itself inserts new references.
>
> Hope that helps (and doesn't look too awful).
>
>
> --
> Bartosz Dziewoński
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Egbe Eugene
In reply to this post by Bartosz Dziewoński
Thanks very much for the suggestions.

It looks like I did not pose the question very clearly.

We desire that the surface displays something like "Hello[1] world[2]" on
the VE surface and then have the footer note pick up these [1] and [2]
automatically and display them for us at the bottom of the page as in the
case where <ref>{{cite|a}}</ref> gets picked up in wikicode and rendered.

Is this possible?
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Bartosz Dziewoński
I am not really sure what you mean…

Here's a complete example that inserts, basically, "Hello[1] world[2]"
(text with two different references):

https://phabricator.wikimedia.org/P10038

Does that help?

--
Bartosz Dziewoński

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Egbe Eugene
Thanks very much Bartosz, I tried it on my VE sandbox page on en.Wikipedia
and it works really cool. However, I get the following error on my local MW
install

 *jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor
TypeError: ve.dm.MWReferenceModel is not a constructor*

I should be lacking a module or something. Please can you help with this?

Thanks once more,
--
Eugene

On Sat, Jan 4, 2020 at 10:10 AM Bartosz Dziewoński <[hidden email]>
wrote:

> I am not really sure what you mean…
>
> Here's a complete example that inserts, basically, "Hello[1] world[2]"
> (text with two different references):
>
> https://phabricator.wikimedia.org/P10038
>
> Does that help?
>
> --
> Bartosz Dziewoński
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Bartosz Dziewoński
Sounds like you don’t have Cite installed?

On Monday, January 6, 2020, Egbe Eugene <[hidden email]> wrote:

> Thanks very much Bartosz, I tried it on my VE sandbox page on en.Wikipedia
> and it works really cool. However, I get the following error on my local MW
> install
>
>  *jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor
> TypeError: ve.dm.MWReferenceModel is not a constructor*
>
> I should be lacking a module or something. Please can you help with this?
>
> Thanks once more,
> --
> Eugene
>
> On Sat, Jan 4, 2020 at 10:10 AM Bartosz Dziewoński <[hidden email]>
> wrote:
>
> > I am not really sure what you mean…
> >
> > Here's a complete example that inserts, basically, "Hello[1] world[2]"
> > (text with two different references):
> >
> > https://phabricator.wikimedia.org/P10038
> >
> > Does that help?
> >
> > --
> > Bartosz Dziewoński
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Matma Rex
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Egbe Eugene
Thanks very much Bartosz, it works just fine with Cite. Just a follow up
question. *Is Cite responsible for rendering <references />* *?*

On Mon, Jan 6, 2020 at 3:03 PM Bartosz Dziewoński <[hidden email]>
wrote:

> Sounds like you don’t have Cite installed?
>
> On Monday, January 6, 2020, Egbe Eugene <[hidden email]> wrote:
>
> > Thanks very much Bartosz, I tried it on my VE sandbox page on
> en.Wikipedia
> > and it works really cool. However, I get the following error on my local
> MW
> > install
> >
> >  *jQuery.Deferred exception: ve.dm.MWReferenceModel is not a constructor
> > TypeError: ve.dm.MWReferenceModel is not a constructor*
> >
> > I should be lacking a module or something. Please can you help with this?
> >
> > Thanks once more,
> > --
> > Eugene
> >
> > On Sat, Jan 4, 2020 at 10:10 AM Bartosz Dziewoński <[hidden email]>
> > wrote:
> >
> > > I am not really sure what you mean…
> > >
> > > Here's a complete example that inserts, basically, "Hello[1] world[2]"
> > > (text with two different references):
> > >
> > > https://phabricator.wikimedia.org/P10038
> > >
> > > Does that help?
> > >
> > > --
> > > Bartosz Dziewoński
> > >
> > > _______________________________________________
> > > Wikitech-l mailing list
> > > [hidden email]
> > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> > _______________________________________________
> > Wikitech-l mailing list
> > [hidden email]
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
>
> --
> Matma Rex
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Equivalence for using Template:Cite_Web with <ref></ref> templates surrounding Wikicode

Bartosz Dziewoński
On 2020-01-07 08:57, Egbe Eugene wrote:
> Thanks very much Bartosz, it works just fine with Cite. Just a follow up
> question. *Is Cite responsible for rendering <references />* *?*

Yes.

--
Bartosz Dziewoński

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l