I'll explain how to use the script step by step:
-
First, export your Zotero data:
- Open Zotero
- Right-click on a collection or your entire library
- Select "Export Collection..."
- Choose "JSON" as the format
- Save the file (e.g., as
zotero_export.json)
-
Save the Ruby script:
# Create a new file touch zotero_to_wikijs.rbThen copy the code from the artifact above into
zotero_to_wikijs.rb -
Make sure you have Ruby installed:
ruby --versionIf not installed, you can get it from ruby-lang.org or use your system's package manager
-
Run the script:
# Basic usage ruby zotero_to_wikijs.rb path/to/zotero_export.jsonThe script will:
- Create a
wiki_outputdirectory - Generate a
bibliography.mdfile inside it - Show progress in the terminal
- Create a
-
For custom settings, you can modify these lines at the top of the script:
DEFAULT_CONFIG = { date_format: '%Y-%m-%d', entry_separator: "\n\n---\n\n", output_dir: 'wiki_output', output_file: 'bibliography.md' }
The generated Markdown file will be compatible with WikiJS and include:
- Properly formatted citations
- Author information
- Publication dates
- DOIs/ISBNs when available
- Notes from Zotero
- Tags from Zotero
Need any clarification on these steps?