CLI tool to sync your Markdown to Leaflet
leafletpub atproto cli markdown

Update README

sharpmars.nekoweb.org fd6d07e0 7a5732bd

Waiting for spindle ...
+33 -4
+33 -4
README.md
··· 1 1 # Leaflet MD 2 2 3 - > ⚠ WARNING ⚠: This project is WIP 3 + > [!WARNING] 4 + > This project is WIP 4 5 5 6 CLI tool to *transplant* (sync) your Markdown to Leaflet. 6 7 ··· 9 10 10 11 ## Setup 11 12 12 - To set it up you need to create `leaflet-md.config.ts` and default export the config. Here's an example: 13 + To set it up you need to create `leaflet-md.config.[js|ts|mjs|mts]` and default export the config. Here's an example: 13 14 ```typescript 14 15 import { defineConfig } from "@sharpmars/leaflet-md"; 15 16 16 17 export default defineConfig({ 17 - glob: { pattern: "**/*.md", base: "./src/posts" }, 18 + glob: { pattern: "**/*.md", base: "./testing/posts" }, 18 19 frontmatter: { type: "yaml", titleKey: "title", descriptionKey: "description", uploadDateKey: "uploadedDate" }, 20 + publicationUri: "at://did:plc:irx36xprktslecsbopbwnh5w/pub.leaflet.publication/3m27dfyhhtk2a", 21 + prependDoc: { 22 + path: "./testing/leaflet-prepend.md", 23 + replacement: (key, ctx) => { 24 + if (key == "slug") return ctx.file.split(".")[0]; 25 + }, 26 + }, 19 27 }); 20 28 ``` 29 + If you want to use JSON you can create `leaflet-md.config.json` and type in your config in the same way you would in `defineConfig`. 30 + ```json 31 + { 32 + "glob": { 33 + "pattern": "**/*.md", 34 + "base": "./testing/posts" 35 + }, 36 + "frontmatter": { 37 + "type": "yaml", 38 + "titleKey": "title", 39 + "descriptionKey": "description", 40 + "uploadDateKey": "uploadedDate" 41 + }, 42 + "publicationUri": "at://did:plc:irx36xprktslecsbopbwnh5w/pub.leaflet.publication/3m27dfyhhtk2a", 43 + "prependDoc": { 44 + "path": "./testing/leaflet-prepend.md" 45 + } 46 + } 47 + ``` 48 + All options are available [here](https://tangled.org/@sharpmars.nekoweb.org/leaflet-md/blob/main/src/config.ts). 49 + 21 50 Additionally you need to create `.env` file with `BSKY_HANDLE` and `BSKY_PASSW`. 22 51 23 - Mapping between record key and file path is stored in `leaflet-md.map.json`. 52 + Mapping between record keys and file paths is stored in `leaflet-md.map.json`. 24 53 25 54 ## Development 26 55