This project fetches bibliography data from the Zotero API and generates an HTML file containing the formatted bibliography. The purpose of this project is to automatically generate HTML code that can be used to paste in the backend of TYPO3 to generate the publication lists on https://uni-tuebingen.de/cqs.
You find the recent html file here.
- Fetches all entries from the Zotero group https://www.zotero.org/groups/5693788/cqs/library.
- Supported bibliography types in zotero are: Preprint (arXiv) and Journal Article.
- Formats the bibliography items into HTML.
- Categorizes items into different sections in the html based on tags
QUSP FOR5413
andQuantera Project CoQuaDis
. - Runs automatically every night at 3:00am and generates a new
bibliography.hml
- You have to be a member of the Zotero group Center for Quantum Science.
- Create a new entry and select the type of reference
journal article
orpreprint
. - Enter all entries in unicode, no LaTeX!, no MathML!
- Fill in the details of the reference (title, authors, publication date, etc.).
- Add project tags such as
QUSP FOR5413
orQuantera Project CoQuaDis
to categorize the reference. - Save the reference.
- Open the bibliography.html in your browser.
- Copy the HTML content which you want to copy.
- Open the TYPO3 backend of the page where you want to add the bibliography.
- Paste the copied HTML content.
- Save
A GitHub Action is set up to automate the generation of the HTML bibliography. This action runs the script on a
scheduled basis daily at 03:00am and pushes the updated bibliography.html
file to the repository. This
ensures that the bibliography is always up-to-date without manual intervention.
This section is only needed if you want to change how bibliography.html
is generated.
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install the required Python packages:
pip install requests
-
Run the script to fetch data from the Zotero API and generate the HTML file:
python zotero-to-html.py
-
The generated HTML file
bibliography.html
will be created in the project directory.
- Modify the
format_item
function to change how each bibliography item is formatted. - Adjust the API URL and parameters in the
get_data
function to fetch different data or change the sorting order.