{"id":20885875,"url":"https://github.com/zotero/publications","last_synced_at":"2025-05-12T19:31:42.803Z","repository":{"id":7797775,"uuid":"45885234","full_name":"zotero/publications","owner":"zotero","description":"Easily display Zotero items on a webpage","archived":false,"fork":false,"pushed_at":"2023-03-04T02:52:02.000Z","size":6494,"stargazers_count":32,"open_issues_count":17,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T11:03:34.722Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zotero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T03:34:51.000Z","updated_at":"2024-05-12T20:01:22.000Z","dependencies_parsed_at":"2023-02-18T07:01:02.247Z","dependency_job_id":null,"html_url":"https://github.com/zotero/publications","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zotero%2Fpublications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zotero%2Fpublications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zotero%2Fpublications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zotero%2Fpublications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zotero","download_url":"https://codeload.github.com/zotero/publications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225148800,"owners_count":17428430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T08:14:53.668Z","updated_at":"2024-11-18T08:14:53.730Z","avatar_url":"https://github.com/zotero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zotero Publications\n\n[![CI](https://github.com/zotero/publications/actions/workflows/ci.yml/badge.svg)](https://github.com/zotero/publications/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/zotero/publications/badge.svg?branch=master)](https://coveralls.io/github/zotero/publications?branch=master)\n[![npm version](https://img.shields.io/npm/v/zotero-publications)](https://www.npmjs.com/package/zotero-publications)\n\nOverview\n--------\nThis library will pull \"My Publications\" items from Zotero API and display them in a user friendly way. It is intended to be easily embeddable on your own page. We're offering variety of builds to maximize potential use cases. Basic usage documentation and description of available builds are included below. For advanced usage please see examples and comments in the code.\n\nGetting The Library\n-------------------\n\nThe easiest way to obtain the latest version is to use npm:\n\n    npm i zotero-publications\n\nThis version will work in node and a browser:\n\n    const ZoteroPublications = require('zotero-publications');\n\nIf you're using sass/scss, you can simply point your sass include-path at your node_modules directory and import it like this.\n\n    @import \"zotero-publications/lib/scss/zotero-publications.scss\";\n\nThe npm package also contains a `dist` folder with both minified sources (js \u0026 css), which can be used in a browser directly.\n\nJavascript files in `dist` folder are following the [Universal Module Definition](https://github.com/umdjs/umd) pattern which means you can also use this library in systems that use AMD (e.g. [RequireJS](http://requirejs.org/)) or CommonJS module loader mechanism.\n\nYou will need to include one *css* and one *js* file on your page. The easiest way to do that is to add css file somewhere within `\u003chead\u003e` on your page:\n\n    \u003clink rel=\"stylesheet\" href=\"zotero-publications.min.css\"\u003e\n\nAnd add js file somewhere at the end of the file but before final `\u003c/html\u003e`:\n\n    \u003cscript src=\"zotero-publications.min.js\"\u003e\u003c/script\u003e\n\nUsage\n-----\n\nUse the following code to fetch \"My Publications\" for user ID 1234 and render them inside #container: \n\n    \u003cscript\u003e\n         new ZoteroPublications(1234, document.getElementById('container'));\n    \u003c/script\u003e\n\nYou can also specify additional configuration by passing a config object to the constructor, for example to enable grouping by item type:\n\n    \u003cscript\u003e\n         new ZoteroPublications(1234, document.getElementById('container'), {group: 'type'});\n    \u003c/script\u003e\n\nPlease see \"Config Options\" below to see all accepted parameters.\n\nFinally if you need more control over what happens while data is being retrieved, would like to introduce custom error handling or data processing, you can use the following syntax:\n\n    \u003cscript\u003e\n         var zp = new ZoteroPublications();\n         var promise = zp.getPublications(1234);\n         //optionally do something here while data is being fetched\n\n         promise.then(function(data) {\n            //optionally process your data here\n            zp.render(data, document.getElementById('container'));\n        });\n\n        promise.catch(function(reason) {\n            //optionally implement custom error handling here\n            console.warn(reason);\n        });\n    \u003c/script\u003e\n\n\nSee [src/demo/index.html](src/demo/index.html) for a complete example.\n\nUsage in Node\n-------------\n\nAs of version 0.4.0 Zotero Publications offers node compatibility for server-side rendering etc.. Please note the following limitations when using zotero-publications in node:\n\n* Since there's no DOM available, the library will return HTML as a string rather than attach it to the container provided in DOM as it happens in the browser\n* HTML provided is the same that would be rendered in the browser, including all the interactive elements (e.g. 'details link'). However these will not work out-of-the box because event hanlders are not installed when workin in Node\n* Shortcut syntax (first couple of examples above) cannot be used in Node.\n\nHere's an example usage in Node:\n\n    var ZoteroPublications = require('zotero-publications');\n    var zp = new ZoteroPublications({group: 'type'});\n    var promise = zp.render(1234); // fetch \"my publications\" for user id 1234\n\n    promise.then(function(html) {\n        console.log(html);\n    });\n    \n    promise.catch(function(err) {\n        console.error(err);\n    });\n\n\nConfig Options\n--------------\n`ZoteroPublications` takes the following configuration options:\n\n**apiBase**\nHost name of the API.\nDefault: 'api.zotero.org' \n\n**citationStyle**\nWhich [Citation style](https://www.zotero.org/styles/) if *useCitationStyle* is enabled, defined which citation style will be used for item rendering.\nDefault: '' (none, API decides)\n\n**storeCitationPreference**\nWhether to store citation preference in local storage. If enabled returning users that use \"Cite\" functionality will have the last-selected citation style preselected.\nDefault: false\n\n**group**\nEnable grouping. Accepted values are: 'type' to group by type, 'collection' to group by top-level collections and *false* to disable grouping \nDefault: false\n\n**useCitationStyle**\nWhether to use citation style instead of templated item rendering.\nDefault: false\n\n**showBranding**\nWhether to display minimalisic Zotero branding\nDefault: true\n\n**useHistory**\nWhether to store currently opened item (details pane) in the url fragment identifier. If used and fragment is present in the url, matching item will be opened scrolled to when page has first loaded.\nDefault: true\n\n**expand**\nOnly applicable if grouping is enable, pre-expands selected groups. Can be an array of group names (type names if grouping by type and collection names if grouping by top-level collections), e.g. `['book', 'journalArticle']` or a keyword 'all'.\nDefault: 'all'\n\n**citeStyleOptions**\nA map of citation styles (key =\u003e user friendly name) available in the \"Cite\" functionality select box.\nDefault: List similar to citations styles pre-installed in Zotero Client\n\n**exportFormats**\nDefinitions for export formats available in \"Export\" functionality.\nDefault: Definitions for BibTeX, RIS and Zotero RDF\n\n**getQueryParamsDefault**\nContains default query params included in all the GET requests made by the library.\nDefault: Parameters that trigger sorting by date, batching requests by 100 items etc.\n\n\nBrowser Compatibility\n=====================\n\nChrome| EDGE | Firefox | IE | Opera | Safari\n--- | --- | --- | --- | --- | --- |\nLatest ✔ | Latest ✔ | Latest ✔ | 11+ ✔ | Latest ✔ | Latest ✔ |\n\n\nDevelopment \u0026 Contributing\n===========\n\nFor setup, build, tests etc. as well as contribution guidelines please see [CONTRIBUTING.md](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzotero%2Fpublications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzotero%2Fpublications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzotero%2Fpublications/lists"}