-
Notifications
You must be signed in to change notification settings - Fork 33
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
set_textType and friends need better markdown support #298
Comments
Good catch. Agree on the current implementation being a bit error-prone. EML 2.2.0 got Markdown support in part because of its popularity and ubiquity but also because the pre-2.2.0 TextType module was really hard to use. I think defaulting to a Markdown-first experience from here on out is a good idea. Another API it'd be nice to support would be list(methodStep = list( # or set_methods(markdown = ) instead
list(description = list(
markdown = "# Header
Example text.
"))))
so people can keep everything in the same R/Rmd. @jeanetteclark are you or others on the Data Team using markdown for your TextType elements? @clnsmth, @earnaud? |
@amoeba not usually |
Thanks for reaching out @amoeba @cboettig. I'm mostly using .docx because that's the preferred file type our data contributors submit their abstract and methods to us. Sadly, I'm using it to remove most of the text formatting before sending it to I very much welcome improved support for .md > EML (.xml) and many thanks in advance to whoever takes this on! |
@clnsmth Thanks! that's a great point. I think we should probably replace the existing mechanism which uses pandoc to convert I don't have any good solution for what to do about this in |
Thanks @cboettig. I think I’m on board with this but have a clarifying question. In the proposed changes, will at least the current level of support for |
Thanks @clnsmth for the feedback, that's good to know. I'm a bit wary of the transforms into docbook set_TextType("myfile.docx", as = "markdown")
set_methods("mymethods.docx", as = "markdown") etc to encode in markdown, and maybe: set_TextType("myfile.docx", as = "xml")
set_methods("mymethods.docx", as = "xml") to encode as docbook. we could haggle over whether Thoughts? Thanks again for the feedback! |
p.s. accidentally posted the above half-way through writing it, so if you're following via email, see updated thread on GitHub. apologies. |
Good point on backwards compatibility, @clnsmth. I think the ideas here are to maintain the ability to bring
The current function signature of function(file = NULL, text = NULL) and I think we can get all of this working with a change to function(file = NULL, text = NULL, markdown = TRUE) The function will retain the first part of its signature and the added For any
Note: When using the Does this sound workable? PS: @clnsmth , you said:
Did you mean "continued support for our mini-DocBook, aka |
I don't think we have a very good way for users to supply markdown input. (The current examples showing support for markdown files still use the 2.1.1 strategy of converting to docbook via pandoc, which is error-prone as a EML doesn't support all docbook terms).
We can get valid 2.2.0 markdown 'manually', e.g. something like:
but it would be much better to support something closer to the current sytnax in the example, e.g. maybe:
(Functions would also need a check to make sure we were in 2.2.0 mode).
Anyone generating EML with markdown sections currently? Do you do something like the above? Any takers on a PR on this one?
The text was updated successfully, but these errors were encountered: