@knowcode/doc-builder 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/test-auth/doc-builder.config.js +0 -16
- package/test-auth/html/README.html +0 -104
- package/test-auth/html/auth.js +0 -67
- package/test-auth/html/css/notion-style.css +0 -1880
- package/test-auth/html/css/style.css +0 -1974
- package/test-auth/html/js/auth.js +0 -67
- package/test-auth/html/js/main.js +0 -1333
- package/test-auth/html/login.html +0 -49
- package/test-auth/html/logout.html +0 -18
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to @knowcode/doc-builder will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.4] - 2025-07-19
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Removed test-auth directory from npm package
|
|
12
|
+
- Updated .npmignore to exclude test-auth directory
|
|
13
|
+
|
|
8
14
|
## [1.2.3] - 2025-07-19
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
siteName: 'Protected Documentation',
|
|
3
|
-
siteDescription: 'Test site with authentication',
|
|
4
|
-
|
|
5
|
-
features: {
|
|
6
|
-
authentication: true, // Enable authentication
|
|
7
|
-
changelog: false,
|
|
8
|
-
mermaid: true,
|
|
9
|
-
darkMode: true
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
auth: {
|
|
13
|
-
username: 'testuser',
|
|
14
|
-
password: 'testpass123'
|
|
15
|
-
}
|
|
16
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
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
|
-
<meta name="description" content="Test site with authentication">
|
|
7
|
-
<title>Test Auth Documentation - Protected Documentation</title>
|
|
8
|
-
|
|
9
|
-
<!-- Fonts -->
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
11
|
-
|
|
12
|
-
<!-- Icons -->
|
|
13
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
|
14
|
-
|
|
15
|
-
<!-- Mermaid -->
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
|
|
17
|
-
|
|
18
|
-
<!-- Styles -->
|
|
19
|
-
<link rel="stylesheet" href="/css/notion-style.css">
|
|
20
|
-
<link rel="stylesheet" href="/css/style.css">
|
|
21
|
-
|
|
22
|
-
<!-- Favicon -->
|
|
23
|
-
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>📚</text></svg>">
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<!-- Header -->
|
|
27
|
-
<header class="header">
|
|
28
|
-
<div class="header-content">
|
|
29
|
-
<a href="/index.html" class="logo">Protected Documentation</a>
|
|
30
|
-
|
|
31
|
-
<div class="header-actions">
|
|
32
|
-
<div class="deployment-info">
|
|
33
|
-
<span class="deployment-date">Last updated: Jul 19, 2025, 12:21 PM UTC</span>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<a href="../logout.html" class="logout-btn" title="Logout">
|
|
38
|
-
<i class="fas fa-sign-out-alt"></i>
|
|
39
|
-
</a>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
|
|
43
|
-
<i class="fas fa-moon"></i>
|
|
44
|
-
</button>
|
|
45
|
-
|
|
46
|
-
<button id="menu-toggle" class="menu-toggle" aria-label="Toggle menu">
|
|
47
|
-
<i class="fas fa-bars"></i>
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</header>
|
|
52
|
-
|
|
53
|
-
<!-- Preview Banner -->
|
|
54
|
-
<div id="preview-banner" class="preview-banner">
|
|
55
|
-
<div class="banner-content">
|
|
56
|
-
<i class="fas fa-exclamation-triangle banner-icon"></i>
|
|
57
|
-
<span class="banner-text">This documentation is a preview version - some content may be incomplete</span>
|
|
58
|
-
<button id="dismiss-banner" class="banner-dismiss" aria-label="Dismiss banner">
|
|
59
|
-
<i class="fas fa-times"></i>
|
|
60
|
-
</button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<!-- Breadcrumbs -->
|
|
65
|
-
<nav class="breadcrumbs" id="breadcrumbs">
|
|
66
|
-
<!-- Breadcrumbs will be generated by JavaScript -->
|
|
67
|
-
</nav>
|
|
68
|
-
|
|
69
|
-
<!-- Main Content -->
|
|
70
|
-
<div class="main-wrapper">
|
|
71
|
-
<!-- Sidebar -->
|
|
72
|
-
<aside class="sidebar">
|
|
73
|
-
<div class="sidebar-header">
|
|
74
|
-
<div class="filter-box">
|
|
75
|
-
<input type="text" placeholder="Filter items..." class="filter-input" id="nav-filter">
|
|
76
|
-
<i class="fas fa-search filter-icon"></i>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
<nav class="navigation">
|
|
80
|
-
|
|
81
|
-
<div class="nav-section" data-level="0">
|
|
82
|
-
<a class="nav-title expanded" href="/README.html" >
|
|
83
|
-
<i class="fas fa-home"></i> Documentation
|
|
84
|
-
</a>
|
|
85
|
-
<div class="nav-content" >
|
|
86
|
-
<a href="/README.html" class="nav-item active"><i class="fas fa-file-alt"></i> Overview</a></div></div>
|
|
87
|
-
</nav>
|
|
88
|
-
<div class="resize-handle"></div>
|
|
89
|
-
</aside>
|
|
90
|
-
|
|
91
|
-
<!-- Content Area -->
|
|
92
|
-
<main class="content">
|
|
93
|
-
<div class="content-inner">
|
|
94
|
-
<h1>Test Auth Documentation</h1>
|
|
95
|
-
|
|
96
|
-
</div>
|
|
97
|
-
</main>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<!-- Scripts -->
|
|
101
|
-
<script src="/js/main.js"></script>
|
|
102
|
-
<script src="/js/auth.js"></script>
|
|
103
|
-
</body>
|
|
104
|
-
</html>
|
package/test-auth/html/auth.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Client-Side Authentication for Documentation
|
|
3
|
-
* This runs on every page load to check authentication
|
|
4
|
-
*
|
|
5
|
-
* IMPORTANT: This is a basic authentication system suitable for
|
|
6
|
-
* protecting documentation from casual access. For production
|
|
7
|
-
* use with sensitive data, implement server-side authentication.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
(function() {
|
|
11
|
-
'use strict';
|
|
12
|
-
|
|
13
|
-
// Skip auth check on login and logout pages
|
|
14
|
-
const currentPage = window.location.pathname;
|
|
15
|
-
if (currentPage === '/login.html' || currentPage === '/logout.html' || currentPage.includes('login') || currentPage.includes('logout')) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Check if user is authenticated
|
|
20
|
-
function isAuthenticated() {
|
|
21
|
-
const authToken = getCookie('doc-auth');
|
|
22
|
-
if (!authToken) return false;
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
// Simple token validation - just check if it exists and has expected format
|
|
26
|
-
// The actual validation happens server-side (or in login page for static sites)
|
|
27
|
-
const decoded = atob(authToken);
|
|
28
|
-
return decoded && decoded.includes(':');
|
|
29
|
-
} catch (error) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Get cookie value
|
|
35
|
-
function getCookie(name) {
|
|
36
|
-
const value = `; ${document.cookie}`;
|
|
37
|
-
const parts = value.split(`; ${name}=`);
|
|
38
|
-
if (parts.length === 2) return parts.pop().split(';').shift();
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Redirect to login if not authenticated
|
|
43
|
-
function redirectToLogin() {
|
|
44
|
-
const currentUrl = window.location.pathname + window.location.search;
|
|
45
|
-
const loginUrl = '/login.html' + (currentUrl !== '/' ? '?redirect=' + encodeURIComponent(currentUrl) : '');
|
|
46
|
-
window.location.href = loginUrl;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Check authentication on page load
|
|
50
|
-
if (!isAuthenticated()) {
|
|
51
|
-
redirectToLogin();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Add logout functionality to logout buttons
|
|
55
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
56
|
-
const logoutLinks = document.querySelectorAll('a[href*="logout"]');
|
|
57
|
-
logoutLinks.forEach(link => {
|
|
58
|
-
link.addEventListener('click', function(e) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
// Clear auth cookie
|
|
61
|
-
document.cookie = 'doc-auth=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
62
|
-
window.location.href = '/logout.html';
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
})();
|