Citoid/Enabling Citoid on your wiki/zh

Citoid 是一个自动填充的引文生成器，它根据 URL 或一些学术参考标识符（如 DOI、PMID、PMCID 和 ISBN）自动从在线资源创建引文模板. 它目前以 可视化编辑器功能，并在 1 美元. Citoid使用Zotero翻译器将页面链接转换为详细信息.

center|700px





第1步：启用引用模板工具
Citoid 服务使用 可视化编辑器的引文工具. 这已经在大多数大型维基百科和许多较小的项目中启用. 如果启用了引文工具，则"" 菜单将列出一个或多个本地引文模板，以及 ""和"". 如果未启用引文工具，则需要先启用它，然后再继续，按照Citation tool definition. 每个引文模板都需要正常的模板数据来工作.



第2步：配置Citoid
必须使用特殊的模板数据映射和特定于 Citoid 的特殊消息来配置 Citoid 扩展. 按顺序执行这两个步骤很重要！



第2a步：为每个引用模板创建“citoid”地图值
由于Citoid对于每种文档类型都有自己的一套字段（例如，期刊名称在Citoid中叫做“publicationTitle”，但在Template:Cite_journal中叫做“journal”），所以您需要在每个引用模板的TemplateData中添加 ，叫做“citoid”. 此 特殊映射 在 Citoid 的字段和模板的字段之间创建映射. 该地图必须称为“citoid”，才能让 Citoid 扩展知道要查找哪个地图. maps 对象中允许无限数量的具有唯一键的映射. 请注意，您只能在编辑模式下查看模板数据映射;它们在模板数据表中不可见. 另外请注意，如果您最近通过从其他wiki复制来创建了您的wiki的TemplateData，那么它可能已经包含了Citoid地图，所以您可以在验证后跳过这一步.

与Citoid扩展兼容的最新地图对象在英语维基百科上：
 * w:Template:Cite news/doc
 * w:Template:Cite journal/doc
 * w:Template:Cite web/doc
 * w:Template:Cite book/TemplateData
 * w:Template:Citation/doc



步骤2.b：配置特殊的MediaWiki消息
您需要配置一个特殊的 MediaWiki： namespace message， 这条消息将34种原生Citoid类型（ ， ， ， ， 等）映射到相应的模板（Cite web，Cite book，Cite journal等）.

您应将本地引文模板与每个 Citoid 类型匹配. 如果没有匹配到对应的模板，Citoid 将不起作用. 有一个不好的匹配总比没有匹配好. For example, your wiki may not have a special template for citing the liner notes in the packaging for a DVD, so consider using a template designed for a book or a video in that case. You may consider using a generic template, such as en.wiki's Template:Citation, as a catch-all for types if there is no good match for the type of source you are mapping.

An example namespace message can be found on English Wikipedia: https://en.wikipedia.org/wiki/MediaWiki:Citoid-template-type-map.json.

The new cite button does not appear in the toolbar


When you create the MediaWiki message in step 2.b, the previous cite drop-down menu (File:VisualEditor_-_Cite_Pulldown.png) should be replaced by a new button for the citoid service in the toolbar menu. If the new button does not appear in the toolbar, then there may be a problem with MediaWiki:Citoid-template-type-map.json. If this page does not exist locally, or if the JSON on that page is invalid, then citoid will not work. Alternatively, you may need to refresh your JavaScript cache.

Empty references appear
Empty references most commonly appear when you are trying to insert a citation template that has no maps data. This problem also appears if the template has maps data, but that data is not reaching the MediaWiki API. If the maps object is present in TemplateData block in the template's documentation, then try making a "null edit" on the template. If that doesn't work, then there may be an issue with the map itself.

My favorite site isn't recognized by Citoid and only gets basic information
The Citoid service relies on the brilliant Zotero community for much of the "magic", as Zotero translators need to be written for each site. You can see a list of all Zotero translators at https://github.com/zotero/translators. Right now, Zotero best supports English-language sources. We need your help to improve coverage of other sites. You can write your own Zotero translator. Start by looking at an existing translator of a similar website, and by reading the tutorial at Citoid/Creating Zotero translators.

Dates are formatted differently on my wiki
Dates with full information (month, year, and day) are in ISO format, which is an international standard. If the community doesn't like the way this looks to the user, it is possible to edit the citation template to format the ISO dates to something that is standard in your language. For instance, you can add logic to the template such that if the date is detected to be in ISO yyyy-mm-dd format, the date is reformatted *to appear* to be dd/mm/yyyy on the page. However, if you do this, the underlying data (i.e. when you edit the wikitext, or the form in VisualEditor) will still remain the same.

Dates with only month and year are in also in ISO (YYYY-MM) but these are not accepted by some citation templates. See.

Many language wiki templates (pl, it, en) don't accept xx-XX style language codes
See for the related task. See the thread at to learn how different wikis decided to workaround this limitation.



参见

 * Zotero tutorial
 * Zotero translation server -- xpcshell-based Zotero translation server, and zotero-node, an abandoned nodejs equivalent
 * Valid field names for each item type
 * Zotero field mappings
 * Research:Citoid support for Wikimedia references
 * https://www.zotero.org/support/dev/translators/testing
 * Learn how to write a translator with Sebastian Karcher, Zotero (video, slides, links)
 * List of websites with Zotero translators
 * Examples of different itemType URLs
 * James Forrester talks Citoid and Zotero at m:WikiCite 2017