https://bugzilla.wikimedia.org/show_bug.cgi?id=26786
--- Comment #10 from [email protected] 2011-05-04 07:18:18 UTC --- Created attachment 8493 --> https://bugzilla.wikimedia.org/attachment.cgi?id=8493 Proposed patch which adds infrastructure for multiple style formats and additional i18n Svippong, I have been testing and tinkering with the existing source code. On http://en.wikipedia.org/wiki/Template_talk:Citation/core, there was a brief discussion about the possibility of incorporating several alternative citation styles, such as APA, MLA, Bluebook, Chicago Manual of Style, etc. As a demonstration and to see if it would work, I have put together a patch that implements this functionality. It is attached as TA-patch-cogden.patch, and it appears to work without issue. It differs from the existing code in one significant way: instead of the first unnamed parameter after the colon being a selector for the type of work cited, it is now a selector for the citation style. This adds flexibility and the possibility for multiple citation styles such as Bluebook for citing legal references, or unknown future citation styles we can't foresee. The user can still include an unnamed parameter for the type of work cited (i.e., "book", etc.), but it would come at least after the first pipe symbol. Thus, an example function call might look like this: {{#citation:APA|book|last=Smith|first=John|title=My Book|publisher=Random House}}. Instead of "APA", the first unnamed parameter can be blank or "default" in which case the function follows a default style, which would be simliar to what is now done by Citation/core. Alternatively, the user could use parameters such as "MLA", "Bluebook", "Chicago", etc. There will be separate classes deriving from TemplateAdventureBasic for each citation style. I have included in this patch the example file and class CitationChicago which currently does not render Chicago style citations, but could be made to do so as an example of a second citation style. In my patch, un-named parameters may occur anywhere within the template call, and may be recognized by the TemplateAdventureBasic-derived class. Depending on the particular styling format, these parameters might, for example be "book", "journal", "news", "web", etc. I've tested the patch, and it seems to work well, and it does use the CitationChicago class when a call such as {{#citation:Chicago|...}} is made, although CitationChicago for now is no different from the default class. Most of the time, I think users will use the default call with {{#citation:|...}} or {{#citation:|web|...}}. I haven't changed any of the details of rendering the citation in the Citation class. Also, I have added a bit of additional internationalization. Any thoughts? I don't currently have commit rights, but I'm excited about this project and would love to assist. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
