CodeMeta Tools provides a simple command line tool called cmt
that can be used to generate project files and artifacts. The project focuses on leveraging CodeMeta data, directory name and Git repo information for building and release software written in Python, Go, JavaScript or TypeScript. It was motivated by the practices in Caltech Library's Digital Development Group.
The tool is intended to be run from the project root directory. cmt
expects the file path of your codemeta.json file as well as one or more target files to be generated. The target file's extension determines the generated content. The tool can generate the following project files based on the contents of the codemeta.json file.
- CITATION.cff
- version.ts, version.js, version.go or version.py
- about.md
- page.hbs (handlebars template) or page.tmpl (Pandoc template)
The cmt
command can render a version file suitable for TypeScript, JavaScript, Go and Python projects. The version file will contain version name, release hash, release date and license information. Here's an example of rendering a "version.ts" for the CMTools project.
cmt codemeta.json version.ts
For Go you would do,
cmt codemeta.json version.go
and for Python.
cmt codemeta.json version.py
The codemeta file contains sufficient information to rendering an about page for your project. Rendering a Markdown document for that purpose can be done with the following.
cmt codemeta.json about.md
A handlebars template can be generated from the codemeta.json as well.
cmt codemeta.json page.hbs
This Handlebars template then can be used along with a handlebars template script to build the website from your repository.
A Pandoc template can be generated from the codemeta.json as well.
cmt codemeta.json page.tmpl