Skip to content

Commit 70d379f

Browse files
committed
html-to-pdf: put the cheat sheet on 2 pages
1 parent 98628ba commit 70d379f

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

assets/sass/print.scss

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
}
2424

2525
footer {
26-
padding: 0;
27-
margin-top: 0;
26+
display: none;
2827
}
2928

3029
aside, .sidebar-btn, #search-container, #reference-version, #dark-mode-button, .site-source {
@@ -50,7 +49,8 @@
5049
border: 1px solid black;
5150
display: block;
5251
gap: 0;
53-
margin-bottom: 0;
52+
margin-bottom: 8px;
53+
padding: 8px;
5454

5555
.item {
5656
background: none;
@@ -64,12 +64,14 @@
6464
background: none;
6565
line-height: inherit;
6666
padding: 1px;
67+
display: block;
68+
margin-bottom: 2px;
6769
}
6870
}
6971
}
7072
.commit-reference {
7173
background: none;
72-
border-left: 0.5px;
74+
border-left: 1px solid black;
7375

7476
dl {
7577
gap: inherit;
@@ -113,8 +115,9 @@
113115

114116
.cheat-sheet {
115117
/* Multi-column layout */
116-
column-count: 6;
118+
column-count: 4;
117119
column-gap: 1em;
120+
margin-top: 20px;
118121

119122
h1 {
120123
column-span: all;
@@ -136,10 +139,15 @@
136139
margin-top: 2px;
137140
}
138141
}
142+
143+
/* Manual column break controls */
144+
.print-break-before {
145+
break-before: column;
146+
}
139147
}
140148
}
141149

142150
div#main .pdf-link img {
143151
float: right;
144152
height: 36px;
145-
}
153+
}

content/cheat-sheet/_index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h3>Commit all unstaged changes:</h3>
113113
</div>
114114
</section>
115115

116-
<section>
116+
<section class="print-break-before">
117117
<h2 id="move-between-branches">Move Between Branches</h2>
118118
<div class="item">
119119
<h3>Switch branches:</h3>
@@ -181,7 +181,7 @@ <h3>Show a summary of a diff:</h3>
181181
<code>git show &lt;commit&gt; --stat</code>
182182
</div>
183183
</section>
184-
<section class="commit-reference">
184+
<section class="commit-reference print-break-before">
185185
<h2 id="ways-to-refer-to-a-commit">Ways to refer to a commit</h2>
186186
<p class="intro">
187187
Every time we say <code>&lt;commit&gt;</code>, you can use any of these:
@@ -236,7 +236,7 @@ <h3>'Stash' all staged and unstaged changes:</h3>
236236
</div>
237237
</section>
238238

239-
<section>
239+
<section class="print-break-before">
240240
<h2 id="edit-history">Edit History</h2>
241241
<div class="item">
242242
<h3>"Undo" the most recent commit (keep your working directory the same):</h3>
@@ -285,7 +285,7 @@ <h3>Show who last changed each line of a file:</h3>
285285
</div>
286286
</section>
287287

288-
<section>
288+
<section class="print-break-before">
289289
<h2 id="combine-diverged-branches">Combine Diverged Branches</h2>
290290
<div class="item">
291291
<h3>Combine with rebase:</h3>
@@ -695,7 +695,7 @@ <h2 id="add-a-remote">Add a Remote</h2>
695695
</div>
696696
</section>
697697

698-
<section>
698+
<section class="print-break-before">
699699
<h2 id="push-your-changes">Push Your Changes</h2>
700700
<div class="item">
701701
<h3>Push the <code>main</code> branch to the remote <code>origin</code>:</h3>
@@ -757,7 +757,7 @@ <h3>See all possible config options:</h3>
757757
</div>
758758
</section>
759759

760-
<section>
760+
<section class="print-break-before">
761761
<h2 id="important-files">Important Files</h2>
762762
<div class="item">
763763
<h3>Local git config:</h3>

0 commit comments

Comments
 (0)