Skip to content

Commit 558fe19

Browse files
author
Corey B
committed
docs: author rigorous UI templating tutorial leveraging no-js architectures and aggressively expand broad social advocacy hooks natively
1 parent 6cce076 commit 558fe19

3 files changed

Lines changed: 152 additions & 8 deletions

File tree

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ FDD files treat the browser as an OS, allowing for a zero-infrastructure applica
1818
## Project Structure
1919

2020
- `/spec`: The FDD Standard Definition.
21+
- `/docs`: Extensive guides on authoring No-JS `.fdd` UI layouts and integrations.
2122
- `/lib/node-fdd`: Server-side Node library for batch generation and cryptographic signing of FDD files.
2223
- `/lib/fdd-js`: Browser-side logic-less parsing, data binding, and Local State file handling.
2324
- `/extension`: The Chrome extension establishing the `.fdd` MIME type routing and Security Shield.
@@ -60,7 +61,7 @@ For End-Users navigating to FDD files natively on their disk, the custom routing
6061
---
6162

6263
## 📣 How You Can Help Advocate!
63-
The success of OpenFDD relies entirely on community pushback against static PDFs. Help spread the word!
64+
The success of OpenFDD relies entirely on community pushback against static PDFs. The best advocacy strategy is loudly sharing and writing about the project publicly! Help spread the word!
6465

6566
**Share the Standard on Social Media:**
6667
<p align="left">
@@ -70,11 +71,16 @@ The success of OpenFDD relies entirely on community pushback against static PDFs
7071
<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/Spuds0588/open-fdd">
7172
<img src="https://img.shields.io/badge/Share%20on%20LinkedIn-0077b5?style=for-the-badge&logo=linkedin&logoColor=white" alt="Share on LinkedIn" />
7273
</a>
74+
<a href="https://reddit.com/submit?url=https://github.com/Spuds0588/open-fdd&title=OpenFDD:%20A%20Data-First,%20Zero-JS%20Alternative%20to%20PDFs">
75+
<img src="https://img.shields.io/badge/Share%20on%20Reddit-FF4500?style=for-the-badge&logo=reddit&logoColor=white" alt="Share on Reddit" />
76+
</a>
7377
</p>
7478

75-
**Action Items for Devs:**
76-
1. **Pitch it to your PM:** If your app exports user dashboards as 'PDF Printouts', propose securely exporting a `.fdd` "mini-app" instead.
77-
2. **Build Integrations:** Build robust parsing libraries in Rust, Python, or Go for the `fdd-data` layer!
78-
3. **Star the Repo:** Help signal to the W3C and major browser vendors that developers want explicitly trusted, High-Trust File Sandbox permissions natively!
79+
**Action Items for Devs and Advocates:**
80+
1. **Write & Record:** Create YouTube dev-logs, HackerNews posts, and Medium blogs leveraging your sphere of influence to evangelize why data-first local documents resolve massive privacy/architecture bugs.
81+
2. **Pressure Vendors:** Publicly ask Browsers (Google/Apple), SaaS providers (Hubspot/Workday), and App Developers to explicitly add native support for exporting mapping capabilities using the `.fdd` open-standard.
82+
3. **Pitch it to your PM:** If your app exports user dashboards as 'PDF Printouts', propose securely exporting an `.fdd` "mini-app" instead.
83+
4. **Build Integrations:** Build robust parsing libraries in Rust, Python, or Go for the `fdd-data` layer!
84+
5. **Star the Repo:** Help signal to the W3C and major browser vendors that developers desperately want explicitly trusted High-Trust File Sandbox permissions natively!
7985

8086
Join us in creating the future of standard file formatting.

docs/TEMPLATING_GUIDE.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# OpenFDD: The UI Templating Guide
2+
3+
Because OpenFDD rigidly enforces a **No-JS Security Model** (all `<script>` tags are strictly forbidden within the template), authoring beautiful, interactive Single-Page Applications requires leaning heavily into modern CSS logic and the native Declarative Action framework.
4+
5+
This guide will teach you the core principles of building robust `.fdd` container UI layouts without writing a single line of JavaScript.
6+
7+
---
8+
9+
## 1. The Anatomy of an OpenFDD Presentation Layer
10+
11+
Every `.fdd` file utilizes a Declarative Shadow Root explicitly bound to your cryptographic and mutable JSON pathways. Ensure your presentation code starts here:
12+
13+
```html
14+
<template shadowrootmode="open" bind="#fdd-data, #user-notes">
15+
<style>
16+
/* 1. Reset and base styling */
17+
:host { display: block; font-family: system-ui, sans-serif; }
18+
</style>
19+
20+
<!-- HTML Content Goes Here -->
21+
</template>
22+
```
23+
24+
### 1.1 Property Binding
25+
Your HTML will automatically evaluate against the `#fdd-data` and `#user-notes` JSON variables. Simply utilize Handlebar mustache syntax:
26+
`<h1>Welcome to {{workspaceTitle}}</h1>`
27+
28+
---
29+
30+
## 2. Dynamic Layouts & CSS Logic (No-JS Interactivity)
31+
32+
Without JavaScript event listeners (`onclick`, `onmouseover`), you must leverage pure CSS logic to build interactive elements like dropdowns, tabs, and modals!
33+
34+
### 2.1 The "Checkbox Hack" (State Toggling)
35+
You can build entire logic trees (like opening a Settings Modal or switching generic CSS tabs) utilizing native HTML `<input type="checkbox">` elements married to CSS pseudo-classes.
36+
37+
```html
38+
<style>
39+
.modal-content { display: none; }
40+
/* When the hidden checkbox is checked, evaluate sibling logic to display the modal */
41+
#modal-toggle:checked ~ .modal-content { display: block; }
42+
</style>
43+
44+
<input type="checkbox" id="modal-toggle" style="display: none;">
45+
<label for="modal-toggle" class="btn">Open Settings</label>
46+
47+
<div class="modal-content">
48+
<h2>Settings Panel</h2>
49+
<label for="modal-toggle" class="btn">Close</label>
50+
</div>
51+
```
52+
53+
### 2.2 Deep Theming (`:has()`)
54+
Use modern CSS capabilities to adapt your document strictly based on internal HTML constraints without JS computation.
55+
```css
56+
/* If a transaction list contains a negative flag anywhere, render the overarching parent container red! */
57+
.banking-dashboard:has(.negative-balance) {
58+
background-color: #fef2f2;
59+
border: 1px solid red;
60+
}
61+
```
62+
63+
---
64+
65+
## 3. Data Loops & Complex Layout Structuring
66+
67+
### 3.1 Looping through Arrays
68+
You can inject CSS Grid layouts effortlessly across massive datasets natively using `{{#each}}`.
69+
70+
```html
71+
<style>
72+
.data-grid {
73+
display: grid;
74+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
75+
gap: 15px;
76+
}
77+
</style>
78+
79+
<div class="data-grid">
80+
{{#each transactions}}
81+
<div class="card">
82+
<h3>Data Key: {{@index}}</h3>
83+
<p>Vendor: {{vendorName}}</p>
84+
<p>Amount: ${{amount}}</p>
85+
</div>
86+
{{/each}}
87+
</div>
88+
```
89+
90+
---
91+
92+
## 4. Single-Page Application (SPA) Routing
93+
94+
To simulate a React/Vue router purely using HTML, leverage OpenFDD's `ui-state` ephemeral manager and `fdd-match` layout tools.
95+
96+
### 4.1 Dispatching Route Updates
97+
Use standard FDD layout buttons to target the `selectedRoute` map natively:
98+
`<button fdd-action="set-ui" fdd-target="selectedRoute" fdd-value="settings">Go To Settings</button>`
99+
100+
### 4.2 Conditionally Rendering Views
101+
Apply `fdd-match` to explicitly evaluate that route. When evaluating false, the OpenFDD runtime prunes the layout automatically protecting rendering thresholds!
102+
103+
```html
104+
<!-- Home Application Route -->
105+
<div class="page-view" fdd-match="ui.selectedRoute" fdd-value="undefined">
106+
<h1>Welcome Home</h1>
107+
<button fdd-action="set-ui" fdd-target="selectedRoute" fdd-value="settings">View Settings</button>
108+
</div>
109+
110+
<!-- Settings Route -->
111+
<div class="page-view" fdd-match="ui.selectedRoute" fdd-value="settings">
112+
<h1>Settings Tab</h1>
113+
<!-- Returns home by clearing the active UI route -->
114+
<button fdd-action="set-ui" fdd-target="selectedRoute" fdd-value="undefined">Go Home</button>
115+
</div>
116+
```
117+
118+
---
119+
120+
## 5. Capturing User Mutations Elegantly
121+
122+
Finally, tie your beautiful layouts securely into the FDD State manager overriding generic HTTP forms natively.
123+
124+
### 5.1 Real-Time Text Binding
125+
`<input type="text" name="user-notes.email" value="{{email}}" autosave>`
126+
127+
### 5.2 Natively Pushing to an Array
128+
```html
129+
<form fdd-action="push" fdd-target="user-notes.inbox">
130+
<input type="text" name="message" placeholder="Type..." required>
131+
<button type="submit">Append Message</button>
132+
</form>
133+
```
134+
*Note: Any mutation bounds assigned outside of the `#user-notes` layer will reject securely to prevent cryptographic failure.*

site/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,14 @@ <h2>Tooling & Ecosystem Guide</h2>
197197

198198
<section style="text-align: center; background: #e2e8f0; padding: 3rem; border-radius: 12px; margin-bottom: 5rem; margin-top: 5rem;">
199199
<h2 style="margin-top: 0;">📣 How You Can Help Advocate!</h2>
200-
<p class="intro-text" style="max-width: 600px; margin: 0 auto 2rem;">The success of OpenFDD relies entirely on community pushback against static PDFs. Help spread the word so developers and managers adopt data-first standards!</p>
200+
<p class="intro-text" style="max-width: 650px; margin: 0 auto 2rem;">The success of OpenFDD relies entirely on community pushback against static PDFs. Leverage your sphere of influence to write, record, and share why data-first local documents resolve massive privacy and architecture bottlenecks!
201+
<br/><br/>
202+
<strong>Publicly demand Browsers, SaaS providers, and App Developers to explicitly add native support for the OpenFDD architecture!</strong></p>
201203

202-
<a href="https://twitter.com/intent/tweet?text=Stop%20sending%20dead%20PDFs.%20Documents%20should%20be%20data-first,%20not%20pictures%20of%20data.%20Learn%20why%20%23OpenFDD%20and%20Zero-JS%20interactive%20JSON-LD%20containers%20are%20the%20future%20of%20files!%20%20%0A%0A%F0%9F%93%84%20https://github.com/Spuds0588/open-fdd" class="button" style="background: #000; color: #fff; border-color: #000;">Share on X (Twitter)</a>
203-
<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/Spuds0588/open-fdd" class="button" style="background: #0077b5; color: #fff; border-color: #0077b5; margin-left: 10px;">Share on LinkedIn</a>
204+
<a href="https://twitter.com/intent/tweet?text=Stop%20sending%20dead%20PDFs.%20Documents%20should%20be%20data-first,%20not%20pictures%20of%20data.%20Learn%20why%20%23OpenFDD%20and%20Zero-JS%20interactive%20JSON-LD%20containers%20are%20the%20future%20of%20files!%20%20%0A%0A%F0%9F%93%84%20https://github.com/Spuds0588/open-fdd" class="button" style="background: #000; color: #fff; border-color: #000; margin-bottom: 10px;">Share on X (Twitter)</a>
205+
<a href="https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/Spuds0588/open-fdd" class="button" style="background: #0077b5; color: #fff; border-color: #0077b5; margin-left: 10px; margin-bottom: 10px;">Share on LinkedIn</a>
206+
<a href="https://reddit.com/submit?url=https://github.com/Spuds0588/open-fdd&title=OpenFDD:%20A%20Data-First,%20Zero-JS%20Alternative%20to%20PDFs" class="button" style="background: #FF4500; color: #fff; border-color: #FF4500; margin-left: 10px; margin-bottom: 10px;">Share on Reddit</a>
207+
<a href="https://youtube.com" target="_blank" class="button" style="background: #FF0000; color: #fff; border-color: #FF0000; margin-left: 10px; margin-bottom: 10px;">Make a YouTube Video</a>
204208
</section>
205209
</main>
206210
</body>

0 commit comments

Comments
 (0)