Skip to content

Commit b773aad

Browse files
committed
deploy: 4fbb3db
0 parents  commit b773aad

32 files changed

Lines changed: 2118 additions & 0 deletions

.nojekyll

Whitespace-only changes.

architecture.html

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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>Architecture - Point Blank Documentation</title>
7+
<link rel="stylesheet" href="/assets/css/style.css">
8+
</head>
9+
<body>
10+
<div class="container">
11+
<header>
12+
<h1>Point Blank Documentation</h1>
13+
<nav>
14+
<ul>
15+
<li><a href="/index.html">Home</a></li>
16+
<li><a href="/features.html">Features</a></li>
17+
<li><a href="/queries.html">Queries</a></li>
18+
<li><a href="/commands.html">Commands</a></li>
19+
<li><a href="/settings.html">Settings</a></li>
20+
<li><a href="/architecture.html">Architecture</a></li>
21+
<li><a href="/contributing.html">Contributing</a></li>
22+
</ul>
23+
</nav>
24+
</header>
25+
<main>
26+
<section id="architecture-content">
27+
<h2>Architecture Overview</h2>
28+
<p>The extension's architecture is designed to be modular, performant, and maintainable, centered around an immutable document model that serves as the single source of truth.</p>
29+
30+
<h3>Data Flow:</h3>
31+
<ol>
32+
<li>When a document is opened or modified, VS Code fires an event that is picked up by the <code>DocumentModel</code>.</li>
33+
<li>The <code>DocumentModel</code> uses the <code>DocumentParser</code> to create or update the <code>DocumentTree</code>, an immutable, hierarchical representation of the document's text.</li>
34+
<li>The <code>DocumentModel</code> notifies the <code>DecorationManager</code> of the change.</li>
35+
<li>The <code>DecorationManager</code>, using debouncing and viewport-aware logic, retrieves the visible <code>BlockNode</code>s from the <code>DocumentTree</code>.</li>
36+
<li>It passes these nodes to the <code>DecorationCalculator</code>, which determines the appropriate decorations for each node based on its properties (e.g., <code>bulletType</code>).</li>
37+
<li>The <code>DecorationManager</code> applies these decorations to the active editor, styling the existing text.</li>
38+
</ol>
39+
40+
<h2>Key Design Decisions</h2>
41+
42+
<h3>Immutable Document Model</h3>
43+
<p>The use of an immutable <code>DocumentTree</code> and <code>BlockNode</code>s is a cornerstone of the architecture. When the document changes, a new tree is created rather than modifying the old one. This provides predictability, simplifies state management, and makes the flow of data easy to trace.</p>
44+
45+
<h3>Design Philosophy: Insertion vs. Styling</h3>
46+
<p>A critical distinction in Point Blank's architecture is the separation between one-time character <strong>insertion</strong> and continuous visual <strong>styling</strong>.</p>
47+
<ul>
48+
<li><strong>Insertion</strong>: For user convenience, some features will insert text directly into the document. For example, the <code>expandTemplate</code> command writes a new block of text, and the extension can be configured to add a bullet point on a new line.</li>
49+
<li><strong>Styling</strong>: This is the core of the rendering engine. After a character has been inserted (or typed by the user), it is treated like any other character in the document. The decoration engine <strong>only styles what it sees</strong>; it does not use rendering tricks to display characters that aren't physically present in the file.</li>
50+
</ul>
51+
<p>This "real character" styling philosophy is the result of a major refactor to improve stability and interoperability. It provides key benefits:</p>
52+
<ul>
53+
<li><strong>Robustness & Interoperability</strong>: Because the document is always the single source of truth for rendering, it remains pure markdown. This prevents conflicts with other VS Code extensions and ensures the file is portable.</li>
54+
<li><strong>No "Ghost" Characters</strong>: The previous architecture attempted to render visual-only characters, which led to conflicts with the document model and other editor features. The current approach eliminates this entire class of bugs.</li>
55+
</ul>
56+
57+
<h3>Separation of Concerns</h3>
58+
<p>The architecture enforces a strong separation of concerns:</p>
59+
<ul>
60+
<li><strong>Parsing (<code>DocumentParser</code>):</strong> Solely responsible for converting text to a <code>DocumentTree</code>.</li>
61+
<li><strong>State (<code>DocumentModel</code>, <code>ExtensionState</code>):</strong> Manages the state of the document and the extension.</li>
62+
<li><strong>Rendering (<code>DecorationManager</code>):</strong> Manages the application of decorations to the editor.</li>
63+
<li><strong>Logic (<code>DecorationCalculator</code>):</strong> Contains the stateless logic for determining which decorations to apply.</li>
64+
</ul>
65+
66+
<h3>Performant Decorations</h3>
67+
<p>To ensure a smooth user experience, the decoration engine includes two key performance optimizations:</p>
68+
<ul>
69+
<li><strong>Debouncing:</strong> Decoration updates are debounced to prevent rapid, flickering updates while the user is typing.</li>
70+
<li><strong>Viewport-Aware Rendering:</strong> The <code>DecorationManager</code> only processes the visible portion of the document (plus a small buffer), which significantly improves performance in large files.</li>
71+
</ul>
72+
</section>
73+
</main>
74+
<footer>
75+
<p>&copy; 2025 Point Blank. All rights reserved.</p>
76+
</footer>
77+
</div>
78+
<script src="/assets/js/main.js"></script>
79+
</body>
80+
</html>

assets/css/style.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:root { --background-color: #22272e; /* Dark background */ --text-color: #adbac7; /* Light grey text */ --primary-color: #80cbc4; /* Light teal for links/accents */ --hover-color: #b2dfdb; /* Lighter teal for hover */ --secondary-text-color: #808080; /* Blockquote/secondary text */ --border-color: #444c56; /* Subtle border for elements */ --header-bg: #2d333b; /* Slightly lighter dark for header */ --footer-bg: #2d333b; /* Slightly lighter dark for footer */ }
2+
3+
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; margin: 0; padding: 0; background-color: var(--background-color); color: var(--text-color); line-height: 1.6; }
4+
5+
header { background-color: var(--header-bg); color: #fff; padding: 1.5em 20px; /* Added horizontal padding */ text-align: center; border-bottom: 1px solid var(--border-color); /* For mobile, allow flex items to wrap */ display: flex; flex-direction: column; align-items: center; }
6+
7+
header h1 { margin: 0; font-size: 2em; }
8+
9+
nav ul { padding: 0; list-style: none; display: flex; flex-wrap: wrap; /* Allow items to wrap to the next line */ justify-content: center; margin-top: 1.5em; /* Increased margin to prevent overlap */ }
10+
11+
nav ul li { margin: 0 20px; }
12+
13+
main { padding: 40px 20px; background-color: #2d333b; /* Slightly lighter dark for content area */ border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); margin: 20px; /* Add margin to main content for smaller screens */ }
14+
15+
section { margin-bottom: 40px; padding-bottom: 20px; border-bottom: 1px dashed var(--border-color); }
16+
17+
section:last-child { border-bottom: none; }
18+
19+
h2 { color: var(--primary-color); border-bottom: 2px solid var(--border-color); padding-bottom: 10px; margin-top: 0; font-size: 1.8em; }
20+
21+
h3 { color: var(--text-color); font-size: 1.4em; margin-top: 25px; }
22+
23+
p, ul, ol { margin-bottom: 1em; }
24+
25+
code { background-color: #3e4451; color: #adbac7; border-radius: 3px; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; word-break: break-word; white-space: pre-wrap; }
26+
27+
pre { background: #2d333b; color: #adbac7; border-radius: 6px; padding: 1em; overflow-x: auto; font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; white-space: pre-wrap; word-break: break-word; box-sizing: border-box; max-width: 100%; }
28+
29+
/* Apply padding only to inline code, not code within pre blocks */
30+
code:not(pre > code) { padding: 0.2em 0.4em; white-space: break-spaces; }
31+
32+
/* Responsive fix for code/pre blocks on small screens */
33+
@media (max-width: 768px) { pre, code { white-space: pre-wrap; word-break: break-word; font-size: 0.95em; max-width: 100%; box-sizing: border-box; } }
34+
/* Global link styles for readability */
35+
a, a:visited { color: var(--primary-color); text-decoration: none; }
36+
37+
a:hover { text-decoration: underline; color: var(--hover-color); }
38+
39+
footer { text-align: center; padding: 25px; background-color: var(--footer-bg); color: var(--secondary-text-color); border-top: 1px solid var(--border-color); }
40+
41+
.container { max-width: 1000px; margin: 0 auto; padding: 0 15px; /* Add horizontal padding for smaller screens */ }
42+
43+
/* Media queries for responsiveness */
44+
@media (max-width: 768px) { header { padding: 1em 15px; /* Adjust header padding for smaller screens */ }
45+
header h1 { font-size: 1.8em; }
46+
nav ul { flex-direction: column; /* Stack navigation items vertically */ margin-top: 1em; }
47+
nav ul li { margin: 10px 0; /* Adjust margin for stacked items */ }
48+
main { padding: 20px 15px; /* Adjust main content padding for smaller screens */ margin: 15px; }
49+
.container { padding: 0 10px; /* Further reduce container padding on very small screens */ } }
50+
@media (max-width: 480px) { header h1 { font-size: 1.5em; }
51+
nav ul li { margin: 8px 0; }
52+
main { padding: 15px 10px; margin: 10px; } }

assets/favicon.ico

Whitespace-only changes.
16.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)