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
▶ Watch the full HD demo (MP4)
- Link Zotero items directly into your code as references.
- Insert citations into JavaScript, TypeScript, Python, R, and Julia documentation comments — including inside Jupyter Notebook (
.ipynb) cells.
- 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.
- Generate a Bibliography: Collect every citation you've inserted across a file or the whole workspace into a formatted reference list — APA, MLA, Numbered, or BibTeX.
🖼 Screenshots
A step-by-step walkthrough of what Sci2Code looks like in action.
1. Install from the VS Code Marketplace
2. Works across Python, JS/TS, R, Julia and more
3. Your Zotero library, right in the sidebar
4. Type a comment trigger → QuickPick opens
5. Pick a reference — citation is inserted
6. Or insert via the Command Palette
7. Or single-click from the sidebar
8. Multi-language templates out of the box
9. Configure everything from the Settings UI
10. Define your own citation template
11. See your custom template in the inserted block
📦 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 — including Jupyter Notebook (.ipynb) cells.
- 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.
5. Generating a Bibliography
Once you've cited a few sources in your code, turn them into a reference list:
- Open the Command Palette (
Ctrl+Shift+P).
- Run "Sci2Code: Generate Bibliography".
- Choose a scope (current file or the whole workspace), then a citation style — APA, MLA, Numbered, or BibTeX.
- Choose where it goes — inserted at your cursor, or written out to
REFERENCES.md / references.bib.
Sci2Code only includes items it can match back to your Zotero library, so the list always stays in sync with what's actually cited.
⚙️ 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 GNU AGPL-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.