Extension:Popups/fr

The Popups extension displays page and reference previews when hovering over a link to an article or respectively to a reference. The former consists of summaries of an article's content, the latter shows the full content of the reference.

The extension is an initiative of the Design team, inspired by the popular Navigation popups gadget. Currently this feature is available on all Wikipedias by default for logged-out users. A description of how the extension functions and more information on its use on Wikimedia projects is available at Page Previews.

The Reference Previews feature was added eventually and aims to fulfill a wish from the German-speaking community's Technical Wishlist. A more detailed description and more information on its use is available at.

Dépendances
This extension has a hard dependency on and. There are also optional dependencies on (if you want to enable the Reference Previews as beta feature), and  and  (for instrumentation).

Installation

 * Install the dependencies.

Page previews API
Every project is different, and what displays in your previews is highly dependent on the content inside your wiki.

Extension:Popups has been optimised to work with Wikipedia-like content (e.g. wikitext). If your wiki is using a different kind of content handler (for example as is the case for ) it will need to provide its own API.

The API can be written in any language, but the response of the API must match the spec defined here:

Defining new APIs is out of scope for the Popups extension.

Once defined, you can configure page previews to point to your API using  configuration option.

Contenu des aperçus de page
Les popups de prévisualisation de la page affichent une image (si elle est disponible) et un petit extrait de texte.

Image
L’image provient du qui retourne la vignette la plus appropriée associée à un article. Il ignore les modèles de maintenance, les talons, les icônes de drapeau, etc.

Texte
Les aperçus de page peuvent être configurés avec n’importe quelle API compatible compatible avec Page content service summary endpoint en utilisant. Pour les tiers, nous encourageons l’utilisation du Page Content Service pour profiter de l’utilisation de Popups avec votre wiki local.

Vous pouvez également utiliser l’extension. Cette extension a various caveats et nous ne supportons pas activement l’utilisation de cette API.

Contenu des aperçus de référence


Le contenu de la fenêtre de prévisualisation de référence est directement extrait de la section de référence de la page elle-même. Aucun service externe n’est impliqué ici. Si le contenu dépasse la taille du popup, les barres de défilement sont affichées pour que tout puisse être regardé.

Types de référence
Les types de référence affichés sont définis en utilisant des classes CSS spécifiques sur la balise qui peuvent être utilisées pour encapsuler le contenu d’une référence par ex.. Actuellement, les types suivants sont pris en charge :,  ,  ,  ,. En dehors de cela, il y a toujours un repli générique si ni la balise cite n’a été trouvée ni une classe appropriée n’a été utilisée. Veuillez noter qu’il n’est pas recommandé d’utiliser les classes CSS directement dans wikitext, mais plutôt en créant templates.

Le moteur de rendu
This extensions currently has only one renderer, that is for ordinary pages.

New renderers for different kind of pages, or things like references can be easily added.

One needs to create a new object with the following methods:



You can see details of these methods in ext.popups.renderer.article.js or this patch that adds a renderer for references.

Problèmes connus

 * Users of the Translate extension should note that Page Previews requests previews in the content language of the page. If the preview contains a complete translatable block, then it will be translated. If, however, the preview contains an incomplete translateable block – because a sentence is cut off, say – then it isn't translated and will be displayed in the content language of the page. If you are observing this behavior, then you should consider marking up individual sentences in your lead section.
 * T167852 is for a technical audience but has more information on the underlying problem.
 * Longer math formulas cutting off in preview - long math or chemical formulas (formulas wider than the preview width) display as truncated in previews. We were not able to add a gradient in order to indicate that the formula is continued on the article itself.

Why can't I copy and paste text from a preview?
At time of writing, the cons of doing so outweigh the pros. Essentially it boils down to decreasing the touch area to read the article in full. Once Page Previews is deployed on English and German Wikipedia, feel free to reopen this task and reignite the discussion, but right now we have no plans.

How can I change the image that I see on preview?
See Extension:PageImages#Image choice.

How can I remove content from a page preview?
Any element marked with the  class will be stripped from the summary.

Where do summaries come from?
These are provided by the Summary REST API.

Why are parenthetical stripped?
There's a good discussion going on in T91344 in Phabricator. If you have any views on this or see any problems relating to this, please let us know there.

Why don't I see Popups outside of content namespaces?
Popups appear on links to pages in content namespaces only. This is a limitation of Popups; TextExtracts are available from other namespaces. You may work around this by appending more namespaces into.

Liens

 * Page Previews help page and central feedback page on MediaWiki.org
 * Reference Previews help page and central feedback page on MediaWiki.org
 * Reference Previews main project page on Meta
 * Related research: Wikimedia Performance Team/Authoring Popups: Best Practices