Varun Hemachandran
commited on
Commit
·
980236d
1
Parent(s):
a16b08b
Add simple HTML viewer for PDF documents
Browse files- index.html +140 -0
index.html
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>JFK Document Release 2025</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
line-height: 1.6;
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 20px;
|
| 13 |
+
max-width: 1200px;
|
| 14 |
+
margin: 0 auto;
|
| 15 |
+
}
|
| 16 |
+
h1 {
|
| 17 |
+
color: #333;
|
| 18 |
+
border-bottom: 2px solid #ddd;
|
| 19 |
+
padding-bottom: 10px;
|
| 20 |
+
}
|
| 21 |
+
.search-container {
|
| 22 |
+
margin: 20px 0;
|
| 23 |
+
}
|
| 24 |
+
#search {
|
| 25 |
+
padding: 8px;
|
| 26 |
+
width: 300px;
|
| 27 |
+
font-size: 16px;
|
| 28 |
+
}
|
| 29 |
+
table {
|
| 30 |
+
width: 100%;
|
| 31 |
+
border-collapse: collapse;
|
| 32 |
+
margin-top: 20px;
|
| 33 |
+
}
|
| 34 |
+
th, td {
|
| 35 |
+
padding: 12px;
|
| 36 |
+
text-align: left;
|
| 37 |
+
border-bottom: 1px solid #ddd;
|
| 38 |
+
}
|
| 39 |
+
th {
|
| 40 |
+
background-color: #f2f2f2;
|
| 41 |
+
font-weight: bold;
|
| 42 |
+
}
|
| 43 |
+
tr:hover {
|
| 44 |
+
background-color: #f5f5f5;
|
| 45 |
+
}
|
| 46 |
+
a {
|
| 47 |
+
color: #0066cc;
|
| 48 |
+
text-decoration: none;
|
| 49 |
+
}
|
| 50 |
+
a:hover {
|
| 51 |
+
text-decoration: underline;
|
| 52 |
+
}
|
| 53 |
+
.footer {
|
| 54 |
+
margin-top: 30px;
|
| 55 |
+
padding-top: 10px;
|
| 56 |
+
border-top: 1px solid #ddd;
|
| 57 |
+
color: #666;
|
| 58 |
+
}
|
| 59 |
+
</style>
|
| 60 |
+
</head>
|
| 61 |
+
<body>
|
| 62 |
+
<h1>JFK Document Release 2025</h1>
|
| 63 |
+
<p>Browse and search through declassified documents related to the assassination of President John F. Kennedy.</p>
|
| 64 |
+
|
| 65 |
+
<div class="search-container">
|
| 66 |
+
<input type="text" id="search" placeholder="Search documents..." onkeyup="filterDocuments()">
|
| 67 |
+
</div>
|
| 68 |
+
|
| 69 |
+
<table id="documents-table">
|
| 70 |
+
<thead>
|
| 71 |
+
<tr>
|
| 72 |
+
<th>Document Name</th>
|
| 73 |
+
<th>View Document</th>
|
| 74 |
+
</tr>
|
| 75 |
+
</thead>
|
| 76 |
+
<tbody id="documents-list">
|
| 77 |
+
<!-- Documents will be populated here by JavaScript -->
|
| 78 |
+
</tbody>
|
| 79 |
+
</table>
|
| 80 |
+
|
| 81 |
+
<div class="footer">
|
| 82 |
+
<p>This collection contains declassified documents related to the assassination of President John F. Kennedy.
|
| 83 |
+
The documents were released by the National Archives and Records Administration (NARA) as part of the JFK Records Act.</p>
|
| 84 |
+
</div>
|
| 85 |
+
|
| 86 |
+
<script>
|
| 87 |
+
// Function to load document list
|
| 88 |
+
async function loadDocuments() {
|
| 89 |
+
const response = await fetch('https://huggingface.co/api/datasets/varunh/jfk-files-2025/tree/main/data');
|
| 90 |
+
const data = await response.json();
|
| 91 |
+
|
| 92 |
+
const documentsList = document.getElementById('documents-list');
|
| 93 |
+
|
| 94 |
+
// Sort files alphabetically
|
| 95 |
+
data.sort((a, b) => a.path.localeCompare(b.path));
|
| 96 |
+
|
| 97 |
+
data.forEach(file => {
|
| 98 |
+
if (file.path.endsWith('.pdf')) {
|
| 99 |
+
const fileName = file.path.split('/').pop();
|
| 100 |
+
|
| 101 |
+
const row = document.createElement('tr');
|
| 102 |
+
|
| 103 |
+
const nameCell = document.createElement('td');
|
| 104 |
+
nameCell.textContent = fileName;
|
| 105 |
+
|
| 106 |
+
const linkCell = document.createElement('td');
|
| 107 |
+
const link = document.createElement('a');
|
| 108 |
+
link.href = `https://huggingface.co/datasets/varunh/jfk-files-2025/resolve/main/${file.path}`;
|
| 109 |
+
link.textContent = 'View PDF';
|
| 110 |
+
link.target = '_blank';
|
| 111 |
+
linkCell.appendChild(link);
|
| 112 |
+
|
| 113 |
+
row.appendChild(nameCell);
|
| 114 |
+
row.appendChild(linkCell);
|
| 115 |
+
|
| 116 |
+
documentsList.appendChild(row);
|
| 117 |
+
}
|
| 118 |
+
});
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
// Function to filter documents based on search
|
| 122 |
+
function filterDocuments() {
|
| 123 |
+
const search = document.getElementById('search').value.toLowerCase();
|
| 124 |
+
const rows = document.getElementById('documents-list').getElementsByTagName('tr');
|
| 125 |
+
|
| 126 |
+
for (let i = 0; i < rows.length; i++) {
|
| 127 |
+
const documentName = rows[i].getElementsByTagName('td')[0].textContent.toLowerCase();
|
| 128 |
+
if (documentName.includes(search)) {
|
| 129 |
+
rows[i].style.display = '';
|
| 130 |
+
} else {
|
| 131 |
+
rows[i].style.display = 'none';
|
| 132 |
+
}
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
// Load documents when page loads
|
| 137 |
+
window.onload = loadDocuments;
|
| 138 |
+
</script>
|
| 139 |
+
</body>
|
| 140 |
+
</html>
|