Skip to main content

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 description

cff2pages

pypi SWH DOI 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 envisioned as a Python package, designed to automate the extraction of metadata from your project's Citation.cff or Codemeta.json metadata files and swiftly generate a sleek, static HTML page. This versatile page can serve as a vivid representation of your project on Github/Gitlab Pages.

Supported Metadata Formats

cff2pages currently supports the following metadata formats:

  • Citation File Format (CFF)CITATION.cff
  • CodeMetacodemeta.json

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

cd project_folder
pip install cff2pages
cff2pages

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

Gitlab CI Runner

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

  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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cff2pages-0.3.0.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cff2pages-0.3.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file cff2pages-0.3.0.tar.gz.

File metadata

  • Download URL: cff2pages-0.3.0.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cff2pages-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2d7014808eea2fb86d2cced282f7c70f84f7ccc39aaf22a0a8bbd278e305b3b4
MD5 82e30b2f7412c6f213a03062e6c53af5
BLAKE2b-256 330b25701daf8475371ac80c10dcd10c97b6d1c65d627844aac580d0617c0f92

See more details on using hashes here.

File details

Details for the file cff2pages-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cff2pages-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cff2pages-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ee5a70859d6d25f37565b68cd0525f98e4ad5e821ae7afec0dd0247d9ecd2c0
MD5 d71e65fab0377b1f2bc6c754401c4b9c
BLAKE2b-256 d8ea5aa700f02c161aa77ff5ae1fc7e1d3b9df5a39b83cecad26f80b93833d35

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page