Index: trunk/extensions/WikiCitation/WikiCitation.i18n.magic.php |
— | — | @@ -132,7 +132,6 @@ |
133 | 133 | 'wc_pamphlet' => array( 0, 'pamphlet' ), |
134 | 134 | 'wc_conference_paper' => array( 0, 'conference-paper' ), |
135 | 135 | 'wc_thesis' => array( 0, 'thesis' ), |
136 | | - 'wc_dissertation' => array( 0, 'PhD-dissertation' ), |
137 | 136 | 'wc_report' => array( 0, 'report' ), |
138 | 137 | 'wc_poem' => array( 0, 'poem' ), |
139 | 138 | 'wc_song' => array( 0, 'song' ), |
Index: trunk/extensions/WikiCitation/WikiCitation.php |
— | — | @@ -15,9 +15,14 @@ |
16 | 16 | * <parameters> ::= <parameter> |
17 | 17 | * | <parameter> "|" <parameters> |
18 | 18 | * @endcode |
| 19 | + * |
| 20 | + * By default, the first citation to any reference is cited in "long" form, while |
| 21 | + * any subsequent citations are in "short" form. However, "long" and "short" citations |
| 22 | + * can be forced by the use of "long" and "short" as flags. |
| 23 | + * |
19 | 24 | * The extension also implements the following tag extension (in English): |
20 | 25 | * @code |
21 | | - * <biblio style="..." type="..."></biblio> |
| 26 | + * <biblio style="..." type="...">...</biblio> |
22 | 27 | * @endcode |
23 | 28 | * where the style and type attributes define the citation style (e.g. |
24 | 29 | * Chicago Manual of style) and type (e.g., author-date). Citations within |
— | — | @@ -25,6 +30,13 @@ |
26 | 31 | * For more detailed documentation, see the extension's MediaWiki entry at |
27 | 32 | * http://www.mediawiki.org/wiki/Extension:WikiCitation |
28 | 33 | * |
| 34 | + * The extension also implements the following tag extension for endnotes: |
| 35 | + * @code |
| 36 | + * <note style="..." type="...">...</note> |
| 37 | + * @endcode |
| 38 | + * where the style and type attributes define the style of citaitons within |
| 39 | + * the endnote. By default, citations within notes follow the "note" style. |
| 40 | + * |
29 | 41 | * @defgroup WikiCitation |
30 | 42 | * @author 'COGDEN' and others |
31 | 43 | * @copyright Copyright (c) 2011 by authors |
— | — | @@ -57,115 +69,129 @@ |
58 | 70 | |
59 | 71 | |
60 | 72 | $wgExtensionCredits[ 'parserhook' ][] = array( |
61 | | - 'path' => __FILE__, |
62 | | - 'name' => 'WikiCitation', |
63 | | - 'author' => array( 'COGDEN' ), |
64 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiCitation', |
65 | | - 'descriptionmsg' => 'wc-description', |
66 | | - 'version' => '0.8.1' |
| 73 | + 'path' => __FILE__, |
| 74 | + 'name' => 'WikiCitation', |
| 75 | + 'author' => array( 'COGDEN' ), |
| 76 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiCitation', |
| 77 | + 'descriptionmsg' => 'wc-description', |
| 78 | + 'version' => '0.8.1' |
67 | 79 | ); |
68 | 80 | |
69 | 81 | |
70 | 82 | /** |
71 | 83 | * Global settings |
72 | 84 | */ |
| 85 | + |
| 86 | +/** |
| 87 | + * This variable determines whether citation parameters are validated ( = True ) |
| 88 | + * or simply ignored ( = False ). |
| 89 | + * @var boolean |
| 90 | + */ |
73 | 91 | $wikiCitationValidateArguments = False; |
74 | 92 | |
75 | | -$mDir = dirname(__FILE__); |
76 | | - |
77 | 93 | /** |
78 | | - * Array for defining allowable referencing styles, and setting a default. |
| 94 | + * Setting to define allowable referencing styles, and to set the default style. |
79 | 95 | * |
80 | 96 | * Array of recognized children of WCCitation, keyed to magic words used to |
81 | | - * invoke that style. For example, the magic word 'wcChicago' |
82 | | - * ('Chicago' in English) is keyed to the class 'WCChicagoCitation' |
| 97 | + * invoke that style. For example, the magic word 'wc_Chicago' |
| 98 | + * ('Chicago' in English) is keyed to the class 'WCChicagoStyle' |
83 | 99 | * |
84 | 100 | * To disallow particular styles, comment them out or remove them from this |
85 | | - * list. |
| 101 | + * list. The magic word 'wc_default' is keyed to the default style. |
86 | 102 | * @var |
87 | 103 | */ |
88 | 104 | $wgWCCitationStyles = array( |
89 | | - 'wc_default' => 'WCChicagoStyle', # default style is defined here |
90 | | - 'wc_Chicago' => 'WCChicagoStyle', |
91 | | - 'wc_Bluebook' => 'WCBluebookStyle', |
| 105 | + 'wc_default' => 'WCChicagoStyle', # default style is defined here |
| 106 | + 'wc_Chicago' => 'WCChicagoStyle', |
| 107 | + 'wc_Bluebook' => 'WCBluebookStyle', |
92 | 108 | ); |
93 | 109 | |
94 | | -# Styles |
95 | | -$wgAutoloadClasses['WCChicagoStyle'] = $mDir . '/styles/WCChicagoStyle.php'; |
96 | | -$wgAutoloadClasses['WCBluebookStyle'] = $mDir . '/styles/WCBluebookStyle.php'; |
| 110 | +# Location of the CSS style sheet for this extension |
| 111 | +$wgWCStyleSheet = $wgScriptPath . '/extensions/WikiCitation/WikiCitation.css'; |
97 | 112 | |
98 | 113 | |
99 | 114 | /** |
100 | | - * Localization files |
| 115 | + * Autoload classes |
101 | 116 | */ |
102 | | -$wgExtensionMessagesFiles['WikiCitation'] = $mDir . '/WikiCitation.i18n.php'; |
103 | | -$wgExtensionMessagesFiles['WikiCitationMagic'] = $mDir . '/WikiCitation.i18n.magic.php'; |
| 117 | +$mDir = dirname(__FILE__); |
104 | 118 | |
105 | | -/** |
106 | | - * Autoload classes |
107 | | - */ |
108 | 119 | # main directory |
109 | | -$wgAutoloadClasses['WikiCitation'] = $mDir . '/WikiCitation.body.php'; |
| 120 | +$wgAutoloadClasses['WikiCitation'] = $mDir . '/WikiCitation.body.php'; |
110 | 121 | |
| 122 | +# Styles |
| 123 | +$wgAutoloadClasses['WCChicagoStyle'] = $mDir . '/styles/WCChicagoStyle.php'; |
| 124 | +$wgAutoloadClasses['WCBluebookStyle'] = $mDir . '/styles/WCBluebookStyle.php'; |
| 125 | + |
111 | 126 | # includes |
112 | | -$wgAutoloadClasses['WCArgumentReader'] = $mDir . '/includes/WCArgumentReader.php'; |
113 | | -$wgAutoloadClasses['WCArticle'] = $mDir . '/includes/WCArticle.php'; |
114 | | -$wgAutoloadClasses['WCBibliography'] = $mDir . '/includes/WCBibliography.php'; |
115 | | -$wgAutoloadClasses['WCCitation'] = $mDir . '/includes/WCCitation.php'; |
116 | | - $wgAutoloadClasses['WCCitationPosition'] = $mDir . '/includes/WCCitation.php'; |
117 | | -$wgAutoloadClasses['WCEnum'] = $mDir . '/includes/WCEnum.php'; |
118 | | -$wgAutoloadClasses['WCException'] = $mDir . '/includes/WCException.php'; |
119 | | -$wgAutoloadClasses['WCNote'] = $mDir . '/includes/WCNote.php'; |
120 | | -$wgAutoloadClasses['WCReference'] = $mDir . '/includes/WCReference.php'; |
121 | | -$wgAutoloadClasses['WCReferenceStore'] = $mDir . '/includes/WCReferenceStore.php'; |
122 | | -$wgAutoloadClasses['WCSection'] = $mDir . '/includes/WCSection.php'; |
123 | | -$wgAutoloadClasses['WCStyle'] = $mDir . '/includes/WCStyle.php'; |
| 127 | +$wgAutoloadClasses['WCArgumentReader'] = $mDir . '/includes/WCArgumentReader.php'; |
| 128 | +$wgAutoloadClasses['WCArticle'] = $mDir . '/includes/WCArticle.php'; |
| 129 | +$wgAutoloadClasses['WCBibliography'] = $mDir . '/includes/WCBibliography.php'; |
| 130 | +$wgAutoloadClasses['WCCitation'] = $mDir . '/includes/WCCitation.php'; |
| 131 | + $wgAutoloadClasses['WCCitationPosition'] = $mDir . '/includes/WCCitation.php'; |
| 132 | +$wgAutoloadClasses['WCEnum'] = $mDir . '/includes/WCEnum.php'; |
| 133 | +$wgAutoloadClasses['WCException'] = $mDir . '/includes/WCException.php'; |
| 134 | +$wgAutoloadClasses['WCNote'] = $mDir . '/includes/WCNote.php'; |
| 135 | +$wgAutoloadClasses['WCReference'] = $mDir . '/includes/WCReference.php'; |
| 136 | +$wgAutoloadClasses['WCReferenceStore'] = $mDir . '/includes/WCReferenceStore.php'; |
| 137 | +$wgAutoloadClasses['WCSection'] = $mDir . '/includes/WCSection.php'; |
| 138 | +$wgAutoloadClasses['WCStyle'] = $mDir . '/includes/WCStyle.php'; |
124 | 139 | |
125 | 140 | # data |
126 | | -$wgAutoloadClasses['WCData'] = $mDir . '/includes/data/WCData.php'; |
127 | | -$wgAutoloadClasses['WCDate'] = $mDir . '/includes/data/WCDate.php'; |
128 | | -$wgAutoloadClasses['WCLocator'] = $mDir . '/includes/data/WCLocator.php'; |
129 | | -$wgAutoloadClasses['WCName'] = $mDir . '/includes/data/WCName.php'; |
130 | | -$wgAutoloadClasses['WCNames'] = $mDir . '/includes/data/WCNames.php'; |
131 | | -$wgAutoloadClasses['WCTypeData'] = $mDir . '/includes/data/WCTypeData.php'; |
132 | | -$wgAutoloadClasses['WCText'] = $mDir . '/includes/data/WCText.php'; |
133 | | -$wgAutoloadClasses['WCTitle'] = $mDir . '/includes/data/WCTitle.php'; |
134 | | -$wgAutoloadClasses['WCTitleFormat'] = $mDir . '/includes/data/WCTitle.php'; |
| 141 | +$wgAutoloadClasses['WCData'] = $mDir . '/includes/data/WCData.php'; |
| 142 | +$wgAutoloadClasses['WCDate'] = $mDir . '/includes/data/WCDate.php'; |
| 143 | +$wgAutoloadClasses['WCLocator'] = $mDir . '/includes/data/WCLocator.php'; |
| 144 | +$wgAutoloadClasses['WCName'] = $mDir . '/includes/data/WCName.php'; |
| 145 | +$wgAutoloadClasses['WCNames'] = $mDir . '/includes/data/WCNames.php'; |
| 146 | +$wgAutoloadClasses['WCTypeData'] = $mDir . '/includes/data/WCTypeData.php'; |
| 147 | +$wgAutoloadClasses['WCText'] = $mDir . '/includes/data/WCText.php'; |
| 148 | +$wgAutoloadClasses['WCTitle'] = $mDir . '/includes/data/WCTitle.php'; |
| 149 | +$wgAutoloadClasses['WCTitleFormat'] = $mDir . '/includes/data/WCTitle.php'; |
135 | 150 | |
136 | 151 | # parameters |
137 | | -$wgAutoloadClasses['WCAttributeEnum'] = $mDir . '/includes/parameters/WCAttributeEnum.php'; |
138 | | -$wgAutoloadClasses['WCCitationLengthEnum'] = $mDir . '/includes/parameters/WCCitationLengthEnum.php'; |
139 | | -$wgAutoloadClasses['WCCitationTypeEnum'] = $mDir . '/includes/parameters/WCCitationTypeEnum.php'; |
140 | | -$wgAutoloadClasses['WCDateTermsEnum'] = $mDir . '/includes/parameters/WCDateTermsEnum.php'; |
141 | | -$wgAutoloadClasses['WCNamePartEnum'] = $mDir . '/includes/parameters/WCNamePartEnum.php'; |
142 | | -$wgAutoloadClasses['WCNameTypeEnum'] = $mDir . '/includes/parameters/WCNameTypeEnum.php'; |
143 | | -$wgAutoloadClasses['WCParameterEnum'] = $mDir . '/includes/parameters/WCParameterEnum.php'; |
144 | | -$wgAutoloadClasses['WCPropertyEnum'] = $mDir . '/includes/parameters/WCPropertyEnum.php'; |
145 | | -$wgAutoloadClasses['WCScopeEnum'] = $mDir . '/includes/parameters/WCScopeEnum.php'; |
146 | | -$wgAutoloadClasses['WCSourceTypeEnum'] = $mDir . '/includes/parameters/WCSourceTypeEnum.php'; |
| 152 | +$wgAutoloadClasses['WCAttributeEnum'] = $mDir . '/includes/parameters/WCAttributeEnum.php'; |
| 153 | +$wgAutoloadClasses['WCCitationLengthEnum'] = $mDir . '/includes/parameters/WCCitationLengthEnum.php'; |
| 154 | +$wgAutoloadClasses['WCCitationTypeEnum'] = $mDir . '/includes/parameters/WCCitationTypeEnum.php'; |
| 155 | +$wgAutoloadClasses['WCDateTermsEnum'] = $mDir . '/includes/parameters/WCDateTermsEnum.php'; |
| 156 | +$wgAutoloadClasses['WCNamePartEnum'] = $mDir . '/includes/parameters/WCNamePartEnum.php'; |
| 157 | +$wgAutoloadClasses['WCNameTypeEnum'] = $mDir . '/includes/parameters/WCNameTypeEnum.php'; |
| 158 | +$wgAutoloadClasses['WCParameterEnum'] = $mDir . '/includes/parameters/WCParameterEnum.php'; |
| 159 | +$wgAutoloadClasses['WCPropertyEnum'] = $mDir . '/includes/parameters/WCPropertyEnum.php'; |
| 160 | +$wgAutoloadClasses['WCScopeEnum'] = $mDir . '/includes/parameters/WCScopeEnum.php'; |
| 161 | +$wgAutoloadClasses['WCSourceTypeEnum'] = $mDir . '/includes/parameters/WCSourceTypeEnum.php'; |
147 | 162 | |
148 | 163 | # segments |
149 | | -$wgAutoloadClasses['WCAlternativeSegment'] = $mDir . '/includes/segments/WCAlternativeSegment.php'; |
150 | | -$wgAutoloadClasses['WCConditionalSegment'] = $mDir . '/includes/segments/WCConditionalSegment.php'; |
151 | | -$wgAutoloadClasses['WCDataSegment'] = $mDir . '/includes/segments/WCDataSegment.php'; |
152 | | -$wgAutoloadClasses['WCDateSegment'] = $mDir . '/includes/segments/WCDateSegment.php'; |
153 | | -$wgAutoloadClasses['WCGroupSegment'] = $mDir . '/includes/segments/WCGroupSegment.php'; |
154 | | -$wgAutoloadClasses['WCLabelFormEnum'] = $mDir . '/includes/segments/WCLabelSegment.php'; |
155 | | -$wgAutoloadClasses['WCLabelSegment'] = $mDir . '/includes/segments/WCLabelSegment.php'; |
156 | | -$wgAutoloadClasses['WCLiteralSegment'] = $mDir . '/includes/segments/WCLiteralSegment.php'; |
157 | | -$wgAutoloadClasses['WCLocatorSegment'] = $mDir . '/includes/segments/WCLocatorSegment.php'; |
158 | | -$wgAutoloadClasses['WCNamesSegment'] = $mDir . '/includes/segments/WCNamesSegment.php'; |
159 | | -$wgAutoloadClasses['WCSegment'] = $mDir . '/includes/segments/WCSegment.php'; |
160 | | -$wgAutoloadClasses['WCTextSegment'] = $mDir . '/includes/segments/WCTextSegment.php'; |
161 | | -$wgAutoloadClasses['WCTitleSegment'] = $mDir . '/includes/segments/WCTitleSegment.php'; |
162 | | -$wgAutoloadClasses['WCWrapperSegment'] = $mDir . '/includes/segments/WCWrapperSegment.php'; |
| 164 | +$wgAutoloadClasses['WCAlternativeSegment'] = $mDir . '/includes/segments/WCAlternativeSegment.php'; |
| 165 | +$wgAutoloadClasses['WCConditionalSegment'] = $mDir . '/includes/segments/WCConditionalSegment.php'; |
| 166 | +$wgAutoloadClasses['WCDataSegment'] = $mDir . '/includes/segments/WCDataSegment.php'; |
| 167 | +$wgAutoloadClasses['WCDateSegment'] = $mDir . '/includes/segments/WCDateSegment.php'; |
| 168 | +$wgAutoloadClasses['WCGroupSegment'] = $mDir . '/includes/segments/WCGroupSegment.php'; |
| 169 | +$wgAutoloadClasses['WCLabelFormEnum'] = $mDir . '/includes/segments/WCLabelSegment.php'; |
| 170 | +$wgAutoloadClasses['WCLabelSegment'] = $mDir . '/includes/segments/WCLabelSegment.php'; |
| 171 | +$wgAutoloadClasses['WCLiteralSegment'] = $mDir . '/includes/segments/WCLiteralSegment.php'; |
| 172 | +$wgAutoloadClasses['WCLocatorSegment'] = $mDir . '/includes/segments/WCLocatorSegment.php'; |
| 173 | +$wgAutoloadClasses['WCNamesSegment'] = $mDir . '/includes/segments/WCNamesSegment.php'; |
| 174 | +$wgAutoloadClasses['WCSegment'] = $mDir . '/includes/segments/WCSegment.php'; |
| 175 | +$wgAutoloadClasses['WCTextSegment'] = $mDir . '/includes/segments/WCTextSegment.php'; |
| 176 | +$wgAutoloadClasses['WCTitleSegment'] = $mDir . '/includes/segments/WCTitleSegment.php'; |
| 177 | +$wgAutoloadClasses['WCWrapperSegment'] = $mDir . '/includes/segments/WCWrapperSegment.php'; |
163 | 178 | |
164 | | -# Set up parser hooks |
165 | | -$wgHooks[ 'ParserFirstCallInit' ][] = 'WikiCitation::onParserFirstCallInit'; |
166 | | -$wgHooks[ 'ParserClearState' ][] = 'WikiCitation::onParserClearState'; |
167 | | -$wgHooks[ 'ParserBeforeTidy' ][] = 'WikiCitation::onParserBeforeTidy'; |
168 | 179 | |
169 | | -# Location of the CSS style sheet for this extension |
170 | | -$wgWCStyleSheet = $wgScriptPath . '/extensions/WikiCitation/WikiCitation.css'; |
| 180 | +/** |
| 181 | + * Localization files |
| 182 | + */ |
| 183 | +$wgExtensionMessagesFiles['WikiCitation'] = $mDir . '/WikiCitation.i18n.php'; |
| 184 | +$wgExtensionMessagesFiles['WikiCitationMagic'] = $mDir . '/WikiCitation.i18n.magic.php'; |
171 | 185 | |
| 186 | + |
| 187 | +/** |
| 188 | + * Set up parser hooks. |
| 189 | + */ |
| 190 | +$wgHooks[ 'ParserFirstCallInit' ][] = 'WikiCitation::onParserFirstCallInit'; |
| 191 | +$wgHooks[ 'ParserClearState' ][] = 'WikiCitation::onParserClearState'; |
| 192 | +$wgHooks[ 'ParserBeforeTidy' ][] = 'WikiCitation::onParserBeforeTidy'; |
| 193 | + |
| 194 | + |
| 195 | +/** |
| 196 | + * Set up parser test file. |
| 197 | + */ |
172 | 198 | #$wgParserTestFiles[] = $mDir . "/WikiCitationTests.txt"; |