https://github.com/citation-js/plugin-template
Template for Citation.js plugins
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.9%) to scientific vocabulary
Keywords from Contributors
Repository
Template for Citation.js plugins
Basic Info
- Host: GitHub
- Owner: citation-js
- License: mit
- Language: JavaScript
- Default Branch: main
- Size: 33.2 KB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
- Releases: 0
Metadata Files
README.md
plugin-template
Template for Citation.js plugins
Usage
Initiating the template
```bash mkdir your-plugin cd your-plugin
npm init @citation-js/plugin
or 'npx @citation-js/create-plugin'
```
This triggers a few questions:
- package name: The name of the package as you want to publish it on npm
- version: The current version. I recommend
0.0.0, then you can runnpm version major,minororpatchwhen the first version is ready - description: Something like "Citation.js plugin for ..."
- entry point: You can leave this empty, unless you have some specific ideas. It gets filled in later with a more specific default
- test command: You can leave this empty as well
- git repository: If you are putting this in a Git repository, you can put the URL here
- keywords: Comma-separated list of keywords, if you want to you can include
citation-jsand the format the plugin is for - author: Your name, optionally followed by
<email>and/or(website) - license: Most current plugins are MIT-licensed, but that's your decision
- Is this OK?: Yes, unless you made a mistake of course
- What should the plugin scope name (csl, doi, bibtex) be? Up to you, but try to keep it simple, like
pubmedfor PubMed and PubMed Central Identifiers
This generates a file structure:
.
├── .gitignore
├── .travis.yml # Configuration for my CI of choice, Travis CI
├── babel.config.js # Configuration for the Babel build tool
├── package.json # package manifest for npm/Node
├── README.md
├── src
│ ├── config.js # Defines default config options
│ ├── index.js # Registers the plugin
│ ├── input.js # Defines input formats
│ └── output.js # Defines output formats
└── test
└── suite.js # test suite
Now, run:
bash
npm install
This installs the necessary development tools.
Editing source files
- If your plugin only defines input or output formats, you can remove the other file and references to that file from
index.js. - If you do not need configuration, you can remove the file and remove references to the file from
index.jsandinput.js. input.jscontains an example format with an identifier that gets parsed into an API URL, the result of which- More documentation and links can be found in comments in the source files.
- The code style is StandardJS. Linting can be done with
npm run lintand simple style issues can be corrected withnpm run lint -- --fix
Testing
- An easy way to test while developing is with the following code: ```js const core = require('@citation-js/core') // Get Citation.js require('@babel/register') // Make sure you can use modern features require('./src/') // Load the plugin you are working on
// If you are using synchronous functions const data = core.Cite(input, options) // ...
// If you are using asynchronous functions
core.Cite.async(input, options)
.then(data => /* ... */)
.catch(console.error)
``
- To write proper tests, seetest/suite.js`, which includes comments
Owner
- Name: Citation.js
- Login: citation-js
- Kind: organization
- Email: citationjs@protonmail.com
- Website: https://citation.js.org
- Twitter: citation_js
- Repositories: 24
- Profile: https://github.com/citation-js
GitHub Events
Total
- Create event: 1
Last Year
- Create event: 1
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Lars Willighagen | l****n@g****m | 20 |
| dependabot[bot] | 4****] | 1 |
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 1
- Total pull requests: 4
- Average time to close issues: about 2 months
- Average time to close pull requests: 7 months
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.5
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 4
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- larsgw (1)
Pull Request Authors
- dependabot[bot] (4)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- balanced-match 1.0.2
- brace-expansion 2.0.1
- builtins 5.0.1
- fs.realpath 1.0.0
- function-bind 1.1.1
- glob 8.0.3
- has 1.0.3
- hosted-git-info 5.0.0
- inflight 1.0.6
- inherits 2.0.4
- init-package-json 3.0.2
- is-core-module 2.9.0
- json-parse-even-better-errors 2.3.1
- lru-cache 7.10.1
- lru-cache 6.0.0
- minimatch 5.0.1
- mute-stream 0.0.8
- normalize-package-data 4.0.0
- npm-normalize-package-bin 1.0.1
- npm-package-arg 9.0.2
- once 1.4.0
- promzard 0.3.0
- read 1.0.7
- read-package-json 5.0.1
- semver 7.3.7
- spdx-correct 3.1.1
- spdx-exceptions 2.3.0
- spdx-expression-parse 3.0.1
- spdx-license-ids 3.0.11
- validate-npm-package-license 3.0.4
- validate-npm-package-name 4.0.0
- wrappy 1.0.2
- yallist 4.0.0
- init-package-json ^3.0.2