Closed mwu closed 6 years ago
Great! This is worth doing even though it doesn't take advantage of the full potential of PandocMonad.
To go further, one might define a special instance of PandocMonad that is specifically tailored to a gitit wiki. (Maybe it would suffice to make this ContentTransformer, but I suspect we'd need a new monad entirely, because we'd need its features elsewhere too. Maybe a Gitit monad? Sorry, it's been a while since I've looked at the code.)
The instance could be designed so that, for example, when you use the functions that read from files, they read from files on the wiki (wiki pages or pages in static), but can't do anything else on the file system. (Similarly for writing.)
Similarly, the logging/warning mechanism could be tailored so that messages would appear on the wiki pages rather than being logged to stderr. (If that's desirable?)
This compiles and works properly, but I'm not totally sure if this is really the intent behind PandocMonad. I neither defined an instance nor worked it into the monad transformer stack, I wound up just using runIO (and runPure where I could) to unwind the monad usually in functions of other monads. I wasn't sure if I could define a PandocMonad instance for ContentTransformer or work PandocIO into the monad transformer stack. Let me know if either is what you want me to try and pursue...