Skip to content

Commit fd9ac9d

Browse files
committed
Last cheatsheet adjustments
1 parent 5390ec6 commit fd9ac9d

File tree

12 files changed

+124
-157
lines changed

12 files changed

+124
-157
lines changed

Cheatsheet.cheatmd

Lines changed: 58 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,18 @@
11
# Cheatsheet User Guide
22

33
This document is a cheatsheet on how to use cheatsheets.
4-
Cheatsheets are Markdown files with the `.cheatmd` extension.
4+
Cheatsheets are Markdown files with the `.cheatmd` extension. You may also check the source of this document as a reference.
55

66
## I'm a H2 title with 2 columns
77
{: .col-2}
88

9-
### To configure columns use the H2 title
10-
11-
| `full page` |_*default_|
12-
| `.width-50` | "half page" |
13-
| `.col-2` | "two-column"|
14-
| `.col-3` | "three-column"|
15-
| `-col-2-left` | "two-columns" (1/3 - 2/3) |
16-
17-
Set the number of columns under the H2 titles.
18-
199
### I'm a H3 title
2010

21-
Use H3 to start a new topic.
22-
2311
#### I'm a H4 title.
2412

25-
### Tables
13+
And this is a paragraph.
2614

27-
| `.full-page` | "full page" _*default_|
28-
| `.col-2` | "two-column"|
29-
| `.col-3` | "three-column"|
30-
| `-col-2-left` | "two-columns" (1/3 - 2/3) |
31-
| `.col-4` | "four-columns for lists"|
32-
| `.col-6` | "six-columns for lists"|
33-
| `.wrap` | "wrap a content"|
34-
| `.table-col` | "tables will take only 50% of the page"|
35-
36-
### Code and 3 columns
15+
### Code
3716

3817
```elixir
3918
# hello.exs
@@ -49,63 +28,61 @@ Greeter.greet("world")
4928

5029
### Paragraphs
5130

52-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at ante consectetur, pharetra magna a, malesuada lectus. Mauris porttitor ligula dui, at egestas augue hendrerit eget. Morbi lorem urna, scelerisque ut sem et, sollicitudin porta nulla.
31+
Paragraphs are also supported and can quote `code`.
32+
33+
Several paragraphs are visually distinct.
5334

5435
### Lists
5536

5637
- Element 1
5738
- Element 2
5839
- `piece of code`
5940

60-
### Adding variants
6141

62-
```
63-
## Section
64-
{: .col-2}
42+
### Table
6543

66-
"wrap a very long text"
67-
{: .wrap}
68-
```
44+
#### Date
6945

70-
Ex_docs uses Kramdown, and supports adding classes via Kramdown's syntax.
46+
| Example | Output |
47+
| --- | --- |
48+
| `%m/%d/%Y` | `06/05/2013` |
49+
| `%A, %B %e, %Y` | `Sunday, June 5, 2013` |
50+
| `%b %e %a` | `Jun 5 Sun` |
7151

72-
Full page and H3 titles
73-
-----------
74-
{: .full-page}
52+
This is a basic table with a h4 header.
7553

76-
### H3 tittles sections
54+
## Variants
55+
{: .col-2}
7756

78-
Each section can have the following children:
57+
### Adding variants
7958

80-
#### H4 title
59+
```
60+
## H2
61+
{: .col-2}
8162

82-
- `h4`
83-
- `lists`
84-
- `tables`
63+
### H3
64+
{: .list-6}
8565

86-
A paragraph with a cool text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed at ante consectetur, pharetra magna a, malesuada lectus. Mauris porttitor ligula dui, at egestas augue hendrerit eget.
66+
* example 1
67+
* example 2
68+
```
8769

88-
- `p`
70+
Variants customize how your cheatsheet looks like via Markdown's inline attribute notation.
8971

90-
```elixir
91-
Enum.map(users, fn user ->
92-
IO.puts "Hello " <> user
93-
end)
94-
```
95-
- `code`
72+
### Header variants
9673

97-
A highlight section!
98-
This is a section with `{: .prime}`. Notice the fancy highlight! Great for "getting started" kind of snippets.
99-
{: .prime}
74+
#### H2
10075

101-
### H3 title
76+
| `.col-2` | two-columns |
77+
| `.col-3` | three-columns |
78+
| `.col-2-left` | two-columns (1/3 - 2/3) |
10279

103-
Every box is an H3 title. The box will encompass everything inside the body of the H3.
80+
#### H3
10481

105-
This is a basic section with paragraphs in it.
82+
| `.list-4` | four-columns for lists |
83+
| `.list-6` | six-columns for lists |
10684

107-
Code
108-
----
85+
## Code
10986
{: .col-3}
11087

11188
### Code with headings
@@ -128,7 +105,7 @@ Code blocks can have headings.
128105

129106
### Long lines
130107

131-
```
108+
```elixir
132109
defmodule MyTracer do
133110
def trace({:remote_function, _meta, module, name, arity}, env) do
134111
IO.puts "#{env.file}:#{env.line} #{inspect(module)}.#{name}/#{arity}"
@@ -164,42 +141,37 @@ Add `wrap` to wrap long lines.
164141
## Lists
165142
{: .col-2}
166143

167-
### Lists
144+
### Bullet lists
168145

169146
- This is
170147
- a list
171148
- with a few items
172149

173-
Here's an extra paragraph after the list.
174-
175-
### Ordered List
150+
### Ordered lists
176151

177152
1. I'm first;
178153
2. You are second;
179154
3. We are third;
180155

181-
#### That was cool!
156+
Here's an extra paragraph after the list.
182157

183-
### Lists with headings
158+
### With headings and code links
184159

185160
#### Part 1
186161

187-
- `createElement()`
188-
- `componentDidMount()`
189-
- `componentWillUnmount()`
162+
- `is_atom/1`
163+
- `is_binary/1`
164+
- `is_number/1`
190165

191166
#### Part 2
192167

193-
- `shouldComponentUpdate()`
194-
- `componentWillReceiveProps()`
195-
196-
197-
Here's an extra paragraph after the list.
168+
- `length/1`
169+
- `elem/2`
198170

199171
## List columns
200172

201173
### Six columns
202-
{: .col-6}
174+
{: .list-6}
203175

204176
- One
205177
- Two
@@ -213,10 +185,10 @@ Here's an extra paragraph after the list.
213185
- Ten
214186
- Eleven
215187

216-
Add `{: .col-6}` after the H3 title to make large lists.
188+
Add `{: .list-6}` after the H3 title to make large lists.
217189

218190
### Four columns
219-
{: .col-4}
191+
{: .list-4}
220192

221193
- One
222194
- Two
@@ -230,52 +202,27 @@ Add `{: .col-6}` after the H3 title to make large lists.
230202
- Ten
231203
- Eleven
232204

233-
Add `{: .col-4}` after the H3 title to make large lists.
234-
235-
## Full page table
236-
237-
### Basic table
238-
239-
#### Date
240-
241-
| Example | Output |
242-
| --- | --- |
243-
| `%m/%d/%Y` | `06/05/2013` |
244-
| `%A, %B %e, %Y` | `Sunday, June 5, 2013` |
245-
| `%b %e %a` | `Jun 5 Sun` |
246-
247-
#### Time
205+
Add `{: .list-4}` after the H3 title to make large lists.
248206

249-
| Example | Output |
250-
| --- | --- |
251-
| `%H:%M` | `23:05` |
252-
| `%I:%M %p` | `11:05 PM` |
207+
## Full page
253208

254-
This is a basic table with h4's.
209+
This is the default.
255210

256-
## Page width 50%
211+
## Half width
257212
{: .width-50}
258213

259214
### I make tables look nicer
260215

261-
#### Date
262-
263-
| Example | Output |
264-
| --- | --- |
265-
| `%m/%d/%Y` | `06/05/2013` |
266-
| `%A, %B %e, %Y` | `Sunday, June 5, 2013` |
267-
| `%b %e %a` | `Jun 5 Sun` |
268-
269216
#### Time
270217

271218
| Example | Output |
272219
| --- | --- |
273220
| `%H:%M` | `23:05` |
274221
| `%I:%M %p` | `11:05 PM` |
275222

276-
Use `.width-50` for a half page content.
223+
Add `{: .width-50}` after the H2 title to use only half width.
277224

278-
## Left reference
225+
## Column left reference
279226
{: .col-2-left}
280227

281228
### One
@@ -307,14 +254,10 @@ IO.puts "Hello, " <> user.name
307254

308255
### Three
309256

310-
```
311-
defmodule MyModule do
312-
def hello_world do
313-
IO.puts("Hello, World!")
314-
end
315-
end
316-
```
257+
* Yet
258+
* Another
259+
* List
317260

318261
### Four
319262

320-
I'm a grid, with 1/3 - 2/3 table width.
263+
I'm a grid, with 1/3 - 2/3 width.

assets/css/content/cheatsheet.css

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
.page-cheatmd h3 {
2828
white-space: nowrap;
2929
overflow: hidden;
30-
margin: 0 0 1em 0;
30+
margin: 0 0 1em;
3131
padding-left: 5px;
3232
color: var(--main);
3333
font-weight: 400;
@@ -68,7 +68,7 @@
6868

6969
.page-cheatmd.dark h4 {
7070
background: #192f50;
71-
color: #fff;
71+
color: var(--textBody);
7272
border: 1px solid #192f50;
7373
border-bottom: 0;
7474
}
@@ -186,15 +186,6 @@
186186

187187
/* Columns */
188188

189-
.page-cheatmd section.full-page {
190-
display: block;
191-
width: 100%;
192-
}
193-
194-
.page-cheatmd section.full-page > section > table {
195-
width: 100%;
196-
}
197-
198189
.page-cheatmd section.width-50 {
199190
display: block;
200191
width: 50%;
@@ -228,21 +219,21 @@
228219
height: auto;
229220
}
230221

231-
.page-cheatmd section.col-4 > ul {
222+
.page-cheatmd section.list-4 > ul {
232223
display: flex;
233224
flex-wrap: wrap;
234225
}
235226

236-
.page-cheatmd section.col-4 > ul > li {
227+
.page-cheatmd section.list-4 > ul > li {
237228
flex: 0 0 25%;
238229
}
239230

240-
.page-cheatmd section.col-6 > ul {
231+
.page-cheatmd section.list-6 > ul {
241232
display: flex;
242233
flex-wrap: wrap;
243234
}
244235

245-
.page-cheatmd section.col-6 > ul > li {
236+
.page-cheatmd section.list-6 > ul > li {
246237
flex: 0 0 16.6667%;
247238
}
248239

@@ -266,27 +257,27 @@
266257
column-count: 1;
267258
}
268259

269-
.page-cheatmd section.col-6 > ul > li {
260+
.page-cheatmd section.list-6 > ul > li {
270261
flex: 0 0 25%;
271262
}
272263
}
273264

274265
@media (max-width: 1000px) {
275-
.page-cheatmd section.col-4 > ul > li {
266+
.page-cheatmd section.list-4 > ul > li {
276267
flex: 0 0 33%;
277268
}
278269

279-
.page-cheatmd section.col-6 > ul > li {
270+
.page-cheatmd section.list-6 > ul > li {
280271
flex: 0 0 33%;
281272
}
282273
}
283274

284275
@media (max-width: 600px) {
285-
.page-cheatmd section.col-4 > ul > li {
276+
.page-cheatmd section.list-4 > ul > li {
286277
flex: 0 0 50%;
287278
}
288279

289-
.page-cheatmd section.col-6 > ul > li {
280+
.page-cheatmd section.list-6 > ul > li {
290281
flex: 0 0 50%;
291282
}
292283
}

assets/css/content/general.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
.content-inner a.view-source:hover {
6969
color: var(--viewSourceHover);
7070
}
71+
.content-inner a.view-source:visited {
72+
color: var(--viewSource);
73+
}
7174

7275
.content-inner .settings {
7376
background-color: transparent;

formatters/html/dist/html-FHOK2366.js renamed to formatters/html/dist/html-XN2TSG4M.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

formatters/html/dist/html-elixir-2YOS5DIE.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

formatters/html/dist/html-erlang-4XYKNH4U.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)