Bene created this task.
Bene added subscribers: Lydia_Pintscher, hoo, Bene, Aklapper.
Bene added projects: MediaWiki-extensions-WikibaseClient, 
MediaWiki-extensions-Capiunto, Wikidata.

TASK DESCRIPTION
  A callback should be an optional setting when creating the capiunto infobox 
called `referenceRenderer` which is called to render references in the 
`addStatement` method. If no callback is provided, all snaks of a reference 
will be rendered in the order they are stored in the statement.
  
  The callback will be defined in its own module on client wikis like Wikipedia 
because references might be rendered differently in different languages. They 
can create a module like `Module:Reference` which contains a method that can 
render the list of snaks a reference provides according to the local standards. 
This method should be passed to capiunto when initializing the module calling 
`capiunto.create`.
  
  
  
  == Code example ==
  
  ``` lang=lua, name=Module:Infobox
  local infobox = require 'capiunto-wikibase'
  local reference = require 'Module:Reference'
  
  local p = {}
  
  function p.run()
        return infobox.create( {
                title = 'Title of the Infobox',
                referenceRenderer = reference.render
        } )
        :addStatement( 'Some wikidata property with references' )
  end
  
  return p
  ```

TASK DETAIL
  https://phabricator.wikimedia.org/T100897

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Bene
Cc: Aklapper, Bene, hoo, Lydia_Pintscher, Wikidata-bugs, aude, Jackmcbarn



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to