Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1d81b5b
Vite and modularization
NellowTCS Aug 30, 2025
6275ed6
test
NellowTCS Aug 30, 2025
331fbca
Huh, how did that happen
NellowTCS Aug 30, 2025
07bde5e
Fix table of contents bug
NellowTCS Aug 30, 2025
9d0c3e0
what is that doing in here?!
NellowTCS Sep 12, 2025
0e98c08
📝 Add docstrings to `v2.1.0`
coderabbitai[bot] Sep 12, 2025
602a20f
Merge pull request #3 from HTMLToolkit/coderabbitai/docstrings/9d0c3e0
NellowTCS Sep 12, 2025
7244da1
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
ef2b591
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
ad0bcac
Delete Build/LICENSE
NellowTCS Sep 12, 2025
e02a2f6
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
593d621
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
8a894d1
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
d432edd
HTMLRunner was accidentally copied into this,removing
NellowTCS Sep 12, 2025
e92c64b
HTMLRunner was accidentally copied into this, removing
NellowTCS Sep 12, 2025
3189ce4
CodeRabbit Generated Unit Tests: Add Jest/Vitest tests for IndexedDB …
coderabbitai[bot] Sep 12, 2025
8d9fd92
Merge pull request #4 from HTMLToolkit/coderabbitai/utg/e92c64b
NellowTCS Sep 12, 2025
0ba80e9
CodeRabbit Generated Unit Tests: Add Jest/JSDOM unit tests for book, …
coderabbitai[bot] Sep 12, 2025
31f1e1f
Merge pull request #7 from HTMLToolkit/coderabbitai/utg/8d9fd92
NellowTCS Sep 12, 2025
934c652
Update LICENSE
NellowTCS Sep 12, 2025
7a5cd9a
Fix some errors
NellowTCS Sep 12, 2025
f1118f6
Fixes
NellowTCS Sep 12, 2025
1c17e8d
Ugh unit test are painful
NellowTCS Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions Build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Node modules
node_modules/

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build output
dist/
build/
out/

# TypeScript cache
*.tsbuildinfo

# Environment variables
.env
.env.*

# IDE files
.vscode/
.idea/
*.suo
*.ntvs*
*.njsproj
*.sln

# OS files
.DS_Store
Thumbs.db

# Coverage
coverage/

# Optional npm cache directory
.npm/

# Optional eslint cache
.eslintcache
14 changes: 14 additions & 0 deletions Build/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import js from "@eslint/js";
import globals from "globals";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
import { defineConfig } from "eslint/config";

export default defineConfig([
js.configs.recommended,
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.browser } },
json.configs.recommended,
markdown.configs.recommended,
css.configs.recommended,
]);
43 changes: 43 additions & 0 deletions Build/export.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import fs from 'fs-extra';
import path from 'path';
import { rimrafSync } from 'rimraf';
import { fileURLToPath } from 'url';
import process from 'process';

// ES module __dirname fix
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const root = path.resolve(__dirname, '..'); // repo root
const dist = path.join(__dirname, 'dist'); // build folder

// Files/folders to keep
const keep = new Set(['README.md', 'LICENSE', 'Build']);

// Clean repo root (skip hidden files/folders)
fs.readdirSync(root).forEach(file => {
if (!fs.existsSync(dist) || fs.readdirSync(dist).length === 0) {
console.error('ERROR: dist is missing or empty:', dist);
process.exit(1);
}

if (!keep.has(file) && !file.startsWith('.')) { // <-- skip hidden
rimrafSync(path.join(root, file));
console.log('Deleted:', file);
}
});

// Copy each item inside dist individually
fs.readdirSync(dist).forEach(item => {
const srcPath = path.join(dist, item);
const destPath = path.join(root, item);

// Skip copying if destination exists and is in keep set
if (keep.has(item)) {
console.log(`Skipping copy of ${item} (keep folder/file)`);
return;
}

fs.copySync(srcPath, destPath, { overwrite: true });
console.log('Copied:', item);
});
76 changes: 76 additions & 0 deletions Build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Security-Policy" content="
default-src 'self' blob: data:;
script-src 'self';
style-src 'self' 'unsafe-inline';
img-src 'self' blob: data:;
connect-src 'self';
frame-src 'self' blob: data:;
worker-src 'self';
manifest-src 'self';
upgrade-insecure-requests; block-all-mixed-content;">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTMLReader</title>
<link rel="stylesheet" href="./src/style.css" />
</head>
<body>
<header>
<div class="title">
<span>HTMLReader</span>
<span class="book-title" id="book-title"></span>
</div>
<div class="controls">
<button id="toc-button" disabled>Table of Contents</button>
<button id="open-button">Open EPUB</button>
<button id="library-button">Library</button>
<input type="file" id="file-input" class="file-input" accept=".epub">
<!-- Fallback multiple file input for library import -->
<input type="file" id="library-input" class="file-input" accept=".epub" multiple>
<button id="install-button" hidden>Install App</button> <!-- New Install Button -->
</div>
</header>
<main>
<div id="viewer"></div>
</main>
<footer>
<button id="prev-button" disabled>⬅ Previous</button>
<div class="page-info">
<span>Page</span>
<input type="number" id="current-page" min="1" value="1">
<span>of</span>
<span id="total-pages">1</span>
</div>
<button id="next-button" disabled>Next ➡</button>
</footer>
<!-- TOC Container -->
<div class="toc-container" id="toc-container">
<div class="toc-header">
<h3>Table of Contents</h3>
<button id="close-toc">Close</button>
</div>
<div class="toc-content" id="toc-content"></div>
</div>
<!-- Library Popup (hidden by default) -->
<div class="library-container" id="library-container">
<div class="library-header">
<h3>Library</h3>
<button id="close-library">Close</button>
</div>
<div class="library-content" id="library-content"></div>
</div>
<div class="overlay" id="overlay"></div>
<div class="message" id="loading-message">
<h3>Loading EPUB...</h3>
<p>Please wait while your book is being processed.</p>
</div>
<div class="message" id="error-message">
<h3>Error</h3>
<p id="error-text">There was an error processing your EPUB file.</p>
<button id="close-error">Close</button>
</div>
</body>
<script type="module" src="./src/main.js"></script>
</html>
Loading