-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add docx render option #303
Conversation
Re-rendered previews from the latest commit:
Updated at 2021-11-03 with changes from 4947b94 |
This is some preliminary code to allow writing I'm not experienced enough with github actions to know what's missing here. Basically, all checks pass and logs look fine but no docx files are created by github actions. Files are created fine locally. @cansavvy @carriewright11 would love your thoughts here! Hopefully I'm just missing something really obvious 🙂 |
@avahoffman thanks for doing this! This is a great start! I have a few things I think we need to add to wrap this up:
I'm happy to commit these changes to your branch if you want, or if you prefer to do them yourself, that's also fine. Just let me know. |
@cansavvy agreed on all points! I did a 180 and made the docx creation part of the yml - it just renders the whole book as a docx based on _bookdown.yml - easier for everyone :)
Not sure what you mean here - is there an equivalent of https://htmlpreview.github.io for other formats (docx?) |
Just something in that comment that brings people to the created file -- makes it clear that the file was made and where to find it. I can set this up if you like. |
@@ -8,6 +8,9 @@ biblio-style: apalike | |||
link-citations: yes | |||
description: "Description about Course/Book." | |||
favicon: assets/dasl_favicon.ico | |||
output: | |||
bookdown::word_document2: | |||
toc: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary in addition to the output_format = 'all'
? Sometimes bookdown has things that are redundant and confusing. So just wondering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Locally, bookdown::render_book(output_format = "all")
renders the docx but bookdown::render_book()
doesn't. I agree it's weird and kind of redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation:
If using NULL then the output format is the first one defined in the YAML frontmatter in the input file (this defaults to HTML if no format is specified there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always so confused by the various places where yamls are specified and how to know which is prioritized. But if you have it figured out then sounds good to me! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha me too - it took me forever to find that bit in the docs :P
Yay. Take a look at #303 (comment) I definitely think this is something we should add to Release 1.2 #300 I think we can almost merge it (if you are ready). We might want to think about how we advise this docx is used though. We could probably be fancy and have changes to the docx uploaded to Google Drive, but I'd also hate for people's edits to get overwritten at any point, so I'm not sure what's the ideal workflow for this. I'll make an issue for us to discuss this. Edit: see #306 |
Thanks for adding! I didn't think to reference the preview branch 🙂 |
Good job to both of you! I will check out the discussion issue that @cansavvy created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I mark this PR as ready and merge it then, @avahoffman ?
@@ -8,6 +8,9 @@ biblio-style: apalike | |||
link-citations: yes | |||
description: "Description about Course/Book." | |||
favicon: assets/dasl_favicon.ico | |||
output: | |||
bookdown::word_document2: | |||
toc: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm always so confused by the various places where yamls are specified and how to know which is prioritized. But if you have it figured out then sounds good to me! 👍
The Render preview fail is just a temporary problem due to Docker's server. Nothing crazy. Should be resolved if we re-run in a tad. |
Woo! Thanks for working with me here! It's the remote dev I love to see 😄 |
Purpose/implementation Section
This PR is attempting to create a docx rendering option. This is mostly because I believe the GDSCN community would like to download student activities in word format so they can have the option be easily edited in whatever format suits them. I'm imagining two links at the bottom of the bookdown, "Download as .Rmd" and "Download as .docx"
What changes are being implemented in this Pull Request?
Addition of a docx rendering section in the rendering workflow
What was your approach?
Adding a rendering script. Not sure this is how we want it / is the best way to do this. Kind of feel it looks ugly compared to the other rendering, but this is just a first pass.
What GitHub issue does your pull request address?
N/A
Tell potential reviewers what kind of feedback you are soliciting.
Does this fit with the quality of the template?
New Content Checklist
New content/chapter is in an Rmd file with this kind of format and headers.
New content/chapter contains Learning Objectives and are in the correct format.
Bookdown successfully re-renders and any new content files have been added to the _bookdown.yml.
Spell check runs successfully in Github actions style-n-check).
Any newly necessary packages that are needed have been added to the Dockerfile and image.
Images are in the correct format for rendering.
Every new image has alt text and is in a Google Slide.
Each slide is described in the notes of the slide so learners relying on a screen reader can access the content. See https://lastcallmedia.com/blog/accessible-comics for more guidance on this.
The color palette choices of the slide are contrasted in a way that is friendly to those with color vision deficiencies.
You can check this using Color Oracle.