-
Notifications
You must be signed in to change notification settings - Fork 0
/
bib-gen.html
75 lines (71 loc) · 2.47 KB
/
bib-gen.html
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
<!DOCTYPE html>
<html>
<head>
<title>Bibliography Generator</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function() {
$('#citationForm').on('submit', function(e) {
e.preventDefault();
var citation = {
"author": $('#author').val(),
"title": $('#title').val(),
"journal": $('#journal').val(),
"year": $('#year').val(),
"url": $('#url').val(),
"publisher": $('#publisher').val(),
"chaptertitle": $('#chaptertitle').val(),
"place": $('#place').val(),
"translator": $('#translator').val(),
"editor": $('#editor').val(),
"pages": $('#pages').val(),
"volume": $('#volume').val(),
"number": $('#number').val(),
"notes": $('#notes').val()
};
var citations = {};
citations[$('#citationKey').val()] = citation;
var jsonData = JSON.stringify(citations, null, 2);
$('#output').text(jsonData);
});
});
</script>
</head>
<body>
<h1>Bibliography Generator</h1>
<form id="citationForm">
<label for="citationKey">Citation Key:</label>
<input type="text" id="citationKey" required><br>
<label for="author">Author:</label>
<input type="text" id="author" required><br>
<label for="title">Title:</label>
<input type="text" id="title" required><br>
<label for="journal">Journal:</label>
<input type="text" id="journal"><br>
<label for="year">Year:</label>
<input type="text" id="year" required><br>
<label for="url">URL:</label>
<input type="text" id="url"><br>
<label for="publisher">Publisher:</label>
<input type="text" id="publisher"><br>
<label for="chaptertitle">Chapter Title:</label>
<input type="text" id="chaptertitle"><br>
<label for="place">Place:</label>
<input type="text" id="place"><br>
<label for="translator">Translator:</label>
<input type="text" id="translator"><br>
<label for="editor">Editor:</label>
<input type="text" id="editor"><br>
<label for="pages">Pages:</label>
<input type="text" id="pages"><br>
<label for="volume">Volume:</label>
<input type="text" id="volume"><br>
<label for="number">Number:</label>
<input type="text" id="number"><br>
<label for="notes">Notes:</label>
<textarea id="notes"></textarea><br>
<input type="submit" value="Generate JSON">
</form>
<pre id="output"></pre>
</body>
</html>