Sci2Code
Integrate your Zotero library directly into your Research and Development workflow.
Sci2Code bridges the gap between your research library and your code. Seamlessly integrate Zotero, your trusted reference manager, directly into Visual Studio Code. Easily link academic articles, papers, and other resources from your Zotero library as inline citations in your code using JSDoc, PyDoc, and other documentation standards.
🚀 Features
- Link Zotero items directly into your code as references.
- Insert citations into JavaScript, Python, and R documentation comments.
- Manual citations: Add citations for sources not in your Zotero library.
- Browse and search your Zotero library from within VS Code.
- Context-Aware Suggestions: Type comment triggers like
""" or /** to get instant citation suggestions.
📦 Installation
You can install the extension from within Visual Studio Code or download it from the Visual Studio Code Marketplace.
⚡ Get Started
- Open a Supported File: Works with Javascript (
.js), Typescript (.ts), Python (.py), Julia (.jl), R (.r), and more.
- Configure API Key:
- Go to Zotero API Settings and create a new key (Read/Write access).
- In VS Code, open Settings (
Ctrl+,), search for sci2code.apiKey, and paste your key.
- The status bar will update to
$(zap) Zotero: Ready.
🛠 Usage
1. Using the Command Palette
- Open the Command Palette (
Ctrl+Shift+P).
- Run "Sci2Code: Insert Zotero Citation".
- Search and select your reference, or choose "Create Manual Citation" to enter citation details manually.
2. Manual Citations
If you need to cite a source that's not in your Zotero library:
- Open the Command Palette (
Ctrl+Shift+P).
- Run "Sci2Code: Insert Manual Citation".
- Enter the citation details (title, authors, year, DOI, URL, etc.).
- The citation will be inserted using the same template format as Zotero citations.
Tip: Manual citation is also available as the first option when using "Insert Zotero Citation".
- Click the Zotero icon in the Activity Bar.
- Browse or search your library.
- Click any item to insert as citation.
Type a trigger (e.g., """ in Python, /** in JS) above a function to see a searchable list of your Zotero items.
⚙️ Configuration
Customize the extension to fit your workflow in Settings (Ctrl+, > Sci2Code).
- Custom Triggers: changing the default comment triggers.
- Templates: Define how citations appear using placeholders like:
${zotero.title} - Article/book title
${zotero.creators} - Authors
${zotero.date} - Publication year
${zotero.DOI} - Digital Object Identifier
${zotero.url} - Web link to the item
${zotero.key} - Zotero item key
${zotero.publicationTitle} - Journal/conference name
${zotero.itemType} - Type of reference
${code.id} - Unique code identifier
${code.functionName} - Associated function name
Example Template Customization
"sci2code.templates": {
"python": [
"\"\"\"",
"Reference: ${zotero.title}",
"Authors: ${zotero.creators}",
"DOI: ${zotero.DOI}",
"URL: ${zotero.url}",
"\"\"\""
]
}
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details on how to set up your development environment, run tests, and open Pull Requests.
This project follows a Code of Conduct and Governance Model.
📄 License
This project is licensed under the GPL-3.0 License.
If you encounter issues or have feature requests, please Open an Issue or contact The Self Research Institute at support@selfresearch.org.