项目作者: BenMMcLean

项目描述 :
Easy Wikipedia style citations using jQuery
高级语言: JavaScript
项目地址: git://github.com/BenMMcLean/WikiCite.git
创建时间: 2019-12-12T07:25:44Z
项目社区:https://github.com/BenMMcLean/WikiCite

开源协议:GNU General Public License v3.0

下载


WikiCite

Only requires jQuery!

Easy Wikipedia style citations using jQuery. Demo at https://bushfi.re or https://arctro.com/open/WikiCite

example

Usage

To use WikiCite, first create either an inline or linked citation.

Inline

  1. <span data-inline-citation="Put citation text here">Content that the citation is attached to.</span>

Linked

  1. var linkedCitations = [
  2. new Citation("identifier", "Citation text")
  3. ];

  1. <span data-linked-citation="identifier">Content that the citation is attached to.</span>

Once you have input citations, you can then call:

  1. $("body").cite(linkedCitations, [configuration, callback]);

to automatically create citation markers.

You can also add a general reference box by creating a container with the id “complete-citation-container”, like such:

  1. <div id="complete-citation-container"></div>

Configuration

WikiCite can be configured by an optional configuration object

  1. CitationConfiguration(
  2. enableCompleteCitationContainer = true, // Enable the general reference box
  3. completeCitationContainer = "#complete-citation-container", // Set the id of the general reference box container
  4. completeCitationContainerTitle = "<h2>References</h2>", // Set the title of the general reference box
  5. enableHoverContainer = true, // Enable the hover reference box
  6. hoverArrowOffset = 30, // Where the center of the hover arrow is
  7. hoverContainerFadeLength = 50) // How long the hover box fade should take

Future

  • I plan on adding structured citations with formatting
  • I also plan on adding little “link to use” markers to the general reference box