yihui / xaringan

Presentation Ninja 幻灯忍者 · 写轮眼
https://slides.yihui.org/xaringan/
Other
1.49k stars 280 forks source link

Allow users to specify classes applied to title slide #136

Closed gadenbuie closed 6 years ago

gadenbuie commented 6 years ago

There are quite a few issues here and questions on GitHub from users who want to make simple adjustments to their title slides, such as applying the left, bottom CSS classes. Currently, the classes applied to the title slide are hard-coded in the pandoc template: https://github.com/yihui/xaringan/blob/3fdeb9bbc0f8b151aa05ed33bd2245ac5e2fcb0a/inst/rmarkdown/templates/xaringan/resources/default.html#L24-L26

It may be worth considering an API change to moon_reader that would allow the user to modify the classes applied to the title slide. It seems like this is a point of friction with users, in particular for those who simply want to change the text alignment on the title slide. It also seems to me like more effort than necessary to ask the user to recreate the title slide manually for a change like replacing center with left.

As an initial suggestion, I think that it would be great if there were a user facing option that defaulted to "center, middle, inverse" that could be adjusted. This could be as an additional argument to the nature parameter of moon_reader(). There are already two other arguments to nature "besides the options provided by remarkjs": autoplay and countdown.

If this idea is acceptable to the community, I'll be happy to follow up with a plan of action and eventually a PR.

Here are some of the issues that bring up the title slides style and that would be more-or-less addressed with this change: #124, #117, #95, #84, #5 (sort of).

yihui commented 6 years ago

Sounds like a great idea to me!

yihui commented 6 years ago

@gadenbuie Could you notify users in the issues you mentioned above of the new titleSlideClass option? Thanks!