forked from codemeta/codemeta-generator
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
546 lines (467 loc) · 24.3 KB
/
Copy pathindex.html
File metadata and controls
546 lines (467 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
<!doctype html>
<!--
Copyright (C) 2019-2020 The Software Heritage developers
See the AUTHORS file at the top-level directory of this distribution
License: GNU Affero General Public License version 3, or any later version
See top-level LICENSE file for more information
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>CodeMeta generator</title>
<script src="./js/utils.js" ></script>
<script src="./js/fields_data.js"></script>
<script src="./js/dynamic_form.js"></script>
<script src="./js/codemeta_generation.js"></script>
<script src="./js/validation/primitives.js"></script>
<script src="./js/validation/things.js"></script>
<script src="./js/validation/index.js"></script>
<link rel="stylesheet" type="text/css" href="./main.css">
<link rel="stylesheet" type="text/css" href="./codemeta.css">
</head>
<body>
<header>
<h1>Auto CodeMeta generator v3.0</h1>
</header>
<main>
<p>Add a repository URL or start completing the fields below to generate a CodeMeta file. Most fields are optional. Mandatory fields will be highlighted when generating Codemeta.</p>
<noscript>
<p id="noscriptError">
This application requires Javascript to show dynamic fields in the form,
and generate a JSON file; but your browser does not support Javascript.
If you cannot use a browser with Javascript support, you can try
<a href="https://codemeta.github.io/tools/">one of the other available tools</a>
or write the codemeta.json file directly.
</p>
</noscript>
<div class="dynamicFields">
<fieldset id="fieldsetRepository" class="leafFieldset">
<legend>Online repository</legend>
<p title="Url of the repository">
<label for="url_repo">Url</label>
<input type="text" name="url_repo" id="url_repo" aria-describedby="url_repository_descr"
placeholder="https://github.com/You/reponame"/>
<span class="field-description" id="url_repository_descr">URL of the source code repository to describe. GitHub and GitLab repositories supported</span>
<input type="button" id="downloadRepo" value="Complete properties from selected repository"
title="Fill out the form with properties from online repository" />
<!-- <div id="spinner" style="display:none;">🔄 Migrating...</div> -->
<!-- <div class="spinner" id="spinner"></div> -->
</p>
</fieldset>
</div>
<form id="inputForm">
<fieldset id="fieldsetSoftwareItself" class="leafFieldset">
<legend>The software itself</legend>
<p title="The name of the software">
<label for="name">Name</label>
<input type="text" name="name" id="name" aria-describedby="name_descr"
placeholder="My Software" required="required" />
<span class="field-description" id="name_descr">the software title</span>
</p>
<p title="a brief description of the software">
<label for="description">Description</label>
<textarea rows="10" cols="50"
name="description" id="description"
placeholder="My Software computes ephemerides and orbit propagation. It has been developed from early ´80." ></textarea>
</p>
<p title="The date on which the software was created.">
<label for="dateCreated">Creation date</label>
<input type="text" name="dateCreated" id="dateCreated"
placeholder="YYYY-MM-DD" pattern="\d{4}-\d{2}-\d{2}" />
</p>
<p title="Date of first publication.">
<label for="datePublished">First release date</label>
<input type="text" name="datePublished" id="datePublished"
placeholder="YYYY-MM-DD" pattern="\d{4}-\d{2}-\d{2}" />
</p>
<p>
<label for="license">License(s)</label>
<input list="licenses" name="license" id="license"
aria-describedby="licenses_descr"> <!-- TODO: insert placeholder -->
<datalist id="licenses">
</datalist>
<input type="hidden" id="selectedLicensesHidden" name="selectedLicensesHidden" value="">
<!-- This datalist is be filled automatically -->
<br />
<span class="field-description" id="licenses_descr">from <a href="https://spdx.org/licenses/">SPDX licence list</a></span>
<div id="selected-licenses">
<!-- This div is to be filled as the user selects licenses -->
</div>
</p>
</fieldset>
<fieldset id="fieldsetDiscoverabilityAndCitation" class="leafFieldset">
<legend>Discoverability and citation</legend>
<p title="Unique identifier">
<label for="identifier">Software unique identifier</label>
<input type="text" name="identifier" id="identifier"
placeholder="10.151.xxxxx, Zenodo DOI" aria-describedby="identifier_descr" />
<br />
<span class="field-description" id="identifier_descr">
such as ISBNs, GTIN codes, UUIDs etc.. <a href="http://schema.org/identifier">http://schema.org/identifier</a>
</span>
</p>
<!-- TODO:define better
I looked at the schema.org definition of identifier (https://schema.org/identifier),
it can be text, url or PropertyValue.
Used as follows in data representation with microdata:
<div property="identifier" typeof="PropertyValue">
<span property="propertyID">DOI</span>:
<span property="value">10.151.xxxxx</span>
</div>
we can use that with identifier-type and identifier-value to have a clearer idea
of what needs to be in the input.
-->
<p title="Type of the software application">
<label for="applicationCategory">Application category</label>
<input type="text" name="applicationCategory" id="applicationCategory"
placeholder="Astronomy" />
</p>
<p title="Comma-separated list of keywords">
<!-- <label for="keywords">Keywords</label> -->
<input type="hidden" name="keywords" id="keywords"
placeholder="ephemerides, orbit, astronomy" disabled />
<!-- <input type="text" name="keywords" id="keywords"
placeholder="ephemerides, orbit, astronomy" disabled /> -->
Keywords can be added below
</p>
<p title="Funding / grant">
<label for="funding">Funding</label>
<input type="text" name="funding" id="funding" aria-describedby="funding_descr"
placeholder="PRA_2018_73"/>
<br />
<span class="field-description" id="funding_descr">grant funding software development</span>
</p>
<p title="Funding / organization">
<label for="funder">Funder</label>
<input type="text" name="funder" id="funder" aria-describedby="funder_descr"
placeholder="Università di Pisa"/>
<br />
<span class="field-description" id="funder_descr">organization funding software development</span>
</p>
</fieldset>
<fieldset id="fieldsetDevelopmentCommunity" class="leafFieldset">
<legend>Development community / tools</legend>
<p title="Link to the repository where the un-compiled, human readable code and related code is located (SVN, Git, GitHub, CodePlex, institutional GitLab instance, etc.).">
<label for="codeRepository">Code repository</label>
<input type="URL" name="codeRepository" id="codeRepository"
placeholder="git+https://github.com/You/RepoName.git" />
</p>
<p title="Link to continuous integration service (Travis-CI, Gitlab CI, etc.).">
<label for="contIntegration">Continuous integration</label>
<input type="URL" name="contIntegration" id="contIntegration"
placeholder="https://travis-ci.org/You/RepoName" />
</p>
<p title="Link to a place for users/developpers to report and manage bugs (JIRA, GitHub issues, etc.).">
<label for="issueTracker">Issue tracker</label>
<input type="URL" name="issueTracker" id="issueTracker"
placeholder="https://github.com/You/RepoName/issues" />
</p>
<p title="Related document, software, tools">
<label for="relatedLink">Related links</label>
<br />
<textarea rows="10" cols="50"
name="relatedLink" id="relatedLink"></textarea>
</fieldset>
<fieldset id="fieldsetRuntime" class="leafFieldset">
<legend>Run-time environment</legend>
<p title="Programming Languages, separated by commas">
<label for="programmingLanguage">Programming Language</label>
<input type="text" name="programmingLanguage" id="programmingLanguage"
placeholder="C#, Java, Python 3" />
</p>
<p title="Runtime Platforms, separated by commas">
<label for="runtimePlatform">Runtime Platform</label>
<input type="text" name="runtimePlatform" id="runtimePlatform"
placeholder=".NET, JVM" />
</p>
<p title="Operating Systems, separated by commas">
<label for="operatingSystem">Operating System</label>
<input type="text" name="operatingSystem" id="operatingSystem"
placeholder="Android 1.6, Linux, Windows, macOS" />
</p>
<p title="Required software to run/use this one.">
<!-- <label for="softwareRequirementsLabel">Other software requirements</label> -->
<label>Other software requirements</label>
<br />
<!-- <textarea rows="10" cols="50"
name="softwareRequirements" id="softwareRequirements"
placeholder=
"Python 3.4
https://github.com/psf/requests"></textarea> -->
<table name="softwareRequirements" id="softwareRequirements">
<thead>
<tr>
<th>Name/Text</th>
<th>Version</th>
<!-- <th><button onclick="addRowRequirements()">+</button></th> -->
<th><input type="button" id="requirements_add" value="+"
onclick="addRowRequirements();" /></th>
</tr>
</thead>
<tbody>
<!-- <tr>
<td><input type="text" name="nameText"></td>
<td><input type="text" name="version"></td>
<td><button onclick="deleteRow(this)">-</button></td>
</tr> -->
</tbody>
</table>
</fieldset>
<fieldset id="fieldsetCurrentVersion" class="leafFieldset">
<legend>Current version of the software</legend>
<p title="Version number of the software">
<label for="version">Version number</label>
<input type="text" name="version" id="version"
placeholder="1.0.0" />
</p>
<p title="The date on which the software was most recently modified.">
<label for="dateModified">Release date</label>
<input type="text" name="dateModified" id="dateModified"
placeholder="YYYY-MM-DD" pattern="\d{4}-\d{2}-\d{2}" />
</p>
<p title="Download link">
<label for="downloadUrl">Download URL</label>
<input type="URL" name="downloadUrl" id="downloadUrl"
placeholder="https://example.org/MySoftware.tar.gz" />
</p>
<p title="a brief description of the software">
<label for="releaseNotes">Release notes</label>
<br />
<textarea rows="10" cols="50"
name="releaseNotes" id="releaseNotes"
placeholder=
"Change log: this and that;
Bugfixes: that and this." ></textarea>
</p>
<!--TODO: referencePublication as ScholarlyArticle array -->
</fieldset>
<fieldset id="review_container" class="leafFieldset">
<!-- <legend>Editorial review</legend> -->
<legend>Reference Publication</legend>
<!-- <p title="Scholarly article describing this software">
<label for="referencePublication">Reference Publication</label>
<input type="URL" name="referencePublication" id="referencePublication"
placeholder="https://doi.org/10.1000/xyz123" />
</p> -->
<p title="Scholarly article describing this software">
<label for="referencePublicationUrl">Reference Publication URL</label>
<input type="URL" name="referencePublicationUrl" id="referencePublicationUrl"
placeholder="https://doi.org/10.1000/xyz123" />
</p>
<p title="Title of the publication">
<label for="publicationTitle">Title of publication</label>
<input type="text" name="publicationTitle" id="publicationTitle"
placeholder="Title" />
</p>
<p title="DOI of the publication">
<label for="publicationDOI">DOI of publication</label>
<input type="text" name="publicationDOI" id="publicationDOI"
placeholder="DOI" />
</p>
<p title="ISSN of the publication">
<label for="issn">ISSN of publication</label>
<input type="text" name="issn" id="issn"
placeholder="ISSN" />
</p>
<p title="Date published">
<label for="publicationDatePublished">Date of publication</label>
<input type="text" name="publicationDatePublished" id="publicationDatePublished"
placeholder="Date Published" />
</p>
Authors (either persons or organizations) can be added below
<fieldset class="persons" id="author_reference_container">
<legend>Authors</legend>
<input type="hidden" id="author_reference_nb" value="0" />
<input type="hidden" id="current_author_reference_index" value="0" />
<div id="addRemoveAuthor">
<button type="button" onclick="showPrevAuthorRef()">←</button>
<input type="button" id="author_reference_add" value="Add one"
onclick="addPerson('author_reference', 'Author_ref');" />
<input type="button" id="author_reference_remove" value="Remove last"
onclick="removePerson('author_reference', true);" />
<button type="button" onclick="showNextAuthorRef()">→</button>
<label id="authorCountLabel">Nº Authors: 0</label>
</div>
</fieldset>
<!-- <p title="Part or facet of the object being review ">
<label for="reviewAspect">Review aspect</label>
<input type="text" name="reviewAspect" id="reviewAspect"
placeholder="Object facet" />
</p> -->
<!--
<p title="The actual body of the review ">
<label for="reviewBody">Review body</label>
<textarea rows="4" cols="50"
name="reviewBody" id="reviewBody"
placeholder="Review about my software." ></textarea>
</p> -->
</fieldset>
<fieldset id="fieldsetAdditionalInfo" class="leafFieldset">
<legend>Additional Info</legend>
<p title="Development Status">
<label for="developmentStatus">Development Status</label>
<datalist id="developmentStatuses">
<option value="concept">
<option value="wip">
<option value="suspended">
<option value="abandoned">
<option value="active">
<option value="inactive">
<option value="unsupported">
<option value="moved">
</datalist>
<input list="developmentStatuses" id="developmentStatus" aria-describedby="developmentStatuses_descr"
pattern="concept|wip|suspended|abandoned|active|inactive|unsupported|moved">
<br />
<span class="field-description" id="developmentStatuses_descr">
see <a href="http://www.repostatus.org">www.repostatus.org</a> for details
</span>
</p>
<p title="Source Code of">
<label for="isSourceCodeOf">Is Source Code of</label>
<input type="text" name="isSourceCodeOf" id="isSourceCodeOf"
placeholder="Bigger Application" />
</p>
<p title="Part of">
<label for="isPartOf">Is part of</label>
<input type="URL" name="isPartOf" id="isPartOf"
placeholder="http://The.Bigger.Framework.org" />
</p>
</fieldset>
<div class="dynamicFields">
<fieldset class="keywords" id="keyword_container">
<legend>Keywords</legend>
<input type="hidden" id="keyword_nb" value="0" />
<div id="addRemoveKeywords">
<input type="button" id="keyword_add" value="Add one"
onclick="addKeyword()" />
<input type="button" id="keyword_remove" value="Remove last"
onclick="removeKeyword(true)" />
</div>
</fieldset>
<fieldset class="persons" id="author_container">
<legend>Authors</legend>
<input type="hidden" id="author_nb" value="0" />
<div id="addRemoveAuthor">
<input type="button" id="author_add" value="Add one"
onclick="addPerson('author', 'Author');" />
<input type="button" id="author_remove" value="Remove last"
onclick="removePerson('author', true);" />
</div>
</fieldset>
<fieldset class="persons" id="contributor_container">
<legend>Contributors</legend>
<p>Order of contributors does not matter.</p>
<input type="hidden" id="contributor_nb" value="0" />
<div id="addRemoveContributor">
<input type="button" id="contributor_add" value="Add one"
onclick="addPerson('contributor', 'Contributor');" />
<input type="button" id="contributor_remove" value="Remove last"
onclick="removePerson('contributor', true);" />
</div>
</fieldset>
</div>
</form>
<div class="spinner" id="spinner"></div>
<form>
<input type="button" id="generateCodemetaV3" value="Generate codemeta.json v3.0" disabled
title="Creates a codemeta.json v3.0 file below, from the information provided above." />
<input type="button" id="generateCodemetaV2" value="Generate codemeta.json v2.0" disabled
title="Creates a codemeta.json v2.0 file below, from the information provided above." />
<input type="button" id="resetForm" value="Reset form"
title="Erases all fields." />
<input type="button" id="validateCodemeta" value="Validate codemeta.json" disabled
title="Checks the codemeta.json file below is valid, and displays errors." />
<input type="button" id="importCodemeta" value="Import codemeta.json" disabled
title="Fills the fields above based on the codemeta.json file below." />
<a id="downloadCodemeta"><input type="button" value="Download codemeta.json" disabled
title="Download the codemeta.json file as displayed below." /></a>
</form>
<p id="errorMessage">
</p>
<p>codemeta.json:</p>
<pre contentEditable="true" id="codemetaText"></pre>
</main>
<footer style="font-size: 0.9em; margin-top: 2em; padding: 0 2em;">
<div style="text-align: center;">
<p>
Do you want to improve this tool?
Check out the
<a href="https://github.com/oeg-upm/auto-codemeta-generator">
Auto-Codemeta repository</a>.
Join the
<a href="https://github.com/codemeta/codemeta">CodeMeta community</a>
discussion.
</p>
<p>
<strong>CodeMeta vocabulary:</strong>
<a href="https://doi.org/10.5063/schema/codemeta-2.0">v2.0</a> /
<a href="https://w3id.org/codemeta/3.0">v3.0</a>
|
<span id="version_somef">getting somef version...</span>
|
<span id="release_codemeta_generator">getting latest release...</span>
</p>
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 20px; flex-wrap: wrap;">
<p style="margin: 0; padding: 0 1em; max-width: 700px; text-align: center;"">
The authors acknowledge the OSCARS project, which has received funding from the European Commission's Horizon Europe Research and Innovation programme under grant agreement No. 101129751.
</p>
<div style="display: flex; align-items: center; gap: 10px; margin: 10px 1em 0 1em;">
<span style="font-weight: bold;">Contributed by</span>
<a href="https://www.softwareheritage.org/save-and-reference-research-software/">
<img alt="Software Heritage" src="https://annex.softwareheritage.org/public/logo/software-heritage-logo-title-motto.svg" width="130">
</a>
<a href="https://oeg.fi.upm.es/">
<img src="assets/logo.gif" alt="OEG logo" class="img-rounded" width="65">
</a>
</div>
</div>
</footer>
<script src="./js/libs/jsonld/jsonld.min.js"></script>
<script>
Promise.all([loadSpdxData(), loadContextData()]).then(results => {
const [licenses, contexts] = results;
SPDX_LICENSES = licenses;
SPDX_LICENSE_IDS = licenses.map(license => license['licenseId']);
initJsonldLoader(contexts);
initFields();
initCallbacks();
loadStateFromStorage();
});
fetch('js/config.json')
.then(response => response.json())
.then(config => {
const apiUrl = config.fastapi_url + '/version';
return fetch(apiUrl);
})
.then(response => response.json())
.then(data => {
document.getElementById('version_somef').innerHTML = `<strong>Somef version:</strong> ${data.somef_version}`;
})
.catch(error => console.error('Error fetching version:', error));
fetch('js/config.json')
.then(response => response.json())
.then(config => {
const apiUrl = config.fastapi_url + '/latest_release';
console.log(apiUrl)
return fetch(apiUrl);
})
.then(response => response.json())
.then(data => {
// console.log('Release data:', data);
// document.getElementById('release_codemeta_generator').innerText =
// `Autocodemeta Generator latest release: ${data}`;
const element = document.getElementById('release_codemeta_generator');
if (typeof data === 'string') {
element.innerHTML = `<strong>Autocodemeta Generator latest release:</strong> ${data}`;
} else if (data.detail) {
element.innerHTML = '<strong>Autocodemeta Generator latest release:</strong> No release available';
} else {
element.innerHTML = '<strong>Autocodemeta Generator latest release:</strong> Unknown';
}
})
.catch(error => console.error('Error fetching version:', error));
</script>
</body>
</html>