csesoc/website

Ghost Exporter - Image Uploading + Code Block

Opened this issue · 1 comments

Update the ghost exporter to support image uploading + code blocks, would also be nice if we had an option of specifying if we want to upload images to our local cms or staging

also fix this too pls 🥺

// this is so hacky im sorry :(, please fix this later
(it was a temp hack i added so we could get the exporter script running before the MVP)

let rec sequenceSubsections = function
    | [] -> Ok []
    | x :: xs -> match x with
                             | JArray inner -> match parseSectionBlockList inner with
                             | Ok arr -> (fun parsedValue -> List.append arr parsedValue) <!> (sequenceSubsections xs)
                            | Error x -> Error x
    | o -> Decode.Fail.arrExpected o

section.createSection <!> (sequenceSubsections <| List.ofSeq subsectionArray) <*> (Ok Paragraph)

the purpose of the snippet is to compress lists into a big paragraph (coz FE doesnt support rendering lists), would be nice if we split this into its own function instead so we an update it nicely when the frontend does support lists