Skip to content

Commit

Permalink
Merge pull request #71 from carpentries/media-print-solution
Browse files Browse the repository at this point in the history
Format printing of lesson contents
  • Loading branch information
zkamvar authored Dec 19, 2022
2 parents 1048b7d + 235598d commit 6c4cf36
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: varnish
Title: Front-end for The Carpentries Lesson Template
Version: 0.2.10
Version: 0.2.11
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# varnish 0.2.10

* Formatted print media to avoid breaking in important contexts (code blocks,
callout blocks, instructor notes) and shows solutions and instructor notes.
(reported: Anonymous, #70; fixed: @zkamvar, #71)

# varnish 0.2.10

* Fix issue with bullet points in callouts being mis-aligned
(reported: @sstevens2, #68; fixed: @zkamvar, #69)

Expand Down
2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/pkgdown/assets/assets/styles.css.map

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions source/stylesheets/styles.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,41 @@ figcaption {
}

}

@media print {
// force solutions and instructor notes to show on print
.accordion-collapse {
display: unset !important;
}
// do not display navigation or search forms or extraneous decoration
button, nav, footer, form.search-form, #to-top, div.callout-square, .lesson-progress {
display: none !important;
}
// source: <https://css-tricks.com/almanac/properties/p/page-break/#aa-example>
h2 {
page-break-before: auto;
}
h3, h4 {
page-break-after: avoid;
}
pre, blockquote, .callout, .instructor-note, .challenge-accordion {
page-break-inside: avoid;
border-style: solid;
}
// add solution heading before the solution
.challenge-accordion::before {
content: "Solution";
display: block;
text-size: 18pt;
text-decoration: underline;
}
.instructor-note::before {
content: "Instructor Note";
display: block;
text-size: 18pt;
text-decoration: underline;
}
pre {
overflow: unset !important;
}
}

0 comments on commit 6c4cf36

Please sign in to comment.