gadenbuie / xaringanthemer

😎 Give your xaringan slides some style
https://pkg.garrickadenbuie.com/xaringanthemer/
Other
445 stars 28 forks source link

Better horizontal alignment for code blocks #68

Closed gadenbuie closed 3 years ago

gadenbuie commented 3 years ago

Thanks to the suggestion by #61 @bbartholdy, this PR improves the horizontal alignment of code blocks when used with left, center or middle class slides. The new styles set text-align: start on <pre> elements, reduce (if possible) the width of the <pre> element so that it's not stretched to fill the slide, and use margins to push the code block to the left, center or middle.

Slide Class Preview
normal image
left image
center image
right image
codecov-commenter commented 3 years ago

Codecov Report

Merging #68 (e71250b) into master (9f7460e) will decrease coverage by 0.94%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
- Coverage   94.48%   93.53%   -0.95%     
==========================================
  Files          17       17              
  Lines         743      743              
==========================================
- Hits          702      695       -7     
- Misses         41       48       +7     
Impacted Files Coverage Δ
R/utils.R 82.60% <0.00%> (-15.22%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9f7460e...e71250b. Read the comment docs.