|
| 1 | +# Mashlib Data Browser |
| 2 | + |
| 3 | +Enable the [SolidOS Mashlib](https://github.com/SolidOS/mashlib) data browser for RDF resources. |
| 4 | + |
| 5 | +## Modes |
| 6 | + |
| 7 | +**CDN Mode** (recommended for getting started): |
| 8 | +```bash |
| 9 | +jss start --mashlib-cdn --conneg |
| 10 | +``` |
| 11 | +Loads mashlib from unpkg.com CDN. Zero footprint — no local files needed. |
| 12 | + |
| 13 | +**Local Mode** (for production/offline): |
| 14 | +```bash |
| 15 | +jss start --mashlib --conneg |
| 16 | +``` |
| 17 | +Serves mashlib from `src/mashlib-local/dist/`. Requires building mashlib locally: |
| 18 | +```bash |
| 19 | +cd src/mashlib-local |
| 20 | +npm install && npm run build |
| 21 | +``` |
| 22 | + |
| 23 | +**ES Module Mode** (for custom or next-gen mashlib builds): |
| 24 | +```bash |
| 25 | +jss start --mashlib-module https://example.com/mashlib.js |
| 26 | +``` |
| 27 | +Loads an ES module-based data browser from any URL. Uses `<script type="module">` and `<div id="mashlib">` (self-initializing). CSS is auto-derived by replacing `.js` with `.css`. Content negotiation is auto-enabled. |
| 28 | + |
| 29 | +## How It Works |
| 30 | + |
| 31 | +1. Browser requests `/alice/public/data.ttl` with `Accept: text/html` |
| 32 | +2. Server returns Mashlib HTML wrapper |
| 33 | +3. Mashlib fetches the actual data via content negotiation |
| 34 | +4. Mashlib renders an interactive, editable view |
| 35 | + |
| 36 | +**Note:** Mashlib works best with `--conneg` enabled for Turtle support. |
| 37 | + |
| 38 | +## Modern UI (SolidOS UI) |
| 39 | + |
| 40 | +```bash |
| 41 | +jss start --mashlib --solidos-ui --conneg |
| 42 | +``` |
| 43 | + |
| 44 | +Serves a modern Nextcloud-style UI shell while reusing mashlib's data layer: |
| 45 | +- Modern file browser with breadcrumb navigation |
| 46 | +- Profile, Contacts, Sharing, and Settings views |
| 47 | +- Path-based URLs (browser URL reflects current resource) |
| 48 | +- Responsive design for mobile devices |
| 49 | + |
| 50 | +Requires solidos-ui dist files in `src/mashlib-local/dist/solidos-ui/`. See [solidos-ui](https://github.com/solidos/solidos/tree/main/workspaces/solidos-ui) for details. |
| 51 | + |
| 52 | +## Profile Pages |
| 53 | + |
| 54 | +Pod profiles (`/alice/`) use HTML with embedded JSON-LD data islands and are rendered using: |
| 55 | +- [mashlib-jss](https://github.com/JavaScriptSolidServer/mashlib-jss) — A fork of mashlib with `getPod()` fix for path-based pods |
| 56 | +- [solidos-lite](https://github.com/SolidOS/solidos-lite) — Parses JSON-LD data islands into the RDF store |
| 57 | + |
| 58 | +This allows profiles to work without server-side content negotiation while still providing full SolidOS editing capabilities. |
0 commit comments