KXStudio Website https://kx.studio/
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.

183 lines
5.9KB

  1. <?php
  2. /********************************************************************************
  3. * bibtex.php
  4. * -----
  5. * Author: Quinn Taylor (quinntaylor@mac.com)
  6. * Copyright: (c) 2009 Quinn Taylor (quinntaylor@mac.com), Nigel McNie (http://qbnz.com/highlighter)
  7. * Release Version: 1.0.8.11
  8. * Date Started: 2009/04/29
  9. *
  10. * BibTeX language file for GeSHi.
  11. *
  12. * CHANGES
  13. * -------
  14. * 2009/04/29 (1.0.8.4)
  15. * - First Release
  16. *
  17. * TODO
  18. * -------------------------
  19. * - Add regex for matching and replacing URLs with corresponding hyperlinks
  20. * - Add regex for matching more LaTeX commands that may be embedded in BibTeX
  21. * (Someone who understands regex better than I should borrow from latex.php)
  22. ********************************************************************************
  23. *
  24. * This file is part of GeSHi.
  25. *
  26. * GeSHi is free software; you can redistribute it and/or modify
  27. * it under the terms of the GNU General Public License as published by
  28. * the Free Software Foundation; either version 2 of the License, or
  29. * (at your option) any later version.
  30. *
  31. * GeSHi is distributed in the hope that it will be useful,
  32. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. * GNU General Public License for more details.
  35. *
  36. * You should have received a copy of the GNU General Public License
  37. * along with GeSHi; if not, write to the Free Software
  38. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  39. *
  40. *
  41. *******************************************************************************/
  42. // http://en.wikipedia.org/wiki/BibTeX
  43. // http://www.fb10.uni-bremen.de/anglistik/langpro/bibliographies/jacobsen-bibtex.html
  44. $language_data = array (
  45. 'LANG_NAME' => 'BibTeX',
  46. 'OOLANG' => false,
  47. 'COMMENT_SINGLE' => array(
  48. 1 => '%%'
  49. ),
  50. 'COMMENT_MULTI' => array(),
  51. 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
  52. 'QUOTEMARKS' => array(),
  53. 'ESCAPE_CHAR' => '',
  54. 'KEYWORDS' => array(
  55. 0 => array(
  56. '@comment','@preamble','@string'
  57. ),
  58. // Standard entry types
  59. 1 => array(
  60. '@article','@book','@booklet','@conference','@inbook',
  61. '@incollection','@inproceedings','@manual','@mastersthesis',
  62. '@misc','@phdthesis','@proceedings','@techreport','@unpublished'
  63. ),
  64. // Custom entry types
  65. 2 => array(
  66. '@collection','@patent','@webpage'
  67. ),
  68. // Standard entry field names
  69. 3 => array(
  70. 'address','annote','author','booktitle','chapter','crossref',
  71. 'edition','editor','howpublished','institution','journal','key',
  72. 'month','note','number','organization','pages','publisher','school',
  73. 'series','title','type','volume','year'
  74. ),
  75. // Custom entry field names
  76. 4 => array(
  77. 'abstract','affiliation','chaptername','cited-by','cites',
  78. 'contents','copyright','date-added','date-modified','doi','eprint',
  79. 'isbn','issn','keywords','language','lccn','lib-congress',
  80. 'location','price','rating','read','size','source','url'
  81. )
  82. ),
  83. 'URLS' => array(
  84. 0 => '',
  85. 1 => '',
  86. 2 => '',
  87. 3 => '',
  88. 4 => ''
  89. ),
  90. 'SYMBOLS' => array(
  91. '{', '}', '#', '=', ','
  92. ),
  93. 'CASE_SENSITIVE' => array(
  94. 1 => false,
  95. 2 => false,
  96. 3 => false,
  97. 4 => false,
  98. GESHI_COMMENTS => false,
  99. ),
  100. // Define the colors for the groups listed above
  101. 'STYLES' => array(
  102. 'KEYWORDS' => array(
  103. 1 => 'color: #C02020;', // Standard entry types
  104. 2 => 'color: #C02020;', // Custom entry types
  105. 3 => 'color: #C08020;', // Standard entry field names
  106. 4 => 'color: #C08020;' // Custom entry field names
  107. ),
  108. 'COMMENTS' => array(
  109. 1 => 'color: #2C922C; font-style: italic;'
  110. ),
  111. 'STRINGS' => array(
  112. 0 => 'color: #2020C0;'
  113. ),
  114. 'SYMBOLS' => array(
  115. 0 => 'color: #E02020;'
  116. ),
  117. 'REGEXPS' => array(
  118. 1 => 'color: #2020C0;', // {...}
  119. 2 => 'color: #C08020;', // BibDesk fields
  120. 3 => 'color: #800000;' // LaTeX commands
  121. ),
  122. 'ESCAPE_CHAR' => array(
  123. 0 => 'color: #000000; font-weight: bold;'
  124. ),
  125. 'BRACKETS' => array(
  126. 0 => 'color: #E02020;'
  127. ),
  128. 'NUMBERS' => array(
  129. ),
  130. 'METHODS' => array(
  131. ),
  132. 'SCRIPT' => array(
  133. )
  134. ),
  135. 'REGEXPS' => array(
  136. // {parameters}
  137. 1 => array(
  138. GESHI_SEARCH => "(?<=\\{)(?:\\{(?R)\\}|[^\\{\\}])*(?=\\})",
  139. GESHI_REPLACE => '\0',
  140. GESHI_MODIFIERS => 's',
  141. GESHI_BEFORE => '',
  142. GESHI_AFTER => ''
  143. ),
  144. 2 => array(
  145. GESHI_SEARCH => "\bBdsk-(File|Url)-\d+",
  146. GESHI_REPLACE => '\0',
  147. GESHI_MODIFIERS => 'Us',
  148. GESHI_BEFORE => '',
  149. GESHI_AFTER => ''
  150. ),
  151. 3 => array(
  152. GESHI_SEARCH => "\\\\[A-Za-z0-9]*+",
  153. GESHI_REPLACE => '\0',
  154. GESHI_MODIFIERS => 'Us',
  155. GESHI_BEFORE => '',
  156. GESHI_AFTER => ''
  157. ),
  158. ),
  159. 'HIGHLIGHT_STRICT_BLOCK' => array(
  160. ),
  161. 'OBJECT_SPLITTERS' => array(
  162. ),
  163. 'STRICT_MODE_APPLIES' => GESHI_NEVER,
  164. 'SCRIPT_DELIMITERS' => array(
  165. ),
  166. 'PARSER_CONTROL' => array(
  167. 'ENABLE_FLAGS' => array(
  168. 'NUMBERS' => GESHI_NEVER
  169. ),
  170. 'KEYWORDS' => array(
  171. 3 => array(
  172. 'DISALLOWED_AFTER' => '(?=\s*=)'
  173. ),
  174. 4 => array(
  175. 'DISALLOWED_AFTER' => '(?=\s*=)'
  176. ),
  177. )
  178. )
  179. );
  180. ?>