@kenjura/ursa 0.73.0 → 0.76.0
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 +81 -0
- package/meta/default-template.html +65 -7
- package/meta/default.css +479 -176
- package/meta/menu.js +153 -80
- package/meta/search.js +7 -13
- package/meta/sectionify.js +10 -0
- package/meta/toc-generator.js +12 -6
- package/meta/widgets.js +575 -0
- package/package.json +1 -1
- package/src/dev.js +96 -22
- package/src/helper/automenu.js +102 -12
- package/src/helper/breadcrumbs.js +42 -0
- package/src/helper/build/autoIndex.js +87 -28
- package/src/helper/build/menu.js +4 -4
- package/src/helper/customMenu.js +118 -29
- package/src/helper/findScriptJs.js +29 -0
- package/src/helper/imageProcessor.js +38 -8
- package/src/jobs/generate.js +111 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
+
# 0.77.0 (TODO)
|
|
2
|
+
|
|
3
|
+
QOL:
|
|
4
|
+
- When 'serve' encounters an occupied port 8080, prompt the user to find an available port instead of just exiting with an error. Will check open ports and find the closest port to 8080, then ask the user if they want to use it.
|
|
5
|
+
|
|
6
|
+
Static assets revamp:
|
|
7
|
+
- Meta
|
|
8
|
+
- All scripts and stylesheets referenced by a template should be bundled together into a single CSS file and a single JS file per template. Use esbuild or similar for bundling and minification. This will reduce the number of requests and ensure that all template assets are loaded together.
|
|
9
|
+
- Documents
|
|
10
|
+
- style.css and script.js files should be external
|
|
11
|
+
- in serve mode, a document can have multiple style.css and script.js from multiple levels; this should be separate tags so individual ones can be invalidated
|
|
12
|
+
- in generate mode, these should be bundled together into a single CSS file and a single JS file per folder
|
|
13
|
+
- why folder? well, /foo may have style.css and script.js, and /foo/bar may have its own style.css and script.js. Every document in foo/bar includes both scripts and both stylesheets, but documents in foo only include the foo ones.
|
|
14
|
+
- it is true that foo.bundle.js and foo-bar.bundle.js will duplicate code (foo-bar is a superset of foo), but the point is that every page load has the minimum number of requests (1 CSS and 1 JS)
|
|
15
|
+
- future optimization: bundle document and meta scripts/styles together. This sounds complicated compared to the expected return
|
|
16
|
+
- Bundling logic:
|
|
17
|
+
- In serve mode, minification without obfuscation is fine, as serve is often used to debug stylesheets and scripts.
|
|
18
|
+
- In generate mode, we can do full bundling and minification for optimal performance. Map files can be generated for debugging if needed.
|
|
19
|
+
|
|
20
|
+
Regeneration revamp:
|
|
21
|
+
- Existing logic:
|
|
22
|
+
- On first generation, save a cache of document output given some sort of hash of the source file and metadata (e.g. mtime, size, etc.)
|
|
23
|
+
- All static files (meta and document) should include a datetime or hash-based cache-buster in their query strings / filenames, so they can be invalidated as needed
|
|
24
|
+
- On subsequent generations, if the source file's hash is unchanged, skip regeneration and reuse the existing output file. (Note: this doesn't handle cases where the statis files changed and the document didn't; see below)
|
|
25
|
+
- Push a notification to the client when a file is regenerated, so the client can update the page if it's currently being viewed
|
|
26
|
+
- New logic is as above, plus: (some of this is partially complete, but these are the complete requirements)
|
|
27
|
+
- When any file being watched is changed, determine the list of affected files. For instance:
|
|
28
|
+
- A normal document will obviously invalidate that exact document.
|
|
29
|
+
- Special Ursa static files (menu.md, style.css, and script.js) are inherited by all documents in the current folder and all subfolders, so they will invalidate all documents in the current folder and all subfolders.
|
|
30
|
+
- Meta static files:
|
|
31
|
+
- A template file in meta will invalidate all documents that use that template.
|
|
32
|
+
- A stylesheet or script file in meta will invalidate all documents that inherit from that meta (which is probably everything).
|
|
33
|
+
- All other static files in the docroot (assuming they're linked at all by any document) should be invalidated thus:
|
|
34
|
+
- Calculate a new hash for the static file
|
|
35
|
+
- Find all documents that reference that static file
|
|
36
|
+
- Regenerate the html (even if the source md/mdx/txt file is unchanged) for those documents to update the cache-busting query string for the static file reference
|
|
37
|
+
- This should catch all the various edge cases that previously required restarting the server or doing a full regeneration.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Top Menu improvements:
|
|
41
|
+
- When a submenu overflows the available viewport height, it should become scrollable instead of overflowing off the screen. This can be achieved with CSS by setting a max-height and overflow-y: auto on the submenu container.
|
|
42
|
+
|
|
43
|
+
New Widgets:
|
|
44
|
+
- Suggested Content
|
|
45
|
+
- A new left-side widget that shows a list of suggested content based on the current page. Categories of suggested content:
|
|
46
|
+
- Content you frequently view (uses localStorage to track page views and show most viewed content)
|
|
47
|
+
- Future ideas:
|
|
48
|
+
- LLM-guided suggestions based on frequently viewed content, suggested related documents you haven't viewed yet, etc.
|
|
49
|
+
|
|
50
|
+
Bugs:
|
|
51
|
+
- [ ] When using menu.md with auto-generation, the top menu's Home href is "//index.html" instead of "/index.html". On localhost, this ends up working fine, but on https://realdomain.com, this loads https://index.html which obviously doesn't work. The current logic seems to prefer absolute URLs, so in this case, the url for home should be "/index.html" (not double slash).
|
|
52
|
+
- [ ] Site style.css is not present on auto-generated index pages
|
|
53
|
+
- Regeneration issues:
|
|
54
|
+
- Create a power, that power page now exists. But powers.json doesn't have it.
|
|
55
|
+
|
|
56
|
+
# 0.76.0
|
|
57
|
+
2026-02-11
|
|
58
|
+
|
|
59
|
+
- **New Feature: Recent Activity widget.** A new topbar widget shows the 10 most recently modified documents in the docroot, sorted by modification date (most recent first). The widget appears on the left side of the top nav (to the right of the home icon) and is open by default.
|
|
60
|
+
- Recent activity data is collected during the generate phase by stat-ing each article file, then written to `public/recent-activity.json`.
|
|
61
|
+
- In serve/dev mode, the recent activity list is built during background cache initialization and updated live when article files are changed.
|
|
62
|
+
- The single-file regeneration path (`regenerateSingleFile`) also updates the recent activity JSON incrementally.
|
|
63
|
+
- **Widget system improvements:**
|
|
64
|
+
- All widgets now have a close (✕) button in the upper-right corner of their panel header. Clicking it closes the widget and deselects the corresponding icon in the top bar.
|
|
65
|
+
- Widget open/closed state is now persisted in localStorage. Widgets that were open will remain open after a page reload, and widgets that were closed will remain closed. Widgets with no saved state fall back to their default (Recent Activity defaults to open; others default to closed).
|
|
66
|
+
- The widget system now supports both left-side and right-side widget panels, which operate independently (one widget per side can be open at a time).
|
|
67
|
+
|
|
68
|
+
# 0.75.0
|
|
69
|
+
2026-02-10
|
|
70
|
+
|
|
71
|
+
- Top Menu changes: the top menu is now the default first-level navigation. Top-left nav is either root, or 'hamburger' on smaller screens.
|
|
72
|
+
- Right column is now a standardized widget zone, with TOC, Search, and Profile widgets implemented.
|
|
73
|
+
- Default header: documents without an initial H1 will now have their title rendered as an H1 header at the top of the article. Index/home pages will default to the parent folder name if not overridden.
|
|
74
|
+
- Breadcrumbs: added breadcrumbs to the top of each article for easier navigation and context
|
|
75
|
+
|
|
76
|
+
# 0.74.0
|
|
77
|
+
2026-02-08
|
|
78
|
+
|
|
79
|
+
- added a feature to skip preview generation and swapping on a per-image basis. You can use the data-no-preview tag in html, and the ?no-preview query parameter in markdown or wikitext images.
|
|
80
|
+
- when building automenus and autoindex pages, folders with no md/mdx/txt/html documents anywhere in their tree will not be shown.
|
|
81
|
+
|
|
1
82
|
# 0.73.0
|
|
2
83
|
2026-02-07
|
|
3
84
|
|
|
@@ -10,29 +10,86 @@
|
|
|
10
10
|
|
|
11
11
|
<body data-template-id="default">
|
|
12
12
|
<nav id="nav-global">
|
|
13
|
-
<
|
|
13
|
+
<div class="nav-left-controls">
|
|
14
|
+
<button class="menu-button" aria-label="Menu">☰</button>
|
|
15
|
+
<div class="widget-bar widget-bar-left">
|
|
16
|
+
<button class="widget-button" data-widget="recent-activity" data-widget-side="left" aria-label="Recent Activity" title="Recent Activity">
|
|
17
|
+
<span class="widget-icon">🕒</span>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
14
21
|
|
|
15
22
|
<div class="nav-center">
|
|
16
23
|
<nav id="nav-main-top">
|
|
17
24
|
<!-- Top menu will be populated by JavaScript when data-menu-position="top" -->
|
|
18
25
|
</nav>
|
|
19
26
|
|
|
20
|
-
<div class="search-wrapper">
|
|
27
|
+
<div class="search-wrapper search-wrapper-inline">
|
|
21
28
|
<input id="global-search" type="text" placeholder="Search..." />
|
|
22
29
|
</div>
|
|
23
30
|
</div>
|
|
24
31
|
|
|
25
32
|
<div class="nav-right-controls">
|
|
26
|
-
<
|
|
27
|
-
|
|
33
|
+
<div class="widget-bar">
|
|
34
|
+
<button class="widget-button" data-widget="toc" aria-label="Table of Contents" title="Table of Contents">
|
|
35
|
+
<span class="widget-icon">≡</span>
|
|
36
|
+
</button>
|
|
37
|
+
<button class="widget-button" data-widget="search" aria-label="Search" title="Search">
|
|
38
|
+
<span class="widget-icon">🔍</span>
|
|
39
|
+
</button>
|
|
40
|
+
<button class="widget-button" data-widget="profile" aria-label="Profile" title="Profile">
|
|
41
|
+
<span class="widget-icon">👤</span>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
28
44
|
</div>
|
|
29
45
|
</nav>
|
|
46
|
+
|
|
47
|
+
<!-- Widget dropdown panel for LEFT-side widgets -->
|
|
48
|
+
<div id="widget-dropdown-left" class="widget-dropdown widget-dropdown-left hidden">
|
|
49
|
+
<div id="widget-content-recent-activity" class="widget-content" data-widget="recent-activity">
|
|
50
|
+
<div class="widget-header">
|
|
51
|
+
<span class="widget-header-title">Recent Activity</span>
|
|
52
|
+
<button class="widget-close-btn" aria-label="Close">✕</button>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="recent-activity-list">
|
|
55
|
+
<!-- Populated by JavaScript -->
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<!-- Widget dropdown panel for RIGHT-side widgets -->
|
|
61
|
+
<div id="widget-dropdown" class="widget-dropdown hidden">
|
|
62
|
+
<div id="widget-content-toc" class="widget-content" data-widget="toc">
|
|
63
|
+
<div class="widget-header">
|
|
64
|
+
<span class="widget-header-title">Table of Contents</span>
|
|
65
|
+
<button class="widget-close-btn" aria-label="Close">✕</button>
|
|
66
|
+
</div>
|
|
67
|
+
<!-- TOC will be generated by JavaScript -->
|
|
68
|
+
</div>
|
|
69
|
+
<div id="widget-content-search" class="widget-content" data-widget="search">
|
|
70
|
+
<div class="widget-header">
|
|
71
|
+
<span class="widget-header-title">Search</span>
|
|
72
|
+
<button class="widget-close-btn" aria-label="Close">✕</button>
|
|
73
|
+
</div>
|
|
74
|
+
<!-- Search input + results placed here by JS -->
|
|
75
|
+
</div>
|
|
76
|
+
<div id="widget-content-profile" class="widget-content" data-widget="profile">
|
|
77
|
+
<div class="widget-header">
|
|
78
|
+
<span class="widget-header-title">Profile</span>
|
|
79
|
+
<button class="widget-close-btn" aria-label="Close">✕</button>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="widget-profile-placeholder">
|
|
82
|
+
<span class="widget-profile-avatar">👤</span>
|
|
83
|
+
<p>Sign in to access your profile</p>
|
|
84
|
+
<button class="widget-profile-signin" disabled>Sign In</button>
|
|
85
|
+
<p class="widget-profile-note">Authentication coming soon</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
30
90
|
<nav id="nav-main">
|
|
31
91
|
${menu}
|
|
32
92
|
</nav>
|
|
33
|
-
<nav id="nav-toc">
|
|
34
|
-
<!-- TOC will be generated by JavaScript -->
|
|
35
|
-
</nav>
|
|
36
93
|
<article id="main-content">
|
|
37
94
|
${body}
|
|
38
95
|
</article>
|
|
@@ -46,6 +103,7 @@
|
|
|
46
103
|
<script src="/public/toc-generator.js"></script>
|
|
47
104
|
<script src="/public/menu.js"></script>
|
|
48
105
|
<script src="/public/search.js"></script>
|
|
106
|
+
<script src="/public/widgets.js"></script>
|
|
49
107
|
<script src="/public/sectionify.js"></script>
|
|
50
108
|
<script src="/public/sticky.js"></script>
|
|
51
109
|
${customScript}
|