Metadata-Version: 2.5
Name: cff2pages
Version: 0.4.0
Summary: This repository generates HTML pages or Markdown sites for GitHub and GitLab based on your Citation.cff or codemeta.json file. This ensures that your CFF is optimized for both machine processing and human readability.
Project-URL: Homepage, https://github.com/University-of-Potsdam-MM/cff2pages
Project-URL: Documentation, https://github.com/University-of-Potsdam-MM/cff2pages
Project-URL: Bug Tracker, https://github.com/University-of-Potsdam-MM/cff2pages/issues
Project-URL: Repository, https://github.com/University-of-Potsdam-MM/cff2pages/
Project-URL: Changelog, https://university-of-potsdam-mm.github.io/cff2pages/changelog.html
Author-email: Jan Bernoth <jan.bernoth@uni-potsdam.de>
Maintainer-email: Jan Bernoth <jan.bernoth@uni-potsdam.de>
License: MIT
License-File: LICENSE
Keywords: cff,citation,codemeta,html,markdown,research software,schema.org
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.12
Requires-Dist: cffconvert>=2.0.0
Requires-Dist: jinja2>=3.1.6
Provides-Extra: docs
Requires-Dist: myst-parser~=5.1.0; extra == 'docs'
Requires-Dist: sphinx-rtd-theme~=3.1.0; extra == 'docs'
Requires-Dist: sphinx~=9.1.0; extra == 'docs'
Provides-Extra: test
Requires-Dist: beautifulsoup4~=4.15.0; extra == 'test'
Requires-Dist: flake8~=7.4.1; extra == 'test'
Requires-Dist: markdown~=3.10.3; extra == 'test'
Requires-Dist: pytest~=9.1.1; extra == 'test'
Description-Content-Type: text/markdown

# cff2pages

[![pypi](https://img.shields.io/pypi/v/cff2pages.svg)](https://pypi.org/project/cff2pages/)
[![SWH](https://archive.softwareheritage.org/badge/origin/https://github.com/University-of-Potsdam-MM/cff2pages/)](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/University-of-Potsdam-MM/cff2pages)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8213987.svg)](https://doi.org/10.5281/zenodo.8213986)
[![fair-software.eu](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow)](https://fair-software.eu)

## Motivation

The Citation.cff is a fantastic format that combines human-readable and machine-readable metadata
about its repository. It provides linking systems with important metadata about the
presented project and gives people the ability to reference the project, among other things.
However, for a wide range of users, the YAML file format can seem intimidating, whereas a clean
website is generally more readable. This project aims to automate the conversion of cff or codemeta files, so that
maintaining the cff file pays off for developers in terms of the project's presentation, thereby ensuring that the
website representation is retained.

## Project Description

cff2pages is a Python package that reads project metadata from CITATION.cff or codemeta.json files and produces a static
HTML page as output. The generated page displays citation and project information in human-readable form. Schema.org
markup is included in the HTML output to enable search engines and other tools to parse project metadata
programmatically. The page is intended for deployment on static hosting services such as GitHub Pages or GitLab Pages.

## Supported Metadata Formats

cff2pages currently supports the following metadata formats:

- **Citation File Format (CFF)** – `CITATION.cff`
- **CodeMeta** – `codemeta.json`
- **Schema.org** – embedded in generated HTML

If both files exist in a repository, you can explicitly select one using the `-i` option.

## Usage

```
usage: cff2pages [-h] [-i [INPUT]] [-o [OUTPUT]]

Converts citation information in Citation or Codemeta File Format into HTML or Markdown

options:
  -h, --help            show this help message and exit
  -i [INPUT], --input [INPUT]
                        path to the input CFF file. Default: ./CITATION.cff ./codemeta.json
  -o [OUTPUT], --output [OUTPUT]
                        path to the output file. Default: public/citation.html
  -cb, --no-citation-box
                        Disable citation box. 
```

### Example

```` bash
cd project_folder
pip install cff2pages
cff2pages
````

By default, output will be written to `public/citation.html`.

### Gitlab CI Runner

````yaml
stages:
  - Pages

pages:
  stage: Pages
  image: python:3.12
  script:
    - python -m pip install cff2pages
    - cff2pages -o public/index.html
  artifacts:
    paths:
      - public
````

### Github Workflow

````yaml
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up Python 3.12
        uses: actions/setup-python@v3
        with:
          python-version: 3.12
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install cff2pages
          cff2pages -o public/index.html
      - name: Setup Pages
        uses: actions/configure-pages@v3
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v2
        with:
          path: './public'
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v2
````