You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
7.7 KiB

  1. refbase extension for MediaWiki
  2. ===============================
  3. Authors
  4. -------
  5. Richard Karnesky <karnesky@gmail.com>
  6. Thibault Marin <thibault.marin at gmx dot com>
  7. About
  8. -----
  9. This is an extension to MediaWiki:
  10. <https://www.mediawiki.org/>
  11. It allows you to cite references by enclosing the serial or the citation key
  12. in tags such as:
  13. <refbase>17</refbase> or <refbase>Author2000</refbase>
  14. To install the extension, download and extract the files in a directory called
  15. Refbase in your mediawiki extensions/ folder. Add the following code at the
  16. bottom of your LocalSettings.php:
  17. require_once( "$IP/extensions/Refbase/Refbase.php" );
  18. To verify that the extension is successfully installed, go to the
  19. "Special:Version" page on your wiki, you should see the Refbase extension in
  20. the list of parser hook extensions.
  21. To configure the extension, add the following lines (modified to match your
  22. setup) after the 'require_once' line in your LocalSettings.php (omitted fields
  23. take the default value indicated here):
  24. $wgRefbaseDbHost = "localhost"; // refbase database host
  25. $wgRefbaseDbName = "literature"; // Database name
  26. $wgRefbaseDbUser = "litwww"; // User name for database
  27. $wgRefbaseDbPass = "%l1t3ratur3?"; // Database password
  28. $wgRefbaseDbCharset = "utf8"; // Database charset
  29. $wgRefbaseDbRefTable = "refs"; // Table with references
  30. $wgRefbaseDbUserDataTable = "user_data"; // Table with cite_key field
  31. $wgRefbaseDbAccessMethod = "mysql"; // Database access mode
  32. // 'mysql' or 'PDO'
  33. // Host for refbase instance (used for url links). This may differ from the
  34. // database host (requires a trailing slash)
  35. $wgRefbaseURL = "http://".$_SERVER['HTTP_HOST']."/refbase/";
  36. // HTTP (basic) authentication mode when accessing refbase instance (only
  37. // used with 'cite' and 'link' output types, when using a 'rb-*' citation
  38. // type), see below for details.
  39. $wgRefbaseURLAuth = ''; // '', 'default' or 'user:pass'
  40. A few options can also be set (see below for description):
  41. // Tag type
  42. $wgRefbaseDefaultTagType = 'serial'; // 'serial' or 'citekey'
  43. // Output type
  44. $wgRefbaseDefaultOutputType = 'cite_journal'; // 'cite_journal', 'cite'
  45. // or 'link'
  46. // Citation type
  47. $wgRefbaseDefaultCitationType = 'minimal'; // 'minimal' or 'rb-*'
  48. Options
  49. -------
  50. 0. Scope
  51. All options are set globally (by the $wgRefbaseDefault* variables) for the
  52. whole wiki. Most can also be modified for individual instances of the
  53. <refbase> tag by passing extra arguments to the tag, e.g. <refbase
  54. tagtype='citekey' output='cite'>XXX</refbase>.
  55. 1. Tag type
  56. Possible values: 'serial', 'citekey'
  57. Global setting
  58. $wgRefbaseDefaultTagType = 'serial';
  59. Individual setting
  60. <refbase tagtype='serial'>XXX</refbase>
  61. This option controls the interpretation of the tag input: when using the
  62. refbase tag in wikipages, e.g. <refbase>XXX</refbase>, the input key (XXX)
  63. can refer to the serial number ('serial' type) or the citation key
  64. ('citekey' type). Note that if no entry is found using the selected tag
  65. type, a second search is performed with the other tag type.
  66. 2. Output type
  67. Possible values: 'cite_journal', 'cite', 'link'
  68. Global setting
  69. $wgRefbaseDefaultOutputType = 'cite_journal';
  70. Individual setting
  71. <refbase output='cite_journal'>XXX</refbase>
  72. This option determines the way citations are rendered in the wikipage. There
  73. are several modes:
  74. .'cite_journal': This is the default mode, used in version 0.9 of the
  75. extension. The output will use citation templates, as are used on
  76. Wikipedia:
  77. <https://en.wikipedia.org/wiki/Wikipedia:Citation_templates>
  78. Currently, only journal articles may be cited with this output type. In
  79. the future, this extension is likely to be modified. 'refbase' should
  80. be able to generate WP citation templates as an export format & this
  81. extension should make use of that functionality directly.
  82. .'cite': This mode uses the Cite extension
  83. <https://www.mediawiki.org/wiki/Extension:Cite>
  84. A footnote is generated for each citation using the <ref> tag. Multiple
  85. references to the same entry are automatically combined using the <ref
  86. name=YYY> option. To see the list of references a <references/> tag
  87. must be added to the wikipage where the bibliography should be
  88. displayed. See the Cite extension documentation for details. The
  89. footnote text is a citation following the 'citation type' option (see
  90. below).
  91. .'link': This is a simple renderer which does not require any installed
  92. template/extension. It simply writes the tag input (serial or citation
  93. key) to the wikipage, adding a tooltip and a hyperlink to the refbase
  94. entry. The tooltip contains the citation text (controlled by the
  95. citation type variable) and the hyperlink links to the refbase page (the
  96. base refbase installation location is given by the $wgRefbaseURL
  97. variable).
  98. 3. Citation type
  99. Possible values: 'minimal, 'rb-default', 'rb-MLA', 'rb-APA', etc.
  100. Global setting
  101. $wgRefbaseDefaultCitationType = 'minimal';
  102. Individual setting
  103. <refbase citationtype='minimal'>XXX</refbase>
  104. This option determines how citations are rendered in the 'cite' and 'link'
  105. output modes (it has no effect when using the 'cite_journal' output type).
  106. The two possible modes are:
  107. .'minimal': This generates a simple citation with the authors, title,
  108. publication and year.
  109. .'rb-*': This requests the citation text from the refbase web interface.
  110. The * in 'rb-*' can be 'default' (i.e. 'rb-default') or any acceptable
  111. citation style (defined in the 'styles' database).
  112. 4. Database connection mode
  113. Possible values: 'mysql', 'PDO'
  114. Global setting
  115. $wgRefbaseDbAccessMethod = 'mysql';
  116. Individual setting
  117. This option can only be set at the global level.
  118. This option selects the way the extension connects to the mysql database.
  119. The 'mysql' mode is getting deprecated in recent versions of php, but is
  120. still available for older installations.
  121. 5. HTTP authentication for requests to refbase instance
  122. Possible values: '', 'default' or 'user:pass'
  123. Global setting
  124. $wgRefbaseURLAuth = '';
  125. Individual setting
  126. This option can only be set at the global level.
  127. This option is used to pass an HTTP authentication token to the server
  128. hosting the refbase installation (basic authentication e.g. from apache
  129. server). If $wgRefbaseURLAuth is empty (''), no authentication is passed.
  130. If set to 'default', the current user/password token will be passed when
  131. requesting data from the refbase web interface (this is useful when both
  132. mediawiki and refbase are under the same basic server authentication). To
  133. specify an arbitrary user and password, set $wgRefbaseURLAuth to 'user:pass'
  134. where 'user' is the username and 'pass' the password for that user (note
  135. that the username cannot contain colon characters ':'). This option is
  136. relevant only when using the 'cite' or 'link' output types along with one of
  137. the 'rb-*' citation type.
  138. Notes
  139. -----
  140. You may also be interested in the MonoBook skin, included in the
  141. 'contrib/skins/mediawiki-monobook' directory from refbase.
  142. An installation of MediaWiki that uses this extension is the Northwestern
  143. University Center for Atom-Probe Tomography:
  144. <http://arc.nucapt.northwestern.edu/#Literature>