A tool for publishing static site markdown to the ATmosphere
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Switching to new spec

+26 -14
+6 -3
__tests__/standardizeToAtProto.test.ts
··· 56 56 }); 57 57 58 58 expect(doc.content).toEqual({ 59 - $type: 'site.standard.content.markdown', 60 - text: markdown, 61 - version: '1.0' 59 + $type: 'at.markpub.markdown', 60 + text: { 61 + rawMarkdown: markdown 62 + }, 63 + "flavor": "commonmark", 64 + "renderingRules": "markdown-it", 62 65 }); 63 66 }); 64 67
+2 -2
src/processMarkdown.ts
··· 23 23 return { data, content, fileName, pathToFile }; 24 24 } 25 25 26 - export const markdownToDocument(data: any, content: string) { 27 - 26 + export const markdownToDocument = (data: any, content: string) => { 27 + 28 28 } 29 29 30 30 export const setMarkdownFile = (pathToFile: string, titleProp: string, contentProp: string, fileData: any, overwriteData: boolean = false) => {
+18 -9
src/standardizeToAtProto.ts
··· 77 77 "uri": `at://did:plc:${string}`, 78 78 "cid": string 79 79 }, 80 - content?: { 81 - "$type": string, 82 - "text"?: string, 83 - "version"?: string 84 - } 80 + content?: any 85 81 } 82 + 83 + /** 84 + * { 85 + "$type": "at.markpub.markdown", 86 + "text": "<markdown here>", 87 + "flavor": "CommonMark", 88 + "preferredRenderer": "markdown-it", 89 + "extensions": ["YAML"] 90 + } 91 + */ 86 92 87 93 // Define a class that can hold the properties and logic of a site.standard.document 88 94 ··· 140 146 141 147 markdownToContent(value: string){ 142 148 return { 143 - "$type": "site.standard.content.markdown", 144 - "text": value, 145 - "version": "1.0" 146 - }; 149 + "$type": "at.markpub.markdown", 150 + text: { 151 + "rawMarkdown": value 152 + }, 153 + "flavor": "commonmark", 154 + "renderingRules": "markdown-it", 155 + } 147 156 } 148 157 149 158 markdownToTextContent(value: string){