cff2pages
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
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
Release files for cff2pages 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cff2pages-0.4.0.tar.gz | 40.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cff2pages-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 68.8 kB
Release files / cff2pages-0.4.0.tar.gz
| Download URL | cff2pages-0.4.0.tar.gz |
|---|---|
| Size | 40.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
176fc29cd245a221f45f13b954eca58a918b4f00532fb75ff0a7757739548112
|
|
BLAKE2b-256 checksum How to use checksums |
d3e1f32bbf46a1859c8fbd5a81ab45ad0a51e45e2a6882b924314c4c5659d713
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / cff2pages-0.4.0-py3-none-any.whl
| Download URL | cff2pages-0.4.0-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
236f8b71766be1ee8ba3bc7f2165945b3b32b22f0407e1439d83181c997885cb
|
|
BLAKE2b-256 checksum How to use checksums |
0e352de873defa81d5dcb4945fc58338e10bb195f12f2ee4d1b0b0c32a57a748
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|