Page MenuHomePhabricator

[wikipediapreview] shortcode
Open, MediumPublic

Description

Context

As a Wikipedia Preview partner
I want to use shortcode
So I can enable Wikipedia Preview on my WordPress site

Acceptance Criteria

  1. The shortcode [wikipediapreview] exists
  2. It translates into <span data-wikipediapreview>content</span>
  3. It accepts the following arguments
    1. title: the value is transferred to the data-wp-title attribute on the <span>
    2. lang: the value is transferred to the data-wp-lang attribute on the <span>
  4. It transcludes inner shortcodes
  5. When the shortcode is used on a page (or always, if that conditional is not possible) the plugin loads the wikipediaPreview.production.js file and initializes it with the following options
    1. root: document.querySelector('.entry-content')
    2. lang: Configured site language
  6. When the shortcode is used on a page (or always, if that conditional is not possible) the plugin loads the wikipedia-preview.css file to style the <span>s with previews

Examples

shortcodeHTML
[wikipediapreview]Cat[/wikipediapreview]<span data-wikipediapreview>Cat</span>
[wikipediapreview title="Cat"]feline[/wikipediapreview]<span data-wikipediapreview data-wp-title="Cat">feline</span>
[wikipediapreview lang="fr"]chat[/wikipediapreview]<span data-wikipediapreview data-wp-lang="fr">chat</span>
[wikipediapreview]the [bold]black[/bold] cat[/wikipediapreview]<span data-wikipediapreview>the <b>black</b> cat</span>

Event Timeline

SBisson triaged this task as Medium priority.Apr 7 2021, 3:10 PM
SBisson edited projects, added Inuka-Team (Kanban); removed Inuka-Team.

Doesn't seem useful now that we have a Gutenberg custom format. Sending back to the backlog.