-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Users to choose which file formats to generate SRS in #2751
Comments
I've started a bit on this issue, but I the idea I came up with feels super hacky, though I can't quite put my finger on it. I wanted to make it so that the user can pass in the I started by making the -- added a list of possible formats to the SRS constructor so users can choose either PDF, HTML, or Plain
-- Choosing Plain at the moment will return nothing
data DocType = SRS [Format] | Website Then, following through with the implementation, I made -- make prnt recursive over the list of Format
prnt sm dt@(DocSpec (SRS (x:xs)) fn) body =
-- manually put 'x' into a singleton list
do prntDoc (DocSpec (SRS [x]) fn) body sm
prntAuxFiles
prnt sm (DocSpec (SRS xs) fn) body
where
prntAuxFiles = case x of
TeX -> prntMake dt
HTML -> prntCSS SRS fn body
_ -> return
prnt sm dt@(DocSpec _ fn) body = return
-- added pattern matches for HTML and TeX but it seems pretty fragile
prntDoc :: DocSpec -> Document -> PrintingInformation -> IO ()
prntDoc (DocSpec Website fn) d pinfo = prntDoc' "Website" fn HTML d pinfo
prntDoc (DocSpec (SRS [HTML]) fn) d pinfo = prntDoc' "SRS/HTML" fn HTML d pinfo
prntDoc (DocSpec (SRS [TeX]) fn) d pinfo = prntDoc' "SRS/PDF" fn TeX d pinfo
prntDoc (DocSpec _ fn) d pinfo = error "Something is wrong in prntDoc. This should not happen." Is there anything I should do to make this better? I thought about making the |
Based on #1732, from Dr. Carette and Dr. Smith,
The text was updated successfully, but these errors were encountered: