|
1 | 1 | --- |
2 | 2 | title: "Create a CodeMeta file" |
3 | | -#layout: login |
| 3 | +layout: wide |
4 | 4 | --- |
5 | 5 |
|
6 | | -Need to generate a CodeMeta compliant metadata file? Try out the [CodeMeta Generator](https://codemeta.github.io/codemeta-generator), which was created by the folks at [Software Heritage](https://www.softwareheritage.org). |
| 6 | +Need to generate a CodeMeta compliant metadata file? The folks at |
| 7 | +[Software Heritage](https://www.softwareheritage.org) maintain this tool to |
| 8 | +make that easy. |
| 9 | + |
| 10 | +The form below is both a generator and a validator for `codemeta.json` files. |
| 11 | + |
| 12 | +## Create a new CodeMeta file |
| 13 | + |
| 14 | +Generate a CodeMeta file by filling out the fields in the form below |
| 15 | +according to the [CodeMeta terms](/terms) definitions. The `Name` field in |
| 16 | +the first section is mandatory. |
| 17 | + |
| 18 | +Providing the `Name` of your software will result in a basic `codemeta.json` |
| 19 | +output in the final textarea. Filling out additional fields will build a |
| 20 | +more complete file. The version of CodeMeta can be selected with the |
| 21 | +`Generate codemeta.json v2.0` or `Generate codemeta.json v3.0` buttons above |
| 22 | +the final textarea. |
| 23 | + |
| 24 | +Some fields require specific formatting. The example text in the fields will |
| 25 | +hint the required formatting. Errors will be highlighted by the generator as |
| 26 | +they are encountered. |
| 27 | + |
| 28 | +Your generated file may be copied from the text area, or downloaded with the |
| 29 | +`Download codemeta.json` button above the field. |
| 30 | + |
| 31 | +## Check a CodeMeta file |
| 32 | + |
| 33 | +Pasting the contents of your current `codemeta.json` file into the final |
| 34 | +textarea will allow you to: |
| 35 | +- Validate the syntax with the `Validate codemeta.json` button, and |
| 36 | +- Pre-fill the other form fields with your current values using the |
| 37 | +`Import codemeta.json` button. |
7 | 38 |
|
8 | 39 | {{< rawhtml >}} |
| 40 | +<script type="text/javascript"> |
| 41 | + function iframeResize() { |
| 42 | + const iFrameID = document.getElementById('generator'); |
| 43 | + if(iFrameID) { |
| 44 | + iFrameID.height = ""; |
| 45 | + iFrameID.height = (iFrameID.contentWindow.document.body.scrollHeight + 50) + "px"; |
| 46 | + } |
| 47 | + } |
| 48 | +window.addEventListener('resize', function() { |
| 49 | + iframeResize() |
| 50 | +}); |
| 51 | + |
| 52 | +</script> |
| 53 | +<iframe id="generator" onload="iframeResize()" src="/codemeta-generator" class="d-inline-block w-100" frameborder="0"> |
| 54 | + If there is no form visible here, you can also access the [CodeMeta Generator](https://codemeta.github.io/codemeta-generator) directly. This may be due to browser security settings. |
| 55 | +</iframe> |
| 56 | + |
9 | 57 | <a href="https://www.softwareheritage.org"> |
10 | 58 | <img alt="Software Heritage logo" src="/img/swh-logo.png" style="height: 50px;"/> Software Heritage</a> |
11 | 59 | {{< /rawhtml >}} |
0 commit comments