Skip to content

Commit 02b0a36

Browse files
committed
Put codemeta-generator in an iframe on the /create page, with a short guide
1 parent 87ff7ca commit 02b0a36

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

content/create.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
11
---
22
title: "Create a CodeMeta file"
3-
#layout: login
3+
layout: wide
44
---
55

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.
738

839
{{< 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+
957
<a href="https://www.softwareheritage.org">
1058
<img alt="Software Heritage logo" src="/img/swh-logo.png" style="height: 50px;"/> Software Heritage</a>
1159
{{< /rawhtml >}}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{ define "body" }}
2+
<body class="profile-page sidebar-collapse"> <!-- other classes: index-page , landing-page -->
3+
4+
{{ partial "nav.html" . }}
5+
{{ partial "page-header.html" . }}
6+
7+
8+
<div class="main main-raised">
9+
<div class="section section-basic">
10+
<div class="container" style="min-width:90%;min-height:200%">
11+
12+
{{ .Content }}
13+
14+
</div>
15+
</div>
16+
</div>
17+
18+
{{ partial "footer" . }}
19+
20+
</body>
21+
{{ end }}

themes/CodeMeta-Pyramids/static/css/codemeta.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,6 @@ code{
312312
* Errata
313313
*/
314314

315-
dl {
315+
dl, li {
316316
font-size: 14px;
317317
}

0 commit comments

Comments
 (0)