A WhiteWind blog to Leaflet publication conversion tool

Update README.md

authored by ewancroft.uk and committed by GitHub 43b8a230 75e4e905

Changed files
+45 -42
+45 -42
README.md
··· 1 - # `whtwnd-to-leaflet` 1 + # whtwnd-to-leaflet 2 2 3 - A simple web-based tool for converting WhiteWind blog entries into the Leaflet publication format. This converter streamlines the migration process for users on the AT Protocol, transforming blog content, metadata, and themes from one service to another. 3 + A simple browser-based tool for converting WhiteWind blog entries into the Leaflet publication format. It helps migrate content, metadata, and themes from WhiteWind to Leaflet on the AT Protocol. 4 + 5 + ⚠️ **Experimental** — output is not guaranteed to be fully accurate yet. 4 6 5 - ***This is not at all guaranteed to be accurate. it's experimental right now.*** 7 + --- 6 8 7 9 ## How It Works 8 10 9 - The converter is a single-page web app that runs entirely in the browser, with no backend required. 10 - 11 - The process involves three main steps: 11 + The app is a single-page web tool (built with **SvelteKit + TypeScript + Tailwind** on Svelte 5) that runs entirely in the browser. No backend is required. It produces a Leaflet-compatible **publication record** plus one or more **document records** from your WhiteWind entries. 12 12 13 - * **Publication Setup**: Provide basic information for your Leaflet publication, such as the name, description, and your AT Protocol DID. You can also configure preferences like enabling comments and whether your publication should appear in the Leaflet Discover feed. 14 - * **Theme Configuration**: Customise the publication’s look with colour settings for the primary, background, and page background colours. 15 - * **Entry Conversion**: Paste your WhiteWind blog entries JSON. The tool will: 16 - * **Parse Markdown** → Converts markdown into structured Leaflet document blocks (headers, text, blockquotes, code blocks, images, etc.). 17 - * **Convert AT-URIs** → Transforms WhiteWind blob URLs into standard `at://` URIs. 18 - * **Transform Schema** → Outputs two JSON files: one **publication record** and one or more **document records**. 19 - # whtwnd-to-leaflet 13 + The process involves three steps: 20 14 21 - A small browser tool that converts WhiteWind blog entries into the Leaflet publication format. 15 + 1. **Publication Setup** 16 + Provide publication details such as name, description, base path, and AT Protocol DID. Configure preferences like enabling comments and whether to appear in the Leaflet Discover feed. 22 17 23 - This repository contains a SvelteKit + TypeScript + Tailwind project (Svelte 5). The app runs entirely in the browser and produces a Leaflet-compatible publication record plus one or more document records from your WhiteWind entries. 18 + 2. **Theme Configuration** 19 + Choose colours for the publication’s primary, background, and page background. 24 20 25 - ## How it works 21 + 3. **Entry Conversion** 22 + Paste a JSON export of WhiteWind entries (either an array or an object with `records`/`data`). The converter will: 23 + - **Parse Markdown** → transforms into Leaflet blocks (headers, text, blockquotes, code, images, horizontal rules). 24 + - **Convert AT-URIs** → changes WhiteWind blob/CID URLs into `at://` URIs where possible. 25 + - **Output JSON** → emits one publication record and document records (ZIP export supported). 26 26 27 - - Publication Setup — provide publication name, optional base path and description, and preferences. 28 - - Theme Configuration — pick primary, background and page background colours. 29 - - Entry Conversion — paste a JSON array of WhiteWind entries (or an object with `records`/`data` containing an array). The tool: 30 - - parses markdown into Leaflet blocks (headers, text, blockquotes, code, images, horizontal rules), 31 - - converts blob/CID URLs into `at://` URIs when possible, 32 - - emits a publication JSON and document JSON records (ZIP export supported). 27 + --- 33 28 34 29 ## Usage 35 30 36 - Web usage: 31 + **Web app:** 37 32 38 - 1. Fill out Publication Setup and Theme Configuration in the app UI. 39 - 2. Paste your WhiteWind JSON entries into the text area. You can fetch this from your PDS endpoint: 33 + 1. Fill out Publication Setup and Theme Configuration. 34 + 2. Paste your WhiteWind JSON entries into the text area. You can fetch them from your PDS with: 40 35 41 36 ``` 42 - https://[pds domain]/xrpc/com.atproto.repo.listRecords?repo=[did]&collection=com.whtwnd.blog.entry 43 - ``` 37 + 38 + https\://\[pds domain]/xrpc/com.atproto.repo.listRecords?repo=\[did]\&collection=com.whtwnd.blog.entry 39 + 40 + ```` 44 41 45 - 3. Enter your Author DID. 46 - 4. Click **Convert to Leaflet**. 42 + 3. Enter your Author DID. 43 + 4. Click **Convert to Leaflet**. 47 44 5. Copy or download the generated JSON files, or use the ZIP export. 48 45 49 - Local development (SvelteKit) 46 + **Local development:** 50 47 51 48 ```bash 52 49 npm install 53 50 npm run dev 54 - ``` 51 + ```` 55 52 56 - Open the URL printed by Vite (usually http://localhost:5173). 53 + Open the URL from Vite (usually `http://localhost:5173`). 57 54 58 - Build & preview 55 + **Build & preview:** 59 56 60 57 ```bash 61 58 npm run build 62 59 npm run preview 63 60 ``` 64 61 65 - ## Files of interest 62 + --- 63 + 64 + ## Files of Interest 65 + 66 + * `src/routes/+page.svelte` — main UI and form handling 67 + * `src/lib/convert.ts` — core conversion logic (TID generation, markdown → blocks, URL conversions) 68 + * `src/lib/styles.css`, `src/lib/variables.css` — styles and theme variables 69 + * `src/types/file-saver.d.ts` — small type declaration 70 + 71 + --- 66 72 67 - - `src/routes/+page.svelte` — main UI and form handling 68 - - `src/lib/convert.ts` — conversion logic (TID generation, markdown → blocks, URL conversions) 69 - - `src/lib/styles.css`, `src/lib/variables.css` — styles and variables 70 - - `src/types/file-saver.d.ts` — small type declaration 73 + ## Development Notes 71 74 72 - ## Development notes 75 + * Supports JSON arrays of entries or objects with `records`/`data` arrays. 76 + * Inline rich-text facets (links, bold, italic, code) are extracted when possible and attached to text blocks. 73 77 74 - - The converter accepts either a JSON array of entries or an object with `records`/`data` arrays to support different export formats. 75 - - Inline rich-text facets (links, bold, italic, code) are extracted when possible and attached to text blocks. 78 + --- 76 79 77 80 ## License 78 81 ··· 80 83 81 84 --- 82 85 83 - Project: https://github.com/ewanc26/whtwnd-to-leaflet 86 + **Project:** [ewanc26/whtwnd-to-leaflet](https://github.com/ewanc26/whtwnd-to-leaflet)